Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email

Magento Forum

make the coupon code mandatory in cart
Total Posts:  56
Joined:  2009-02-04

does anyone know a way to disable the checkout button and top link until the customer has applied a coupon code?
it could be actually disabling the button itself, or it could be simply redirecting back to the cart. but i don’t want the customer to be able to proceed to checkout until they have selected a coupon.

I need to do this because i’m using coupon codes to create the price for all items in the cart at the same level depending on which coupon code is selected. (I’ve tweaked the coupon.phtml to input as a drop-down list instead of text entry) now everything is working except it is possible for the customer to proceed to the checkout without selecting a coupon, and thus without selecting a price level.

there must be a rather simple ?php if statement that i can use to either turn the button on and of or link back to the cart, but i’m lost as to where to put it or what to do.

it seems that it might have something to do with this line from coupon.phtml:  <?php if(!strlen($this->getCouponCode())): ?>
or it might be part of the javascript at the end of the phtml
but i just don’t know and i’ve tried all of the trial and error that i can handle.

if any of you coding veterans have a solution for me, or even just a pointer, I would be grateful.


to clarify, i simply want to say:

if coupon code = “no entry”, then disable checkout

but i don’t know how or where to write it.

Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top