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 magento.stackexchange.com, 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 community@magento.com.

Magento Forum

Page 1 of 2
Magento 1.4 - Coupon Code is Not Valid
 
Creatuity
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-11-03
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jackstraw
Member
 
Total Posts:  62
Joined:  2008-06-02
Carbondale,Colorado
 

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.

Nigel

 
Magento Community Magento Community
Magento Community
Magento Community
 
jackstraw
Member
 
Total Posts:  62
Joined:  2008-06-02
Carbondale,Colorado
 

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.

Nigel

 
Magento Community Magento Community
Magento Community
Magento Community
 
jackstraw
Member
 
Total Posts:  62
Joined:  2008-06-02
Carbondale,Colorado
 

Ehck, still can’t seem to sort this.  Surely someone else is having issues with coupon codes.

I did note that if I remove the code itself it will apply the discount properly to everything but it won’t work using a coupon code.

I didn’t see a specific bug report or anything in svn about it.

thanks,

Nigel

 
Magento Community Magento Community
Magento Community
Magento Community
 
tbulbs
Jr. Member
 
Avatar
Total Posts:  22
Joined:  2010-06-04
 

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.

Thx
Dave

 
Magento Community Magento Community
Magento Community
Magento Community
 
jackstraw
Member
 
Total Posts:  62
Joined:  2008-06-02
Carbondale,Colorado
 

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.

hope that helps someone.
Nigel

 
Magento Community Magento Community
Magento Community
Magento Community
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

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!

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creatuity
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-11-03
 
faken - 31 July 2010 03:58 AM

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?

 
Magento Community Magento Community
Magento Community
Magento Community
 
SteveMc
Jr. Member
 
Total Posts:  4
Joined:  2008-09-08
 

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.

--SteveMc

 
Magento Community Magento Community
Magento Community
Magento Community
 
alvinzar
Jr. Member
 
Total Posts:  2
Joined:  2009-03-24
 

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.

I hope this may help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
trampi
Jr. Member
 
Total Posts:  13
Joined:  2010-06-22
 

Has anyone found a solution yet?
Changing the language to english does not work for me.

 
Magento Community Magento Community
Magento Community
Magento Community
 
faken
Jr. Member
 
Total Posts:  16
Joined:  2009-11-13
 

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.

Good luck wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
Creatuity
Jr. Member
 
Avatar
Total Posts:  11
Joined:  2008-11-03
 

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.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Windfield
Jr. Member
 
Total Posts:  10
Joined:  2010-03-05
 

Creatuity:
THANK YOU SO MUCH!
My god, What a relieve!

The extension you where talking about is Lento_Googlemaps-0.2

Everyone:
If you are having this issue and you installed this extension, uninstall it through magentoconnect

If after uninstalling it the problems remains, I would recommend that you check the files for this extension are deleted too

this are the files:

LENTO_GOOGLEMAPS-0.2.0
\\
---app
    
+---code
    
|   \\---local
    
|       \\---Mage
    
|           \\---Googlemaps
    
|               +---Block
    
|               |   \\---Adminhtml
    
|               |           Report.php
    
|               |           
    |               +---
controllers
    
|               |   \\---Adminhtml
    
|               |           ReportController.php
    
|               |           
    |               +---
etc
    
|               |       config.xml
    
|               |       system.xml
    
|               |       
    |               +---
Helper
    
|               |       Data.php
    
|               |       
    |               +---
Model
    
|               |       Googlemaps.php
    
|               |       
    |               
\\---sql
    
|                   \\---googlemaps_setup
    
|                           mysql4-install-0.1.0.php
    
|                           
    +---
design
    
|   \\---adminhtml
    
|       \\---default
    |           
\\---default
    |               
\\---template
    
|                   \\---googlemaps
    
|                           index.phtml
    
|                           
    
\\---etc
        \\
---modules
                Mage_Googlemaps
.xml
 
Magento Community Magento Community
Magento Community
Magento Community
 
AvenueVERVE
Jr. Member
 
Avatar
Total Posts:  21
Joined:  2008-04-03
California
 

Rebuild indexes

Go to System > Index Management

and rebuild All indexes

This is especially applicable after upgrading Magento or any extension and you find coupons that were working and should be working are now failing.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dynamiser
Jr. Member
 
Total Posts:  23
Joined:  2008-01-01
 

Any news on this?

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.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2