👉 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>