0

I have 1 issue confusing.
-When i am in checkout cart page. I cant click button apply coupon code.
Javascrip seems it does not work ( I try with input empty but no validate or any reaction). But if I am in checkout onepage. I can do it.
I check template path hint and see them using 1 template default/template/checkout/cart/coupon.phtml
Someone can explain it?

Update code coupon.phtml

<form id="discount-coupon-form" action="<?php echo $this->getFormActionUrl() ?>" method="post">
    <div class="discount">
        <div class="discount-form">
            <input type="hidden" name="remove" id="remove-coupone" value="0" />
            <div class="field-wrapper">
                <input class="input-text" type="text" id="coupon_code" name="coupon_code" value="<?php echo $this->escapeHtml($this->getCouponCode()) ?>" />
                <div class="button-wrapper">
                    <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Discount Codes')) ?>" class="button2" onclick="discountForm.submit(false)" value="<?php echo $this->__('Discount Codes') ?>"><span><span><?php echo $this->__('Discount Codes') ?></span></span></button>
                    <?php if(strlen($this->getCouponCode())): ?>
                        <button type="button" title="<?php echo Mage::helper('core')->quoteEscape($this->__('Cancel')) ?>" class="button2 cancel-coupon" onclick="discountForm.submit(true)" value="<?php echo $this->__('Cancel') ?>"><span><span><?php echo $this->__('Cancel') ?></span></span>
                        </button>
                    <?php endif;?>
                </div>
            </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>
  • without checking code,it cannot be possible to decide the issue – Amit Bera Apr 26 '16 at 9:58
0

Replace coupon code button to this.

<button title="Apply Coupon" onclick="discountForm.submit(false)" value="Apply Coupon"><span><span>Apply Coupon</span></span></button>

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.