Zen Cart Logo
Forums / General Questions / Coupon error at checkout

Coupon error at checkout

Views: 1,019

Results 1 to 14 of 14
12 Feb 2013, 10:41 PM
#1
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Coupon error at checkout

I have a coupon set up to discount a certain amount on a certain product. Under the restrictions I have denied Top and allowed the product. For some reason at checkout I get the following error message "You must spend at least $14.97 to redeem this coupon". My cart total is $23.96 and I have included the product that is to be discounted. What am I doing wrong? :huh:

Thanks,

JNB41578

12 Feb 2013, 11:18 PM
#2
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

My coupon is setup the following way:

Discount: 5.99
Minimum: 14.97
Free Shipping: NOT Checked
Dates are correct

RESTRICTIONS:

TOP- Deny
Product: Allowed

Using v1.50

I tried some troubleshooting on my own for awhile. If I remove the denied TOP, deny the category that the product is in, the coupon works. If I go to my cart and remove the product that is allowed, the coupon still deducts the amount.

Any help would be great!

13 Feb 2013, 3:16 AM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Coupon error at checkout

Have you an URL to your site where we could perhaps test this coupon?

What products_id is this Discount Coupon Valid for?

NOTE: Minimum is referring to the value of the Product(s) settings that are valid for the Discount ...

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!

13 Feb 2013, 3:42 AM
#4
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

Site: https://www.svgattic.com

Product id: 255

Thanks for replying!

13 Feb 2013, 3:52 AM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Coupon error at checkout

The Product that you allow is priced at: $5.99

However, you want a Minimum at $14.97 ...

The Minimum is meant to be the minimum of the Price(s) of the Products Allowed, not the Minimum of the Order ...

You would need to customize the code to work with the validation for the Minimum to be the Minimum of the whole Order and not the amount of the Valid Allowed Product(s) ...

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!

13 Feb 2013, 4:17 AM
#6
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

I want to be able to offer the free gift with a minimum purchase of $9.98. This is exactly how I did the coupons in v1.39, I recently upgraded to v1.50. Was there a change? I don't remember seeing documentation on it. Anyhow, I don't understand your response about me having to customize the code. If you could point me in the right direction that would be great because I thought I was customizing it in the restrictions.

Thanks in advance!

13 Feb 2013, 4:21 AM
#7
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

Also, everything I have read up on in this forum tells me that the minimum is the minimum of the total order you want your customer to spend before the discount is allowed to be applied.

13 Feb 2013, 2:38 PM
#8
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

Ajeh:

The Product that you allow is priced at: $5.99

However, you want a Minimum at $14.97 ...

The Minimum is meant to be the minimum of the Price(s) of the Products Allowed, not the Minimum of the Order ...

You would need to customize the code to work with the validation for the Minimum to be the Minimum of the whole Order and not the amount of the Valid Allowed Product(s) ...

Ajeh,
I went in and changed the minimum order amount to the item amount per your suggestion that the coupon would then work. Unfortunately, I am still getting the error, except now it says I must spend at least $5.99. Any help would be great.

Thanks again!

13 Feb 2013, 3:03 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Coupon error at checkout

You can try this ...

Update the code in:
/includes/modules/order_total/ot_coupon.php

And add the code in RED to the function get_order_total:

    if (DISPLAY_PRICE_WITH_TAX != 'true')
    {
      $orderTotal -= $order->info['tax'];
    }

[B]// bof: calculate Order Total less shipping and tax
// change what total is used for Discount Coupon Minimum
$orderTotalFull = $order->info['total'];
//echo 'Current $orderTotalFull: ' . $orderTotalFull . ' shipping_cost: ' . $order->info['shipping_cost'] . '<br>';
$orderTotalFull -= $order->info['shipping_cost'];
//echo 'Current $orderTotalFull less shipping: ' . $orderTotalFull . '<br>';
$orderTotalFull -= $orderTotalTax;
//echo 'Current $orderTotalFull less taxes: ' . $orderTotalFull . '<br>';

// add $orderTotalFull to array
[/B]    return array('totalFull'=>[B]$orderTotalFull,[/B]'orderTotal'=>$orderTotal, 'orderTaxGroups'=>$orderTaxGroups, 'orderTax'=>$orderTotalTax, 'shipping'=>$order->info['shipping_cost'], 'shippingTax'=>$order->info['shipping_tax']);
[B]// eof: calculate Order Total less shipping and tax
[/B]  }

Next, change the code by reversing the commented code in the function collect_post from:

// left for total order amount vs qualified order amount just switch the commented lines
[B]//[/B]        if ($order_total['totalFull'] < $coupon_result->fields['coupon_minimum_order']) {
        if (strval($order_total['orderTotal']) < $coupon_result->fields['coupon_minimum_order']) {

to be:

// left for total order amount vs qualified order amount just switch the commented lines
        if ($order_total['totalFull'] < $coupon_result->fields['coupon_minimum_order']) {
[B]//[/B]        if (strval($order_total['orderTotal']) < $coupon_result->fields['coupon_minimum_order']) {

and see if this now works for you based on the Total of the Order (less shipping and tax) vs the Total of the Products allowed ...

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!

13 Feb 2013, 4:10 PM
#10
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

Thank you Ajeh,

Unfortunately that did not work. It says "Congratulations your discount was accepted" or something like that, but it does not discount the coupon at all.

And it slowed down a lot after adding that code in.

13 Feb 2013, 4:26 PM
#11
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

Ok that does work if there are no restrictions applied to the coupon.

I must have restrictions to a certain product, with a certain minimum purchase. I change the product weekly. At least the coupon now works somewhat. Any ideas on how to get it to work with a specific product in their cart and a minimum purchase amount? Or can I only have one or the other?

Thanks again...

13 Feb 2013, 5:16 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Coupon error at checkout

I am afraid I left out some changes ...

Can you try this attached file and see if it works better for you for Zen Cart v1.5 ...

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!

13 Feb 2013, 6:56 PM
#13
jnb41578 avatar

jnb41578

New Zenner

Join Date:
Jul 2011
Posts:
72
Plugin Contributions:
0

Re: Coupon error at checkout

AHA! Thank you so much Ajeh! You rock! Now I need to know what you changed because it worked perfectly, so off to decipher some code I go! LOL

13 Feb 2013, 7:37 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Coupon error at checkout

I tried as much as I could to match that to the v1.5 ot_coupon.php with comment lines to help you follow along ... with luck, I did it clearly ... :cool:

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!