How to check coupen code is applied or not before order place in Magento - magento source24

How to check coupen code is applied or not before order place in Magento

👉 Hello Magento friends today's i'm share with you to How to check coupen code is applied or not before order place in Magento 

create a button.phtml file on given path : 

/app/design/frontend/base/default/template/checkout/onepage/review/button.phtml



<button type=”submit”  id=”checkoutBtn” title=<?php echo $this->__(‘Place Order’) ?>><span><span><?php echo $this->__(‘Place Order’) ?></span></span></button>
            <?php
            $coupon_code = Mage::getSingleton(‘checkout/session’)->getQuote()->getCouponCode();

            if ($coupon_code) {
                $coupon_code = ‘yes';
                        } else {
                        $coupon_code = ‘no';
            }
            ?>

<script type=”text/javascript”>
    jQuery(document).ready(function(){

    jQuery(‘#checkoutBtn’).click(function() {

    var ccode = ‘<?php echo $coupon_code; ?> > ';
            if (ccode == ’yes’)
            {
            review.save();
                    }
    else {
    alert(‘Please Enter coupon code Before Order Place’);
            return false;
            }

    });
            });
</script>

Deepak Kumar Bind

Success is peace of mind, which is a direct result of self-satisfaction in knowing you made the effort to become the best of which you are capable.

Post a Comment

If you liked this post please do not forget to leave a comment. Thanks

Previous Post Next Post