[Skip to main content](#vessel-content)

#   Coupon Minimum order value not working

##

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile")
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 4 months ago -  11 years 4 months ago [\#207021](#207021) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#207021 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

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--&gt; 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--&gt; 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--&gt; yes/no?
I hope to have been exhaustive.
Changing "tax category" in coupons I can't obtain it. :S

Last edit: 11 years 4 months ago by [simonev](/forum/user/30589-simonev "View simonev's Profile"). Reason: wrong tax rate 20--&gt;22

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile")
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 4 months ago -  11 years 4 months ago [\#207022](#207022) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#207022 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

sorry I copied previous message and don't know how to remove this

Last edit: 11 years 4 months ago by [simonev](/forum/user/30589-simonev "View simonev's Profile"). Reason: sorry I copied previous message

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile")
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 4 months ago [\#207517](#207517) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#207517 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

Hi,

are there any news about this issue?

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86587
- Thank you received: 14326
-
-

11 years 4 months ago [\#208612](#208612) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#208612 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

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.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile")
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 4 months ago [\#208728](#208728) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#208728 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

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:
Code:

$discount_before_tax = $config-&gt;get('discount_before_tax'); $var = 'price_value_with_tax'; if(!$discount_before_tax){ $var = 'price_value'; }

in this:
Code:

$discount_before_tax = $config-&gt;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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

11 years 4 months ago [\#209112](#209112) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#209112 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

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 Code:

if(!$discount_before_tax) {

Into Code:

if($discount_before_tax) {

Regards,

---

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[simonev](/forum/user/30589-simonev "View simonev's Profile")**
- [![simonev's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30589-simonev "View simonev's Profile")
- [ Offline](/forum/user/30589-simonev)

Less More

- Posts: 59
- Thank you received: 0
-
-

11 years 4 months ago [\#209453](#209453) by [simonev](/forum/user/30589-simonev "View simonev's Profile")  Replied by *[simonev](/forum/user/30589-simonev "View simonev's Profile")* on topic *[Coupon Minimum order value not working](/forum/46-discount-coupon/875841-coupon-minimum-order-value-not-working?start=20#209453 "-- HikaShop version -- : 2.4.0 -- Joomla version -- : 2.5.8  Hi, I'm battling to get this working correctly...  I want to apply my coupon to a specific user group (for newly registered customers) and offer them a one time discount on orders over a certain value. The coupon is being applied but the discount is being applied irrespective of the minimum order value that I've set.  Screenshots attached.")*

Ok thank you.
Let me know if you need that I replicate the issue.

Regards,

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzQ2LWRpc2NvdW50LWNvdXBvbi84NzU4NDEtY291cG9uLW1pbmltdW0tb3JkZXItdmFsdWUtbm90LXdvcmtpbmc/c3RhcnQ9MjAmdG1wbD1tYXJrZG93bg==) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.070 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
