Zen Cart Logo
Forums / Discounts/Coupons, Gift Certificates, Newsletters, Ads / Discount Coupon not excluding Shipping charges

Discount Coupon not excluding Shipping charges

Views: 3,419

Results 1 to 20 of 25
23 Aug 2013, 4:39 PM
#1
time111 avatar

time111

New Zenner

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

Discount Coupon not excluding Shipping charges

Hi!

My problem is that the discount coupon is not excluding Shipping charges on checkout even though as per settings it "false".

Following are its settings:
Admin > Modules > Order Total > Discount Coupon

Discount Coupon

This module is installed
true

Sort Order
280

Include Shipping
false

Include Tax
false

Re-calculate Tax
Standard

Tax Class
--none--

Tried uninstall and re install also, enable/disable too.

~Time

24 Oct 2014, 6:31 PM
#2
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

I'm having this exact issue and haven't found the solution so far... anyone?

24 Oct 2014, 10:09 PM
#3
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

What are your settings on the Discount Coupon itself?

24 Oct 2014, 10:13 PM
#4
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Coupon Name :: ANGELMORETESTS
Coupon Amount :: $40.00
Start Date :: 10/24/2014
End Date :: 10/24/2015
Uses per Coupon :: Unlimited
Uses per Customer :: Unlimited
Valid Product List :: --none--
Valid Categories List :: --none--
Date Created :: 10/24/2014

Free shipping box :: unchecked

24 Oct 2014, 10:34 PM
#5
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

Could you post the Order Totals that you are seeing with the Discount Coupon set?

25 Oct 2014, 1:35 PM
#6
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Absolutely :

Sub-Total: $29.00
Zone Rates (Shipping to US): $3.95
Discount Coupon: -$40.00
Total: $0.00

25 Oct 2014, 2:05 PM
#7
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

And what were you expecting to see?

25 Oct 2014, 4:48 PM
#8
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

The total should be $3.95. Shipping shouldn't be covered no matter how much the order is when the setup is Include Shipping: false.

Thanks for your help, Linda!

26 Oct 2014, 8:03 PM
#9
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

This is not a 100% fix to everything in the file:
/includes/modules/order_total/ot_coupon.php

But try changing the code to the code in RED:

            case 'F': // amount Off
[B]//[/B]              $od_amount['total'] = zen_round($coupon->fields['coupon_amount'] * ($orderTotalDetails['orderTotal']>0), $currencyDecimalPlaces);
[B]              $od_amount['total'] = zen_round(($coupon->fields['coupon_amount'] > $orderTotalDetails['orderTotal'] ? $orderTotalDetails['orderTotal'] : $coupon->fields['coupon_amount']) * ($orderTotalDetails['orderTotal']>0), $currencyDecimalPlaces);[/B]

and see how that works for you ...

NOTE: this is not a solution for everyone, but a temporary fix for you at this time ...

26 Oct 2014, 8:57 PM
#10
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Linda,
Not quite there... now it doesn't apply the coupon at all unless they spend more than the coupon amount. My test order above wasn't discounted at all.

26 Oct 2014, 9:04 PM
#11
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

Thought I checked that ... let me go back to the drawing board ... :lookaroun

26 Oct 2014, 9:05 PM
#12
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

Are you using the original ot_coupon.php file from Zen Cart v151?

26 Oct 2014, 9:17 PM
#13
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Yep, I ran a comparison to make sure. Thanks for your help! It's much appreciated.

26 Oct 2014, 9:21 PM
#14
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

And you changed to code around line 418 to read:

            case 'F':
[B]//[/B]              $od_amount['total'] = zen_round($coupon->fields['coupon_amount'] * ($orderTotalDetails['orderTotal']>0), $currencyDecimalPlaces);
[B]              $od_amount['total'] = zen_round(($coupon->fields['coupon_amount'] > $orderTotalDetails['orderTotal'] ? $orderTotalDetails['orderTotal'] : $coupon->fields['coupon_amount']) * ($orderTotalDetails['orderTotal']>0), $currencyDecimalPlaces);
[/B]              $od_amount['type'] = $coupon->fields['coupon_type']; // amount off 'F' or amount off and free shipping 'O'
              $ratio = $od_amount['total']/$orderTotalDetails['orderTotal'];
              break;
26 Oct 2014, 10:02 PM
#15
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Yes, copied your code exactly.

26 Oct 2014, 10:34 PM
#16
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

Could you go to phpMyAdmin and browse the table:
coupons

and find this coupon and see what the contents of the field:
coupon_type

is set to ... is that an F?

26 Oct 2014, 10:53 PM
#17
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

Yep, F.

26 Oct 2014, 11:02 PM
#18
ajeh avatar

ajeh

Oba-san

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

Re: Discount Coupon not excluding Shipping charges

Could you show what you are seeing in the totals when you use this new code?

It isn't making a lot of sense as this is working without issue for me ...

I am assuming you have the same settings on the Discount Coupon ot_coupon in the Modules ... Order Totals ... and that the Discount Coupon is still set to 40.00 with no restrictions ...

26 Oct 2014, 11:05 PM
#19
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

OK, this code actually doesn't apply the coupon at all, regardless of the total amount. I thought I'd try it again just in case I somehow messed it up.

26 Oct 2014, 11:06 PM
#20
angeltown avatar

angeltown

New Zenner

Join Date:
May 2011
Location:
Garland, Texas, United States
Posts:
27
Plugin Contributions:
0

Re: Discount Coupon not excluding Shipping charges

1 x ... $29.00
1 x ... $20.00
Sub-Total: $49.00
Zone Rates (Shipping to US): $3.95
Total: $52.95