3

I want to add a promo code form programmatically on one page checkout page of Magento 1.8 CE. This has to be added under payment review section.

Added following snippet to layout/checkout.xml of active theme:

<block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>

then added following php code to template/checkout/onepage.phtml

But its not working, please help!

<?php echo $this->getChildHtml('coupon') ?> 
Vishal Patil
  • 485
  • 4
  • 15

1 Answers1

4

In checkout.xml layout file add as following,

<block type="checkout/onepage_review_info" name="root" output="toHtml" template="checkout/onepage/review/info.phtml">    
...    
    <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>    
...    
</block>

And put the following code in app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/checkout/onepage/review/info.phtml

<?php echo $this->getChildHtml('coupon') ?>
Dushyant Joshi
  • 3,672
  • 3
  • 28
  • 52