- Posts: 59
- Thank you received: 0
Coupon Minimum order value not working
11 years 3 months ago - 11 years 2 months ago #207021
by simonev
Replied by simonev on topic Coupon Minimum order value not working
Hi,
I tried changing tax category (None, 10%, 22%) in coupon setting but as is written in documentation it adds only the tax amount to flat or percentage value. Was this parameter you said to change?
I'm going to explain with numbers:
Case A:
Settings: "Apply discounts before taxes" and "Detailed tax display--> no"
(with this setting coupon value is compared with subtotal with taxes so is perfect)
Cart:
Subtotal 105,00 € (88,72 € excl taxes)
Discount -9,00 €
Shipping 9,00 €
Tax 16,28 €
Total 105,00 €
Note: Tax sum is correct.
Case B:
Settings: "Apply discounts before taxes" and "Detailed tax display--> yes"
(with this setting coupon value is compared with subtotal with taxes so is perfect)
Cart:
Subtotal 105,00 € (88,72 € excl taxes)
Discount -9,00 €
Shipping 9,00 €
tax 10% 1,85 €
tax 22% 11,55 €
Total 105,00 €
Note: Taxes are not corrects and sum is different from case A
I would use the case B with correct tax amount in details because values should be:
tax 10%= 2,727272727 €
tax 22%= 13,52459016 €
So how can I get the same sum values of taxes switching from Detailed tax display--> yes/no?
I hope to have been exhaustive.
Changing "tax category" in coupons I can't obtain it. :S
I tried changing tax category (None, 10%, 22%) in coupon setting but as is written in documentation it adds only the tax amount to flat or percentage value. Was this parameter you said to change?
I'm going to explain with numbers:
Case A:
Settings: "Apply discounts before taxes" and "Detailed tax display--> no"
(with this setting coupon value is compared with subtotal with taxes so is perfect)
Cart:
Subtotal 105,00 € (88,72 € excl taxes)
Discount -9,00 €
Shipping 9,00 €
Tax 16,28 €
Total 105,00 €
Note: Tax sum is correct.
Case B:
Settings: "Apply discounts before taxes" and "Detailed tax display--> yes"
(with this setting coupon value is compared with subtotal with taxes so is perfect)
Cart:
Subtotal 105,00 € (88,72 € excl taxes)
Discount -9,00 €
Shipping 9,00 €
tax 10% 1,85 €
tax 22% 11,55 €
Total 105,00 €
Note: Taxes are not corrects and sum is different from case A
I would use the case B with correct tax amount in details because values should be:
tax 10%= 2,727272727 €
tax 22%= 13,52459016 €
So how can I get the same sum values of taxes switching from Detailed tax display--> yes/no?
I hope to have been exhaustive.
Changing "tax category" in coupons I can't obtain it. :S
Last edit: 11 years 2 months ago by simonev. Reason: wrong tax rate 20-->22
Please Log in or Create an account to join the conversation.
11 years 3 months ago - 11 years 3 months ago #207022
by simonev
Replied by simonev on topic Coupon Minimum order value not working
sorry I copied previous message and don't know how to remove this
Last edit: 11 years 3 months ago by simonev. Reason: sorry I copied previous message
Please Log in or Create an account to join the conversation.
11 years 2 months ago #207517
by simonev
Replied by simonev on topic Coupon Minimum order value not working
Hi,
are there any news about this issue?
are there any news about this issue?
Please Log in or Create an account to join the conversation.
11 years 2 months ago #208612
by nicolas
Replied by nicolas on topic Coupon Minimum order value not working
Hi,
Sorry for the delay.
I must say that I didn't had the courage to answer because to provide a proper answer, I need to spend two hours to calculate manually all the prices to get the same result as you and see if there is a problem with the settings, change them, redo the calculations, etc. And then maybe spend again 2 hours debugging the calculations code if there is indeed a difference between the calculations and what it should be (which I doubt).
I tried to look at the issue today but I'm not able to access your backend anymore. When I do, I'm getting redirected to the frontend of the website, probably because of some kind of security component.
Could you do something about that ?
But again, normally, it's just a matter of changing both the "tax category" of the coupon and the "apply discount" setting of the HikaShop configuration in order to get the result you want.
Sorry for the delay.
I must say that I didn't had the courage to answer because to provide a proper answer, I need to spend two hours to calculate manually all the prices to get the same result as you and see if there is a problem with the settings, change them, redo the calculations, etc. And then maybe spend again 2 hours debugging the calculations code if there is indeed a difference between the calculations and what it should be (which I doubt).
I tried to look at the issue today but I'm not able to access your backend anymore. When I do, I'm getting redirected to the frontend of the website, probably because of some kind of security component.
Could you do something about that ?
But again, normally, it's just a matter of changing both the "tax category" of the coupon and the "apply discount" setting of the HikaShop configuration in order to get the result you want.
Please Log in or Create an account to join the conversation.
11 years 2 months ago #208728
by simonev
Replied by simonev on topic Coupon Minimum order value not working
Hi,
I solved it by changing your code in discount.php. In this strange issue I noticed that I needed something of configuration "Apply discounts before taxes" and something of "Apply discounts after taxes" so I edited your code. I swear that by changing "apply discount" in coupon setting I didn't get my result and I suppose it wasn't correct to use this feature because I needed a discount not based on tax category.
Site now is accessible by .com url, this is the reason why you can't access. Cause of changes of code in discount.php, now some global settings don't work as original version. We're also "Online" with site right now so I have to ask for give you back access to the "team"... I think is not the best way to help you.
If is ok for you I would like to replicate my issue in a new clean installation and give you the access to check everything you need.
What you think about it? I could do it in the next two weeks.
For information I obtained right result by changing this piece of code in discount.php:
in this:
And setting "Apply discounts after taxes" and coupon tax category to none.
Again, thanks for your support!
Regards,
I solved it by changing your code in discount.php. In this strange issue I noticed that I needed something of configuration "Apply discounts before taxes" and something of "Apply discounts after taxes" so I edited your code. I swear that by changing "apply discount" in coupon setting I didn't get my result and I suppose it wasn't correct to use this feature because I needed a discount not based on tax category.
Site now is accessible by .com url, this is the reason why you can't access. Cause of changes of code in discount.php, now some global settings don't work as original version. We're also "Online" with site right now so I have to ask for give you back access to the "team"... I think is not the best way to help you.
If is ok for you I would like to replicate my issue in a new clean installation and give you the access to check everything you need.
What you think about it? I could do it in the next two weeks.
For information I obtained right result by changing this piece of code in discount.php:
Code:
$discount_before_tax = $config->get('discount_before_tax');
$var = 'price_value_with_tax';
if(!$discount_before_tax){
$var = 'price_value';
}
in this:
Code:
$discount_before_tax = $config->get('discount_before_tax');
$var = 'price_value_with_tax';
if(!$discount_before_tax){
$var = 'price_value_with_tax';
}
And setting "Apply discounts after taxes" and coupon tax category to none.
Again, thanks for your support!
Regards,
Please Log in or Create an account to join the conversation.
11 years 2 months ago #209112
by Jerome
Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.
Replied by Jerome on topic Coupon Minimum order value not working
Hi,
Thanks for the report.
I'm currently performing some tests to reproduce and validate the issue.
Regarding your patch, I think it will be easier to replace
Into
Regards,
Thanks for the report.
I'm currently performing some tests to reproduce and validate the issue.
Regarding your patch, I think it will be easier to replace
Code:
if(!$discount_before_tax) {
Code:
if($discount_before_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 2 months ago #209453
by simonev
Replied by simonev on topic Coupon Minimum order value not working
Ok thank you.
Let me know if you need that I replicate the issue.
Regards,
Let me know if you need that I replicate the issue.
Regards,
Please Log in or Create an account to join the conversation.
Time to create page: 0.212 seconds