0

I want to change credit card type option into radio button. for that i have found file ccsave.phtml

Here is the code of select box that appear in checkout page.

<div class="input-box">
            <select id="<?php echo $_code ?>_cc_type" name="payment[cc_type]" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Credit Card Type')) ?>" class="required-entry validate-cc-type-select">
                <option value=""><?php echo $this->__('--Please Select--') ?></option>
            <?php $_ccType = $this->getInfoData('cc_type') ?>
            <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
                <option value="<?php echo $_typeCode ?>"<?php if($_typeCode==$_ccType): ?> selected="selected"<?php endif ?>><?php echo $_typeName ?></option>
            <?php endforeach ?>
            </select>
        </div>

thanks in advance.

0

1 Answer 1

1

Try below code

<div class="input-box">                
    <?php $_ccType = $this->getInfoData('cc_type') ?>
    <?php foreach ($this->getCcAvailableTypes() as $_typeCode => $_typeName): ?>
        <input type="radio"  name="payment[cc_type]" value="<?php echo $_typeCode ?>" />               
    <?php endforeach ?>       
</div>

This will render as radio. for validation you need to add your validation logic

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.