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

#   Discounts not working correctly

##

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

Less More

- Posts: 11
- Thank you received: 0
-
-

15 years 5 months ago [\#16250](#16250) by [moe3615](/forum/user/1065-moe3615 "View moe3615's Profile")  *[Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16250 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")* was created by *[moe3615](/forum/user/1065-moe3615 "View moe3615's Profile")*

I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount.
When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category.
Here's a detailed example of what going on:
Category A - should be getting discount
Category B - should not be.

If I add the discount before adding products from category B, the entire cart gets discount.

If I apply the discount after items in category B are added, none of the items get a discount and I get an error:
"The coupon you entered cannot be used for the products in your cart"

Any help is greatly appreciated. :dry:

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xNjI1MC1kaXNjb3VudHMtbm90LXdvcmtpbmctY29ycmVjdGx5P3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

15 years 5 months ago [\#16251](#16251) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16251 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

That's normal. A coupon applies to the would order.
The category option is for you to only allow the user to user a coupon if a product of a certain category is in the cart, and not the apply the coupon to only the products in that category.

If you want to do that, you would have to use discounts which are applied directly to the price of each prices and not to the whole order like coupons.

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

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

Less More

- Posts: 2
- Thank you received: 0
-
-

15 years 5 months ago [\#16759](#16759) by [mzelikovich](/forum/user/2589-mzelikovich "View mzelikovich's Profile")  Replied by *[mzelikovich](/forum/user/2589-mzelikovich "View mzelikovich's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16759 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Hello Nicolas,
I think limiting coupons by using categories is not working properly.
I setup the following categories:
Product category:
- cat A (child of product category)
- cat B (child of product category)
- cat C (child of product category)
- sub cat C1 (child of cat C)
- sub cat C2 (child of cat C)

I then created "coupons" (not discounts) to take off a flat amount of X on a minimum order Y. Under "Category", I included "cat C" and set "Include sub categories" to "yes". The result I need is that coupons apply to all products of "cat C" and any of it's sub-categories, but do NOT apply to "cat A" or "cat B".

When I add products from "cat A" or "cat B" to the cart, the coupons do not apply (this is correct).
Then, I ALSO add products from "cat C" and it's sub-categories to the cart, and the coupons suddenly apply to ALL items in the cart (this is NOT correct), the coupons should only apply to "cat C" products and should never apply to "cat A" or "cat B" products.

Please help!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xNjI1MC1kaXNjb3VudHMtbm90LXdvcmtpbmctY29ycmVjdGx5P3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

15 years 5 months ago [\#16767](#16767) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16767 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

That's normal. The coupons in HikaShop apply to the whole order and not to individual products like discounts do. It's explained in the documentation:
[ www.hikashop.com/fr/support/documentatio...p-discount-form.html](http://www.hikashop.com/fr/support/documentation/integrated-documentation/27-hikashop-discount-form.html)

> Category : You can limit a discount or a coupon to one category. For coupons, it means that you need at least once a product of this category in your order for the coupon to be valid. For discounts, it means that the discount is applied to products prices in this category only.

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

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

Less More

- Posts: 2
- Thank you received: 0
-
-

15 years 5 months ago [\#16786](#16786) by [mzelikovich](/forum/user/2589-mzelikovich "View mzelikovich's Profile")  Replied by *[mzelikovich](/forum/user/2589-mzelikovich "View mzelikovich's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16786 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Thank you, I understand now that I may need to use discounts instead of coupons.
Here is what I need to do (please refer to my ex above of cat A - C.
I have a lot of products under cat A, B, and sub-cat C1 - C2.
Products in cat A and B should never get a discount, even when they are in the cart with other products that do get a discount. All products in sub-cat C1 and C2 should get the following discounts:
$150 off with a minimum order of $300
$250 off with a minimum order of $400
$360 off with a minimum order of $720, etc...

How do I setup these discounts?
I tried setting up a "Discount" and limiting it to cat C, including sub-categories but it did not appear to work.
Thank you again,
Mike

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xNjI1MC1kaXNjb3VudHMtbm90LXdvcmtpbmctY29ycmVjdGx5P3RtcGw9bWFya2Rvd24=) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

15 years 5 months ago [\#16804](#16804) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#16804 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

So it's actually a minimum order amount of products in a particular category that you want and not a minimum order amount which is the case actually in HikaShop for coupon restrictions.
There is no option to do what you want as you can set a minimum amount for a discount, only for a coupon.
You would have to change the code of HikaShop for that...

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

- **[Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")**
- [![Piccirillo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar13616.jpg)](/forum/user/13616-piccirillo "View Piccirillo's Profile")
- [ Offline](/forum/user/13616-piccirillo)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 1 month ago [\#124911](#124911) by [Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")  Replied by *[Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#124911 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Good evening, I have the same problem and I would like to change the object coupon so that I subtract the amount of the coupon just in the total of the products in the selected category and not all in your shopping cart.
Where can I change it? in components / com_hikashop / controllers / checkout.php?
Thank you very much and good work

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xNjI1MC1kaXNjb3VudHMtbm90LXdvcmtpbmctY29ycmVjdGx5P3RtcGw9bWFya2Rvd24=) 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: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

13 years 1 month ago [\#124983](#124983) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#124983 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Hi,

There are restriction options for coupon, like a category restriction.
No need to modify the HikaShop core for doing such thing.

You can test it in our demo website:
[ demo.hikashop.com/administrator/index.ph...scount&amp;task=edit&amp;cid](http://demo.hikashop.com/administrator/index.php?option=com_hikashop&ctrl=discount&task=edit&cid)[]=4

Advance coupon restrictions are in the commercial editions of HikaShop. Some in the Essential and more in the Business one.

Regards,

---

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

The following user(s) said Thank You: [Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")

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

- **[Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")**
- [![Piccirillo's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar13616.jpg)](/forum/user/13616-piccirillo "View Piccirillo's Profile")
- [ Offline](/forum/user/13616-piccirillo)

Less More

- Posts: 6
- Thank you received: 0
-
-

13 years 1 month ago [\#125018](#125018) by [Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")  Replied by *[Piccirillo](/forum/user/13616-piccirillo "View Piccirillo's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#125018 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Thanks for the quick response!

The problem is the following:
For example I have a coupon of € 10,00 only active for products of category A.
In the cart I want the € 10.00 are excluded from the total of the items of Category A and not to the total cart that also contains products of category B and C.

Regards.
Dan

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

- **[Xavier](/forum/user/4105-xavier "View Xavier's Profile")**
- [![Xavier's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar4105.png)](/forum/user/4105-xavier "View Xavier's Profile")
- [ Offline](/forum/user/4105-xavier)

Less More

- Posts: 13201
- Thank you received: 2322
-
-
-
- [](http://www.kidiweb.fr)
-

13 years 1 month ago [\#125086](#125086) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Re: Discounts not working correctly](/forum/3-bug-report/16250-discounts-not-working-correctly#125086 "I have several products that we are running discounts on, however I want to make sure that certain categorys do not receive a discount. When adding items to the cart everything gets a discount even though I chose to only apply it to the specific category. Here's a detailed example of what going on: Category A - should be getting discount Category B - should not be.  If I add the discount before adding products from category B, the entire cart gets discount.  If I apply the discount after items in category B are added, none of the items get a discount and I get an error: &quot;The coupon you entered cannot be used for the products in your cart&quot;  Any help is greatly appreciated. :dry:")*

Hi,

This feature is not available by default in HikaShop.
But you can create a custom plugin to manage this kind of coupons.

It require good php skills.
Here is some documentation:
[ www.hikashop.com/support/documentation/6...r-documentation.html](http://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8xNjI1MC1kaXNjb3VudHMtbm90LXdvcmtpbmctY29ycmVjdGx5P3RtcGw9bWFya2Rvd24=) 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.140 seconds

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

[](#top)
