2

I have only one coupon code, I want to display this coupon code on the cart page and the checkout page.

  • Hi Vinod@ you can use the below code which will be useful. thanks – Nagaraju K Feb 17 '17 at 6:17
  • it is not working – Vinod Kumar Feb 17 '17 at 6:19
  • let me know exact error you are getting? first of all whether your coupon code applying properly..? – Nagaraju K Feb 17 '17 at 6:19
  • it is neither display any error nor any result. – Vinod Kumar Feb 17 '17 at 6:23
  • could you share the screenshot please – Nagaraju K Feb 17 '17 at 6:26
2

You can use the following to Get Coupon code on cart page and checkout page

Mage::getSingleton('checkout/session')->getQuote()->getCouponCode();
2

This is a comment on the last answer's solution.

My webshop is using Magento 1.9.3.2.

I the answer's solution at the bottom of the file:

magento/app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml

This is the code to add to local.xml:

<block type="core/template" name="getcoupon" output="toHtml" template="custom/info.phtml">    

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

</block>

See screenshot of the added code in my local.xml:

https://snag.gy/F1ACQs.jpg

But this not result in showing the coupon code on the checkout page.

To make it work right do I also have to add this same code to the file:

app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/custom/info.phtml ?

1

Use the following code to get the Coupon code on the cart page and checkout page:

magento/app/design/frontend/YOUR_PACKAGE/YOUR_THEME/layout/local.xml

<block type="core/template" name="getcoupon" output="toHtml" template="custom/info.phtml">    
...    
    <block type="checkout/cart_coupon" name="checkout.cart.coupon" as="coupon" template="checkout/cart/coupon.phtml"/>    
...    
</block> 

app/design/frontend/YOUR_PACKAGE/YOUR_THEME/template/custom/info.phtml

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.