Does anyone know how to make the 'Promo Code' box at checkout a required field?
change onclick attribute value of the process to checkout buttons(more than one) to
discountForm.submit(false)
We tried suggestion, but it did not make the coupon code a required field. What are the file names that need to be changed?
checkout/onepage/link.phtml
can I have your website url? your template may work difeferently
and also when frontend works, you have to rewrite cart controller couponPost action method to redirect to onepage checkout
Hi @steve2bright,
To make this feature, you can do by steps below:
On checkout cart page, you add class "required-entry" via input text coupon code. After that change attribute onclick in the button Proceed to Checkout by 1 function javascript as below:
function processToCheckout(){ var validForm = new varienForm('discount-coupon-form'); if (validForm .validate()) { window.location='http://www.unicaddy.com/checkout/onepage/'; }
}
After that, if you want to check require coupon on checkout onepage you can catch event: "controller_action_predispatch_checkout_onepage_index" with function as bellow:
function initCheckoutController($observer){ if(!Mage::getSingleton('checkout/cart')->getQuote()->getCouponCode()){ $observer->getControllerAction()->_redirect('checkout/cart'); } }
Hope it's helpful for you.
MageWoo