Jake N
Jake N

Reputation: 10583

Magento Coupon Code not appearing

I have added a coupon discount in Magento.

But the block to add the code is not appearing at checkout or on product pages.

I have tried installing this extension http://www.magentocommerce.com/magento-connect/discount-coupon-code-checkout-page.html but its had no effect.

Do I need to make changes in the XML or PHP to render the discount block?

Upvotes: 0

Views: 7292

Answers (2)

vritika
vritika

Reputation: 21

In my case discount was not appearing in the shopping-cart-totals-table what I did is: in file: /app/design/frontend/base/default/template/checkout/cart/totals.phtml I added below code before renderTotals()

         $totals = Mage::getSingleton('checkout/session')->getQuote()->getTotals(); //Total object
                    if(isset($totals['discount']) && $totals['discount']->getValue()) {
                     $discount = Mage::helper('core')->currency($totals['discount']->getValue()); //Discount value if applied
                    } else {
                     $discount = '';
                    }
                    if($discount!=''){
                ?>
                <tr><td class="a-right"><strong>Discount (Festive5):</strong></td><td class="a-right"><?php echo $discount;?></td></tr>
                <?php } ?>
                <?php echo $this->renderTotals();?>

It will display discount coupon code value.

Upvotes: 0

Christophe Ferreboeuf
Christophe Ferreboeuf

Reputation: 1058

it appears by default but if you do not have it, your theme is probably erasing its definition. create a local.xml in your theme's layout folder and had something like :

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

You can edit the cart.phtml to modify the position in the page. If you do not see :

            <?php echo $this->getChildHtml('coupon') ?>

You can already try to write it before the first step.

Upvotes: 1

Related Questions