Skip to main content

Wrong total amount using coupon

11 years 10 months ago #186751 by Arno
-- HikaShop version -- : 2.3.5

Hi,

I have something strange in the checkout when using a coupon of 10% discount. I have changed several settings and checked the forum, but I do not know how this can happen. Checked with several articles, but everytime the same problem: the total is not correct.

Only in case the setting is "discount after tax" the total is correct. But in that case the coupon discount is with tax and that is not correct according the tax law.

Hikashop version Starter 2.3.5.

Any idea ?

Regards,
Arno

Please Log in or Create an account to join the conversation.

11 years 10 months ago #186832 by Jerome
Hi,

In the configuration of your coupon, you specify that the coupon has to use a product tax category (Geen).
Can you please remove that association with a tax ?

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #186856 by Arno
Hi Jerome,

Thanks for your reply. I changed the setting of product tax category.

If setting is ...
geen (=none) --> the total is € 74,82
0% --> the total is € 74,82
6% --> the total is € 74,41
21% --> the total is € 73,41

In all cases the coupon value (€ 6,73) and VAT-6% (€ 2,89) and VAT-21% (€ 4,03) do not change (that is correct; those values are correct). Only the total changes but not to the correct value (should be € 74,21).

Regards,
Arno

Please Log in or Create an account to join the conversation.

11 years 10 months ago #186937 by Jerome
Hi,

Can you please check with the patch in this thread ?
www.hikashop.com/forum/taxes/873969-erro...discount.html#186925

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187221 by Arno
Hello Jerome,

I updated administrator/components/com_hikashop/classes/currency.php with the patch "function getUntaxedPrice" and "function Addcoupon" as mentioned in www.hikashop.com/forum/taxes/873969-erro...discount.html#186925 but it does not effect the total value of the order. Still wrong total.

Regards,
Arno

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187222 by Jerome
Okay.

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187643 by Arno
Hello Jerome,

I did some tests and it seems that the wrong total is caused by the VAT over the value of the coupon discount.

See enclosed.

Any idea how to solve ??

Regards,
Arno

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187644 by Arno
Here is the attachment ....

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187744 by nicolas
Hi,

I think that you should set the "apply discount" option to "after taxes" so that the calculations works like you want.
And if you want to display the coupon value without taxes, it's easy to do.
Just edit the file "cart" of the view "checkout" via the menu Display>Views and change the line:
echo $this->currencyHelper->format(@$this->coupon->discount_value*-1,@$this->coupon->discount_currency_id);
to:
echo $this->currencyHelper->format(@$this->coupon->discount_value_without_tax*-1,@$this->coupon->discount_currency_id);

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187875 by Arno
Hi guys,

This is probably the best solution. I set the "apply discount" option to "after taxes" and I edited the file "cart" of the view "checkout".

The total is correct, but the coupon is still WITH tax (.. and I have updated the correct template).

Any idea why tax is still included in my coupon value ??

Regards,
Arno

Please Log in or Create an account to join the conversation.

11 years 10 months ago #187876 by Arno
.. and the other attachment

Please Log in or Create an account to join the conversation.

11 years 10 months ago #188227 by Jerome
Hi,

Can you please put a
Code:
var_dump($this->coupon);
just after the "echo" line so we will have more details about the coupon content (and the different values of the prices)

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

11 years 10 months ago - 11 years 9 months ago #188269 by Arno
Hi,

See enclosed file with the data.

Kind regards,
Arno
Code:
object(stdClass)#621 (30) { ["discount_id"]=> string(1) "3" ["discount_type"]=> string(6) "coupon" ["discount_start"]=> string(10) "1421193600" ["discount_end"]=> string(10) "1422748740" ["discount_flat_amount"]=> string(7) "0.00000" ["discount_percent_amount"]=> string(5) "10.00" ["discount_minimum_order"]=> string(7) "0.00000" ["discount_quota"]=> string(1) "0" ["discount_used_times"]=> string(1) "0" ["discount_code"]=> string(13) "NieuweWebShop" ["discount_published"]=> string(1) "1" ["discount_product_id"]=> string(1) "0" ["discount_category_id"]=> string(1) "0" ["discount_zone_id"]=> string(1) "0" ["discount_currency_id"]=> string(1) "1" ["discount_category_childs"]=> string(1) "0" ["discount_auto_load"]=> string(1) "0" ["discount_access"]=> string(3) "all" ["discount_tax_id"]=> string(1) "0" ["discount_minimum_products"]=> string(1) "0" ["discount_quota_per_user"]=> string(1) "0" ["discount_coupon_nodoubling"]=> NULL ["discount_coupon_product_only"]=> NULL ["discount_affiliate"]=> string(1) "0" ["total"]=> object(stdClass)#624 (1) { ["prices"]=> array(1) { [0]=> object(stdClass)#625 (7) { ["price_value"]=> float(59.93223) ["price_value_with_tax"]=> float(66.03993) ["price_currency_id"]=> int(1) ["taxes"]=> array(2) { ["BTW-6%"]=> object(stdClass)#616 (3) { ["tax_namekey"]=> string(6) "BTW-6%" ["tax_rate"]=> string(7) "0.06000" ["tax_amount"]=> float(2.88684) } ["BTW-21%"]=> object(stdClass)#614 (3) { ["tax_namekey"]=> string(7) "BTW-21%" ["tax_rate"]=> string(7) "0.21000" ["tax_amount"]=> float(4.02759) } } ["taxes_without_discount"]=> array(2) { ["BTW-6%"]=> object(stdClass)#626 (3) { ["tax_namekey"]=> string(6) "BTW-6%" ["tax_rate"]=> string(7) "0.06000" ["tax_amount"]=> float(3.2076) } ["BTW-21%"]=> object(stdClass)#627 (3) { ["tax_namekey"]=> string(7) "BTW-21%" ["tax_rate"]=> string(7) "0.21000" ["tax_amount"]=> float(2.9001) } } ["price_value_without_discount_with_tax"]=> float(73.3777) ["price_value_without_discount"]=> float(67.27) } } } ["discount_percent_amount_calculated"]=> float(7.33777) ["discount_percent_amount_calculated_without_tax"]=> float(7.33777) ["discount_value_without_tax"]=> float(7.33777) ["taxes"]=> array(2) { ["BTW-6%"]=> object(stdClass)#628 (3) { ["tax_namekey"]=> string(6) "BTW-6%" ["tax_rate"]=> string(7) "0.06000" ["tax_amount"]=> float(0.32076) } ["BTW-21%"]=> object(stdClass)#629 (3) { ["tax_namekey"]=> string(7) "BTW-21%" ["tax_rate"]=> string(7) "0.21000" ["tax_amount"]=> float(0.29001) } } ["discount_value"]=> float(7.33777) }
Last edit: 11 years 9 months ago by Jerome.

Please Log in or Create an account to join the conversation.

11 years 9 months ago #191627 by Jerome
Hi,

Sorry for the late reply.

I edited your message in order to be able to see correctly the var_dump.
We can see in the dump that the value of the "discount_value_without tax" is the same than the "discount_value".

So I think that the fixes for the "addCoupon" function might also fix your issue.
The best will be for the moment to test with the version provided by Nicolas:
www.hikashop.com/forum/taxes/873969-erro...html?start=20#187246

Regards,

Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Please Log in or Create an account to join the conversation.

Time to create page: 0.086 seconds
Powered by Kunena Forum