Discount codes not showing at checkout in OpenCart 1.5
A few weeks ago, we had a client using OpenCart 1.5 as their ecommerce software with a customised ‘default’ theme, who noticed that discount codes were not showing at checkout in OpenCart 1.5. The closest guide we found was on the OpenCart community forums, but wasn’t coherent enough to follow in places, so here is our attempt at clarifying the problem!
1. Ensure you have added coupon codes!
The first obvious check is to ensure you have added voucher (discount) codes to your store through OpenCart’s administration panel, in Sales > Coupons.
2. Ensure Coupons are enabled in OpenCart
Next, we need to check the coupons feature is enabled in OpenCart. In OpenCart 1.5+, this is located in the Extensions > Order Totals menu in the administration panel. Make sure that the Coupons feature is enabled (it should be by default).
3. The fix: change all links to OpenCart checkout to OpenCart cart
This bit is the painful task. If you look at
example.com/index.php?route=checkout/cart, you should see the Coupon Code section within the checkout process, but if you look at
example.com/index.php?route=checkout/checkout, you’ll see it’s not there at all.
Simply, OpenCart links to the checkout page, and not the cart page, which is where it stores the discount code. So, to fix discount coupons not showing at the checkout in OpenCart 1.5, you need to change most links in your OpenCart templates from
index.php?route=checkout/checkout. To do this, look for:
<a href="<?php echo $checkout; ?>" ...
and correct these instances to the below:
<a href="<?php echo $cart; ?>" ...
(an IDE such as Eclipse allows for project-wide find and replace). Done!
Still not clear? We offer OpenCart consultancy if you’re not confident enough to do it yourself!