How to create and allow cash on delivery checkbox on billing address step of checkout? If it's enabled then cash on delivery payment method should be visible on payment step.

  • Welcome to Magento SE. This requirement sounds strange but maybe I don't understand it correctly. Can you explain in more detail what you are trying to do? Why should the customer select the payment method in the billing address step? – Fabian Schmengler Jul 1 '16 at 13:35
  • 1
    It is Task for me ... i want to put the checkbox on billing address step of checkout. – H_Parekh Jul 4 '16 at 5:02

in billing.phtml create Your New Checkbox.

paste this code..

<li class="control">

                    <input type="checkbox" name="cod" value="You-Select-Cash-On-Delivery" title="" id="cod1" onchange="" checked="" class="checkbox" /><label for="">
                    <?php echo $this->__('Cash on Delivery') ?></label>

                                echo "Checked !!!";                             
                                $var = Mage::app()->getRequest()->getPost('cod'); //session store variable

Then Go to methods.phtml


Paste This Code

<?php $outputMessage =Mage::getSingleton('core/session')->getCod(); echo $this->__($outputMessage); ?>

At Last Go TO OnepageController.phtml


Find saveBillingAction() Paste This Code...

$var = Mage::app()->getRequest()->getPost('cod');
  • Great Code!!!!!!!!! It's work for me..... – H_Parekh Jul 5 '16 at 10:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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