After upgrading via the command-line/pear to 1.4, I’m getting “coupon code is not valid” when I try to use a coupon code. This is on coupon codes we had before the upgrade, as well as coupon codes we’ve created after the upgrade.
I’ve made sure the coupons are set to apply to all products, all websites and all customers and still nothing. This is on all coupon codes - percentage off, free shipping, etc.
I saw some people had trouble because a coupon code field wasn’t added to the sales order table, but I’ve checked and that field exists in our database.
This occurs both on the front-end of the site and on the admin side of the site.
I can confirm the issue and have to look into it. This is really serious. I have a client running various ad campaigns on busy sites so he gets an email from EVERY customer because it won’t work. Not exactly a good way to launch an updated site for a client. So not only does it not work, he has to pay for it and spend all day fielding emails.
I will chime back in after I have a few hours to tear through some stuff.
Ok, I think I need to track down my actual programmer but I think I have widdled this down to
a:5:{i:0;s:282:"SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘) AND `s`.`store_id`=’2’) ON DUPLICATE KEY UPDATE `relevance`=VALUES(`relevance`’ at line 1";i:1;s:2298:"#0 /home/scotto83/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/scotto83/public_html/lib/Zend/Db/Adapter/Abstract.php(468): Zend_Db_Statement->execute(Array)
#2 /home/scotto83/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query(’INSERT INTO `ca...’, Array)
I got this error log right after it broke. It seems to work once and then break.
Same here. It was working from fresh install. We did some test orders with coupon codes, then removed the orders to start clean. Testing one last time before launch and “Coupon code ‘xxxxx’ is not valid”. Doesn’t work with simple rules like cart amount or product selection nor does it work with no rules/coupon (as a general for-all rule).
The odd thing is, the first rule we tested was a Buy X Get Y Free with a coupon code and specific product ID. As complicated as that was, it worked perfectly. Now, nothing. Neither simple nor complicated - no promotions in either Catalog or Cart work.
:( Lost such a great buzz. Magento until now has been pretty amazing.
Anybody with thoughts on 1) how the delete may have corrupted something, 2) how to clean (reset) the DB or 3) how to enable coupon codes? I also tried looking for Admin Settings somewhere thinking maybe in my giddy joy I ticked something like ‘Enable Promotions’ off accidentally.
It may depend on what else you may or may not have running but my programmer told me it had the same ID as a mod and something else so it was likely buggering up the java listeners.
Rather than have him spend all day debugging magento, what we did was remove the coupon code from the cart and put it only on the checkout page. This seems to work fine.
works like a champ with this as well http://www.onestepcheckout.com/ tad pricey but really cool stuff.
This is caused by having the admin panel in a language other than US English. When saving the rules make sure the admin panel language is US English!
In 1.3.x, if admin panel was not in US english, it wouldn’t let you save the rules; it was a bug. In the process of trying to solve this bug, the 1.4.x versions of Magento allow you to save the rule, but they mess up the product conditions, namely the part were it says “Apply if all conditions are ...”. As such, use US english in admin panel until Magento developers fix this bug.
This is caused by having the admin panel in a language other than US English. When saving the rules make sure the admin panel language is US English!
In 1.3.x, if admin panel was not in US english, it wouldn’t let you save the rules; it was a bug. In the process of trying to solve this bug, the 1.4.x versions of Magento allow you to save the rule, but they mess up the product conditions, namely the part were it says “Apply if all conditions are ...”. As such, use US english in admin panel until Magento developers fix this bug.
Hope this helps!
Our admin panel is, and always has been, in US English, so this isn’t the fix for us. :(
I’ve traced the problem down to the protected function _validateCouponCode() within app/code/core/Mage/Sales/Model/Quote.php - the coupon code is being set to ‘’ which I think may be the behavior when coupon code validation fails.
Specifically, this is returning false when it shouldn’t be:
$address->hasCouponCode())
The address is loaded from $this->getAllAddresses();
Which in turn gets the addresses via:
if (is_null($this->_addresses)) {
$this->_addresses = Mage::getModel(’sales/quote_address’)->getCollection()
->setQuoteFilter($this->getId());
Odd thing is, even when on the cart page, with only a zip code entered for the shipping estimator, it says there’s 2 addresses returned by this. And apparently these addresses (?!?) aren’t allowed to use any coupons.
Hopefully that will give someone a clue to help isolate this issue? Any suggestions?
I am getting Coupon Code XXX invalid - and I should not. I read the details above. I have slightly theme modified V1.4.1.0 install and am running a LKC Software Per SKU/Product shipping cost add-on.
Where in the Admin do you set the Admin to use English? Maybe I am just spoiled ( in general with software), because damn near everything is in English....I know the the Admin moderately and I don’t see where to change this setting.
I have tried changing the language in the administration into English/US and it works like a charm. This might not be the best solution but hey it works. I have also tested with English/UK and it doesn’t work.
You have to use US English in the admin panel when editing coupons. This is also necessary when editing catalog rules!
You can change the panel language by selecting the desired language (US English in this case) in the lower left corner of the admin page.
This is a general cause of the problem, and you will not manage to create coupons/rules while working in a language other than US English. Of course there may be other issues in particular cases, but before trying to solve them, make sure you have selected US English.
Turns out, this was an extension. We went through and tested the extensions one at a time, and there was an old Google Maps extension that was supposed to map the location of all your sales/customers (which we never were able to get to work, even before the upgrade, and had forgotten about) - everyone had forgotten about this extension, but apparently it’s not only not compatible with 1.4, it’ll completely break discounts in 1.4! Disabling and removing it resolved this issue for us.
I don’t understand the _validateCouponCode() function and how the coupon codes should get to the adresses.
Where gets a coupon code applied to an address?
Problem exitst only with registered users. No problems with guests or new user register with the first order.