Page 1 of 1
Coupon Code Issue
Posted: Fri Feb 03, 2012 11:55 am
by mfreeze
One of my clients entered a new coupon code after being upgraded to 7.07 SR1a. Now there is an issue when a non-logged in customer (anonymous user) uses the code. The code is accepted and the discount applied but 2 messages below appear on the screen.
Payment MethodCoupon or Promotional Code
Invalid coupon code.
Coupon accepted.
If the customer is logged in this doesn't happen. If you want to test it, the site is
www.ezsox.com.
Re: Coupon Code Issue
Posted: Mon Feb 06, 2012 10:50 am
by AbleMods
I've seen this before when there are multiple coupons set up with the same coupon code.
Some sites will have a monster number of coupons configured in the admin. AC7 doesn't check for duplicate coupon codes when a coupon is created. So in situations where the coupon list goes into multiple pages, it becomes far easier to create duplicate coupons by mistake.
Probably one version of the coupon is valid for that basket and the other one isn't, thus the confusing error message.
Re: Coupon Code Issue
Posted: Mon Feb 06, 2012 11:54 am
by mfreeze
I checked and she has 3 coupon codes EZ20, EZ40 and EZMB50 (which has expired). So that does not appear to be the issue.
Can comebody from Able look at this issue?
Re: Coupon Code Issue
Posted: Mon Feb 06, 2012 2:05 pm
by Shopping Cart Admin
Re: Coupon Code Issue
Posted: Tue Feb 07, 2012 10:20 am
by mfreeze
We found the problem. One of my programmers had at the customer's request, moved the coupon dialog to just above the payment information.
This caused the double posting of the message. We moved it to another location higher on the page and it solved the problem.
Re: Coupon Code Issue
Posted: Tue Feb 07, 2012 10:44 am
by AbleMods
Interesting, thanks for posting the solution.
The coupon user control is supposed to test for such a scenario. At least that's what I thought when I looked at the code as shown below:
Code: Select all
protected void Page_Init(object sender, EventArgs e)
{
string valueFromPost = Request.Form[ApplyCouponButton.UniqueID];
if (valueFromPost == this.ApplyCouponButton.Text)
{
// APPLY COUPON WAS CLICKED, INTERCEPT BEFORE OTHER PROCESSING
ApplyCoupon();
Context.Items["CouponApplied"] = true;
}
PageHelper.SetDefaultButton(CouponCode, ApplyCouponButton.ClientID);
CouponCode.Attributes.Add("autocomplete", "off");
}
protected void ApplyCouponButton_Click(object sender, EventArgs e)
{
if (!Context.Items.Contains("CouponApplied"))
{
ApplyCoupon();
}
CouponCode.Text = string.Empty;
}
Re: Coupon Code Issue
Posted: Wed Feb 08, 2012 8:42 am
by jmestep
The code Joe mentions was in older versions of Able so maybe it needs to be added to your checkout page.
This is good info- someone had asked me about the issue and I couldn't figure out why it was happening. I've also wondered why the code was added to 707 and now I know!