Cart – How to Fix Missing Coupon Field in Checkout Process

cartcheckoutshopping-cart-price-rules

I have added coupon code for free shipping in the Shopping Cart Price Rules (Magento 1.4.1.1), but I don't see any coupon code field in a cart or checkout process.

I have checked checkout.xml file and proper line exists

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

Edit:

It looks like coupon functionality was removed from coupon.phtml file, which contains now only

<!-- coupon code removed-->

Can someone could to provide proper file for that Magento version?

Thanks

Best Answer

You can download Magento 1.4.1.1 from here then click on Release Archives tab and find the release version that you're looking for and download it, then extract it, then copy coupon.phtml from base theme app/design/frontend/base/default/template/checkout/cart/coupon.phtml to your active theme folder.

Or just copy the following code:

<form id="discount-coupon-form" action="<?php echo $this->getUrl('checkout/cart/couponPost') ?>" method="post">
    <div class="discount">
        <h2><?php echo $this->__('Discount Codes') ?></h2>
        <div class="discount-form">
            <label for="coupon_code"><?php echo $this->__('Enter your coupon code if you have one.') ?></label>
            <input type="hidden" name="remove" id="remove-coupone" value="0" />
            <div class="input-box">
                <input class="input-text" id="coupon_code" name="coupon_code" value="<?php echo $this->htmlEscape($this->getCouponCode()) ?>" />
            </div>
            <div class="buttons-set">
                <button type="button" title="<?php echo $this->__('Apply Coupon') ?>" class="button" onclick="discountForm.submit(false)" value="<?php echo $this->__('Apply Coupon') ?>"><span><span><?php echo $this->__('Apply Coupon') ?></span></span></button>
                <?php if(strlen($this->getCouponCode())): ?>
                    &nbsp; <button type="button" title="<?php echo $this->__('Cancel Coupon') ?>" class="button" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel Coupon') ?>"><span><span><?php echo $this->__('Cancel Coupon') ?></span></span></button>
                <?php endif;?>
            </div>
        </div>
    </div>
</form>
<script type="text/javascript">
//<![CDATA[
var discountForm = new VarienForm('discount-coupon-form');
discountForm.submit = function (isRemove) {
    if (isRemove) {
        $('coupon_code').removeClassName('required-entry');
        $('remove-coupone').value = "1";
    } else {
        $('coupon_code').addClassName('required-entry');
        $('remove-coupone').value = "0";
    }
    return VarienForm.prototype.submit.bind(discountForm)();
}
//]]>
</script>
Related Topic