Forums / Bug Reports / [Done v139] Discount coupon zone restrictions (1.3.6)

[Done v139] Discount coupon zone restrictions (1.3.6)

Locked

Started by bjornarl on 6 Nov 2006, 3:07 AM · Views: 6,884

Results 1 to 18 of 18
This thread is locked. New replies are disabled.
6 Nov 2006, 3:07 AM
#1
bjornarl avatar

bjornarl

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

[Done v139] Discount coupon zone restrictions (1.3.6)

Zen Cart 1.3.6 announces "Discount coupons can now be restricted to only be usable if the customer's Billing Address matches the selected zone (ie: a 10%-off coupon could be set to apply only to US customers) ".

I haven't gotten this to work correctly nor can I find any further documentation. When I attempt to use the coupon code for a test order with a billing address outside the valid zone, it incorrectly lets me use the coupon and get to step 3 of 3 in the checkout process. However if I then click "checkout" to start the checkout process again (so that the coupon code is remembered, I suppose), I see the error message when step 2 loads: "The coupon code you entered is not valid for the address you have selected"... but it still lets me go to step 3 if I type in the code again. Is this a bug or do I have something set up wrong?

I am trying to create free shipping over $59 for a certain category of products. I create a "United States" zone in the Zone Definitions admin associated with "United States" for country and "All Zones" for zone. (Though ideally I'd love to be able to choose the lower 48 states without adding 48 of them by hand...)

Any ideas?

Bjornar

6 Nov 2006, 2:05 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

You should get a warning on checkout_payment saying that the coupon is not acceptable ...

However, when the payment is selected it does pass you on to the checkout_payment and although the discount coupon was not accepted it says it was ...

Moving this to Bug Reports ... thanks for the update

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Oct 2007, 2:11 AM
#3
bjornarl avatar

bjornarl

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

This is still a problem in Zen Cart 1.3.7.1, and it is more than just a messaging issue -- the coupon is accepted and it lets the customer complete the order as long as they don't back up a step or reload the final page... and the completed order does have the free shipping discount incorrectly applied).

Has anyone developed a patch/fix for this issue?

26 Apr 2008, 2:22 PM
#4
bjornarl avatar

bjornarl

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

This is still a problem in 1.3.7 and we regularly have orders with the free shipping coupon code applied in zones it is not supposed to be allowed for according to the rules... so this is a costly bug.

I'm surprised no one else has mentioned this problem or posted a fix. Am I the only one experiencing it? It is getting painful enough that I will probably try to figure out how to fix it myself soon if no one already has a fix...

26 Oct 2008, 12:03 PM
#5
ingham_qld avatar

ingham_qld

New Zenner

Join Date:
Mar 2008
Posts:
29
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

I'm using 1.3.8a and have the same problem. I have supposedly restricted overseas zones for free shipping with a discount coupon, yet an overseas customer just used the discount coupon and got free shipping.

You're right, this is a costly bug!!

Any fixes yet?:frusty:

26 Oct 2008, 3:26 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

How is your Zone defined?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Oct 2008, 8:58 PM
#7
ingham_qld avatar

ingham_qld

New Zenner

Join Date:
Mar 2008
Posts:
29
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

I think I may have discovered the problem--it possibly relates to the zone codes.

Our webstore is setup to offer free shipping to Australian customers only. An overseas customer from Washington, USA, used our free shipping code and was successful, even though the discount coupon had been restricted to Australia only.

Australia has a state called Western Australia (WA) which is an identical zone code with Washington (WA), USA. It appears that the zone code has been overriding the zone country id. I have tried other USA states and the discount coupon did not work successfully (as we would expect). So, it appears the identical codes are causing the problem.

Do you have a fix for this?

24 Nov 2008, 9:13 PM
#8
gmail avatar

gmail

New Zenner

Join Date:
Sep 2008
Posts:
13
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

I have been looking at coupons this week and came across the same problem. I am using version 1.3.8a.

I have just found a bug in /modules/order_total/ot_coupon.php

The zone restriction check is missing when a coupon is first added. It is only checked subsequently to capture changes in the billing address.

The fix involves a change to one function: collect_posts().
The zone restriction check needs to be copied from the first half of the function to the latter half.

I have attached an updated version of ot_coupon.php.

Habib

24 Nov 2008, 9:48 PM
#9
bjornarl avatar

bjornarl

New Zenner

Join Date:
May 2006
Posts:
13
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Thank you very much for posting this, gmail!

Based on my testing so far, it seems to work as expected on our site.

24 Nov 2008, 10:00 PM
#10
ingham_qld avatar

ingham_qld

New Zenner

Join Date:
Mar 2008
Posts:
29
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Thanks, Habib!

There is still one issue that may need to be resolved. It is still possible for a customer to use a discount coupon in a restricted zone IF their billing address is located in an unrestricted zone. For example, one of our Australian customers (entitled to a free postage discount coupon) could use their coupon to mail an order to a friend in the USA for no cost (since the billing address overrides the mailing address).

Is their a solution for this?

25 Nov 2008, 12:38 AM
#11
gmail avatar

gmail

New Zenner

Join Date:
Sep 2008
Posts:
13
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Yes, it looks like it is designed to work off the billing address only.
I think your suggestion is a good extension particularly if you are offering "free delivery" coupons.

I've done a quick fix - see attached. With a bit more time, a more elegant/efficient solution should be possible but it should do the trick.

Now, both addresses must be in the zone specified in the coupon, otherwise it will fail. Will also check again if addresses are changed after the coupon has been applied.

I'm new to zen and only looked at the coupon stuff yesterday so please test thoroughly before using it on your live site.

Habib

25 Nov 2008, 7:31 AM
#12
ingham_qld avatar

ingham_qld

New Zenner

Join Date:
Mar 2008
Posts:
29
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Nice work, Habib!

So far my tests have worked great.

26 Nov 2008, 8:12 PM
#13
imfsub12 avatar

imfsub12

Zen Follower

Join Date:
Aug 2008
Location:
Halifax, NS
Posts:
274
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Hea guys i just added your file that you posted.. as i'm having the same problem..

is that I want to have a coupon for $100 off but i don't want say a certain provence to have this discount..

So when i make up my coupon i turn on the Coupon Zone Restriction: set to the Canada - MB... this is the same tax code that i use for the province..

Now it allows me to use the coupon..

OR does the program.. JUST ALLOW canada-mb to get the $100 off. ????

Not working.. i'm lost.. thanks

3 Sep 2009, 7:55 PM
#14
pinkchalkstudio avatar

pinkchalkstudio

New Zenner

Join Date:
Apr 2008
Posts:
78
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Just wanted to confirm this fixed the problem for me as well on 1.3.8a and say THANK YOU to gmail. I was convinced I had something set up wrong in my zone definition when it wasn't preventing countries outside the zone from using the coupon. Now my Labor Day sale can go forward :)

www.pinkchalkfabrics.com - cloth, pattern + tool for modern sewists
ZC version 1.3.9h, Simple Category Tree, Super Orders

20 Jul 2010, 2:33 PM
#15
rejinlee avatar

rejinlee

New Zenner

Join Date:
May 2009
Location:
NYC
Posts:
9
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

I would like to offer "free shipping coupon" to orders shipped to US address (Coupon Zone restriction set to US), regardless of the billing address... Help? Thank you.

24 Jul 2010, 3:46 PM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

In v1.3.9, this was changed to use the Discount Coupon with Zone Restrictions for the Free Shipping to use the Shipping Address ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

26 Jul 2010, 1:49 PM
#17
rejinlee avatar

rejinlee

New Zenner

Join Date:
May 2009
Location:
NYC
Posts:
9
Plugin Contributions:
0

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

Thanks Linda!
I must have checked the wrong zone on restrictions.
I have removed the patch and reinstalled the 1.3.9 ot_coupon.php (includes/modules/order_total) and it's working.

26 Jul 2010, 2:18 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: [Done v139] Discount coupon zone restrictions (1.3.6)

You are most welcome ... thanks for the update and for posting what you had to do to get things back on track ... :smile:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!