Re: Tax + discount coupon BUG?
Hi,
I think that unfortunately the changes we made earlier have introduced thay bug.
To fix, you will need to replace the
function pre_confirmation_check in includes/modules/order_total/ot_coupon.php with
PHP Code:
function pre_confirmation_check($order_total) {
global $order;
$od_amount = $this->calculate_deductions($order_total);
if (DISPLAY_PRICE_WITH_TAX == 'true')
{
return $od_amount['total'];
} else {
return $od_amount['total'] + $od_amount['tax'];
}
}
Re: Tax + discount coupon BUG?
Hello wilt
Thank you once again! :clap: That did the trick. Now I only have one more question...
If I use a 100% discount coupon that sets the order total to 0, the payment method remains the same in the last (3rd) step as the selected one in the 2nd step.
If I use a discount coupon (fixed amount in $) that covers the whole order balance or more, the payment method is set to nothing in the 3rd step.
What I would like (and need) for this to work is some kind of "Zero balance payment method". Is there any way of doing this? My PSP don't accept 0 balance calls, and there are other possible issues with this problem too...
The best would be if zencart would skip the "selection of payment method step" (or hide it) if the order balance (after any discounts) equals to 0. Wouldn't it? :yes:
Thanks again
/Erik
Re: Tax + discount coupon BUG?
I have tried using the freecharger and the freshipping modules but they don't seem to help me...
/E
Re: Tax + discount coupon BUG?
to fix the 100% discount coupon problem you need to replace
function pre_confirmation_check in includes/modules/order_total/ot_coupon.php again with
PHP Code:
function pre_confirmation_check($order_total) {
global $order;
$od_amount = $this->calculate_deductions($order_total);
if (DISPLAY_PRICE_WITH_TAX == 'true' && $od_amount['type'] != 'P')
{
return $od_amount['total'];
} else {
return $od_amount['total'] + $od_amount['tax'];
}
}
Re: Tax + discount coupon BUG?
Hi
Now everything seems to work. I will move the bug fixes to my live site tonight and test everthing once again. Thank you for all the help.
Are there any other critical bug fixes I need? I thougt the "check for latest version" in the admin would handle this, but it seems to be used only for major upgrades. As you know I run on 1.3.8a.
/Erik
Re: Tax + discount coupon BUG?
Hi
there is another bug related to shipping tax and coupons but this may not affect you with using DISPLAY_PRICES_WITH_TAX.
I am however currently reworking some of the calculation logic, as currently the way code handles the difference between DISPLAY_PRICE_WITH_TAX = true/false is a little convoluted (as you can probably tell from the problems you encountered)
Hopefully I will have that done in a day or few.
1 Attachment(s)
Re: Tax + discount coupon BUG?
Hello Wilt
I came across another problem related to the ot_coupon module. Sometimes the discount sum is rounded wrong. I use 2 decimals for the currency (SEK). It seems like this bug only occurs when using multiple tax classes on the same order, but I´m not sure about that...
/Erik
Re: Tax + discount coupon BUG?
Quote:
Originally Posted by
wilt
there is another bug related to shipping tax and coupons but this may not affect you with using DISPLAY_PRICES_WITH_TAX.
I am however currently reworking some of the calculation logic, as currently the way code handles the difference between DISPLAY_PRICE_WITH_TAX = true/false is a little convoluted (as you can probably tell from the problems you encountered)
Hopefully I will have that done in a day or few.
Hi Wilt,
Did you get anywhere with this reworking? I'm attempting to solve a discount code and sales tax problem different to the ones fixed in this thread. The problem only occurs when DISPLAY_PRICES_WITH_TAX. I'm finding the code related to DISPLAY_PRICES_WITH_TAX quite confusing.
Cheers
Re: Tax + discount coupon BUG?
Hey there, sorry to dig up an old bug but..
I am running a 1.3.9g shop (upgraded from 1.3.8a) and am seeing a similar problem to this.
It occurs when redeeming a discount coupon with a higher value than the order total.
e.g. fill up the cart with £47 worth of goods, and then redeem a £100 coupon, and instead of a discount value of £47.00 it takes off the shipping tax (£0.74 in my case), so you get:
Sub-Total: £47.00
Delivery Options (Standard Delivery: Free if Order Total above £100, £4.99 if under): £4.99
Discount Coupon: HRLM : -£46.26
VAT: £0.74
Total: £5.73
Is there a quick fix for this? Somewhere around line 403 in ot_coupon.php ?
Thanks!
Re: Tax + discount coupon BUG?
Hi!
I have the same problem as ErikAllan had (i think). The difference is that i am running 1.3.9f and the ot_coupon.php is not the same as it were when you guys fixed it. I tried to implement the changes but nothing seems to happen.
I have the following setup:
Include Shipping
false
Include Tax
false
Re-calculate Tax
Standard
The problem i'm having is: the discount is wrongly calculated when there is VAT on the shipping.
Heres an example of an order with VAT on shipping and an 10% coupon:
Totalt:NOK 125.00
Coupon: -NOK 11.23
Shipping :NOK 63.75
25% VAT: NOK 35.25
Order Total: NOK 177.52
The Coupon SHOULD be -NOK 12,50
Here is the exact same order, but this time I have turned off VAT on shipping. Now everything is as it should be.
Totalt:NOK 125.00
Coupon: :-NOK12.50
Shipping :NOK51.00
25% VAT:NOK22.50
Order Total:NOK163.50
Anyone got an idea of how to fix this?