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

#   Discount not working as intended...

##

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#117567](#117567) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#117567 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")* was created by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")*

I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.

I've set a discount called "bcjc2013" to apply a 5% discount to products in the Armor category. See the attached screenshot for details.

I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.

- [ ![he52c971.jpg](/forum/attachment/11578) ](/forum/attachment/11578 "he52c971.jpg") [ ](/forum/attachment/11578?download=1 "he52c971.jpg")

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#117568](#117568) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#117568 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

I'm running Hikashop Business, version 2.2 on Joomla 3.1.5

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2MDc1Ni1kaXNjb3VudC1ub3Qtd29ya2luZy1hcy1pbnRlbmRlZD9zdGFydD0wJnRtcGw9bWFya2Rvd24=) 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: 86285
- Thank you received: 14263
-
-

13 years 2 months ago [\#117585](#117585) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#117585 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Discounts apply directly on the price of products, that's normal. What you want to use are called "coupons". Change the type of your discount to "coupon" and you will see that it works like you want.

Discounts/coupons can apply onto a product or a category. There is no option to have it apply to a brand for now.

The following user(s) said Thank You: [ronvonck](/forum/user/29913-ronvonck "View ronvonck's Profile")

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#118618](#118618) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118618 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Thanks Nicolas,

Switched the Discount to a Coupon and it appears to work. However I've noticed that the restrictions aren't behaving correctly.

I've set the Category to "Armor" which means any items and sub categories in the Armor section should be discounted. However, if I add an item from another product category, the systems gives a discount for that product as well...

Try using the coupon code "bcjc2013" to see what I mean.

Our site is here:

[ www.badassjeeps.com](http://www.badassjeeps.com)

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

13 years 2 months ago -  13 years 2 months ago [\#118639](#118639) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118639 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

I think that the problem is coming from the fact that coupon are applied to your customer orders and discount are directly applied to products.
So if one of the products that are in your cart is in your coupon's product category, the coupon can be applied to this order.

Last edit: 13 years 2 months ago by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile").

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#118763](#118763) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118763 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

So with that in mind, if I revert it back to a discount, can I force it to only show the discounted price in the cart after the discount has been applied via the Enter Coupon Code box, rather than the way it behaves now where it automatically applies the discount across the board without even entering in the coupon code.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2MDc1Ni1kaXNjb3VudC1ub3Qtd29ya2luZy1hcy1pbnRlbmRlZD9zdGFydD0wJnRtcGw9bWFya2Rvd24=) 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 2 months ago [\#118792](#118792) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118792 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

When you set it to "coupon" you have more options displayed, thanks to enable the option "Coupon percentage applies to product only ". This will affect only the discounted products and not all the cart.

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#118931](#118931) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118931 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

I set the option "Coupon percentage applies to product only " to "Yes" and it still seems to apply to all products regardless of Category. Do I have to individually select the products perhaps? That would be a pain to do as I have several hundred products in the database at this point.

Thanks in advance,

Ben

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2MDc1Ni1kaXNjb3VudC1ub3Qtd29ya2luZy1hcy1pbnRlbmRlZD9zdGFydD0wJnRtcGw9bWFya2Rvd24=) 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 2 months ago -  13 years 2 months ago [\#118992](#118992) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#118992 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

I have reproduced your problem. We will provide a patch as soon as possible.

Regards,

---

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

Last edit: 13 years 2 months ago by [Jerome](/forum/user/80-jerome "View Jerome's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2MDc1Ni1kaXNjb3VudC1ub3Qtd29ya2luZy1hcy1pbnRlbmRlZD9zdGFydD0wJnRtcGw9bWFya2Rvd24=) 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 2 months ago [\#119063](#119063) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#119063 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

Well, I have finally find some time to make the debug. I am alone today for the support (bank holiday) so there is a lot to do.

So ! Please edit the file "administrator/components/com_hikashop/classes/discount.php" and replace Code:

if(!$product-&gt;cart_product_option_parent_id) { foreach ($id as $productid) { if(!$product-&gt;product_id == $productid[0]){

By: Code:

if(!$product-&gt;cart_product_option_parent_id) { foreach ($id as $productid) { if($product-&gt;product_id !== $productid[0]){

And it will reset the discount system right, as before.

Regards,

---

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

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#119064](#119064) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#119064 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

I was looking into it a little more myself and found that if you 1st add a product outside the Armor category, the coupon is denied, which is correct. However, if you add a 2nd product to the cart from a category that the coupon accepts, then it discounts BOTH products instead of just the one.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg2MDc1Ni1kaXNjb3VudC1ub3Qtd29ya2luZy1hcy1pbnRlbmRlZD9zdGFydD0wJnRtcGw9bWFya2Rvd24=) 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 2 months ago [\#119068](#119068) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#119068 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

Please apply the patch from my previous post.

Regards,

---

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

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#119111](#119111) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#119111 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Thanks Jerome! Appreciate the quick response. I'll let you know how the patch goes.

Cheers,

Ben

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

- **[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")**
- [![ben&#95;whitney's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile") Topic Author
- [ Offline](/forum/user/16236-ben-whitney)

Less More

- Posts: 47
- Thank you received: 0
-
-

13 years 2 months ago [\#119124](#119124) by [ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")  Replied by *[ben\_whitney](/forum/user/16236-ben-whitney "View ben&#95;whitney's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#119124 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Bug fix worked, thanks Jerome!

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 10 months ago -  12 years 10 months ago [\#134929](#134929) by [sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile")  Replied by *[sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#134929 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

I see this message was 3 months ago, has this patch been added to the last update?
I'm having exactly the same problem, coupon being incorrectly applied to first category if the second products added are from a category that has a valid coupon, do I need to add the fix you've provided?
Please help as our customers are getting massive discounts on a category which does not have a coupon attached!
Thanks

Last edit: 12 years 10 months ago by [sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile").

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

- **[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")**
- [![Mohamed Thelji's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar6861.png)](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")
- [ Offline](/forum/user/6861-mohamed-thelji)

Less More

- Posts: 12953
- Thank you received: 1778
-
-
-

12 years 10 months ago [\#134955](#134955) by [Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")  Replied by *[Mohamed Thelji](/forum/user/6861-mohamed-thelji "View Mohamed Thelji's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#134955 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,
Sure this patch has been added through the last last Hikashop version, so can you download it through our website and test it again ?

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 10 months ago -  12 years 10 months ago [\#134969](#134969) by [sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile")  Replied by *[sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#134969 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

I'm running the latest version HikaShop Business: 2.2.2 and I've checked the code which is now this (your fix and some additional code)
if(!$product-&gt;cart_product_option_parent_id) {
foreach ($id as $productid) {
if($product-&gt;product_id !== $productid[0] &amp;&amp; empty($coupon-&gt;discount_coupon_product_only)){
BUT I am still getting this bug what can i do?
thanks

Last edit: 12 years 10 months ago by [sarahoxford](/forum/user/11608-sarahoxford "View sarahoxford's Profile"). Reason: added code info

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

12 years 10 months ago [\#135055](#135055) by [Xavier](/forum/user/4105-xavier "View Xavier's Profile")  Replied by *[Xavier](/forum/user/4105-xavier "View Xavier's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#135055 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi,

Even without your custom code it's not working ?
This patch should be working fine. Are you sure that you coupon/discount configuration is correct ?

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 10 months ago [\#135228](#135228) by [Shope2](/forum/user/29985-shope2 "View Shope2's Profile")  Replied by *[Shope2](/forum/user/29985-shope2 "View Shope2's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#135228 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Hi, Yes as sure as I can be, attached a screen shot.
The discount is on the back issues category only. If the order is only for back issues (5 or more) it's working fine, but an order for 2 x back issues and a product from another category triggered the discount. This shouldn't be possible the other category product should have been at full price and no discount for the 2 x back issues as the number was under 5.

[ ![h59197b6.png](/forum/attachment/14108) ](/forum/attachment/14108 "h59197b6.png")

Thanks
Hope
(Replying from linked subscription)

- [ ![h59197b6.png](/forum/attachment/14108) ](/forum/attachment/14108 "h59197b6.png") [ ](/forum/attachment/14108?download=1 "h59197b6.png")

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

12 years 10 months ago [\#135714](#135714) by [Shope2](/forum/user/29985-shope2 "View Shope2's Profile")  Replied by *[Shope2](/forum/user/29985-shope2 "View Shope2's Profile")* on topic *[Discount not working as intended...](/forum/27-checkout/860756-discount-not-working-as-intended#135714 "I can't seem to get my discounts working properly. For some reason, it applies the discount to all products even though I haven't entered the discount during the checkout process.  I've set a discount called &quot;bcjc2013&quot; to apply a 5% discount to products in the Armor category. See the attached screenshot for details.  I also find that applying the discount by category to be problematic for the number of products I have... ideally it would be easier to apply the discount by brand/manufacturer.")*

Please could you look at this problem, still need a solution to this discount bug.

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

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

[](#top)
