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

#   Best approach for discounts?

##

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

Less More

- Posts: 33
- Thank you received: 0
-
-

15 years 2 months ago -  15 years 2 months ago [\#25251](#25251) by [hko](/forum/user/3515-hko "View hko's Profile")  *[Best approach for discounts?](/forum/4-how-to/25251-best-approach-for-discounts#25251 "I was wondering what would be the best approach to have a certain discount when a user(group) order a certain amount (Euro's) per category.  Like in cat.A, if more the x in total, discount is 5% if more then y, discount is 10%. etc... but only for the products in that categorie, not for the whole cart.  I was thinking of writing a plugin for that, perhaps in combination with custom field(s)..  Any pointers for me?  thx")* was created by *[hko](/forum/user/3515-hko "View hko's Profile")*

I was wondering what would be the best approach to have a certain discount when a user(group) order a certain amount (Euro's) per category.

Like in cat.A, if more the x in total, discount is 5%
if more then y, discount is 10%. etc...
but only for the products in that categorie, not for the whole cart.

I was thinking of writing a plugin for that, perhaps in combination with custom field(s)..

Any pointers for me?

thx

Last edit: 15 years 2 months ago by [hko](/forum/user/3515-hko "View hko's Profile").

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

Less More

- Posts: 86584
- Thank you received: 14325
-
-

15 years 2 months ago [\#25252](#25252) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Best approach for discounts?](/forum/4-how-to/25251-best-approach-for-discounts#25252 "I was wondering what would be the best approach to have a certain discount when a user(group) order a certain amount (Euro's) per category.  Like in cat.A, if more the x in total, discount is 5% if more then y, discount is 10%. etc... but only for the products in that categorie, not for the whole cart.  I was thinking of writing a plugin for that, perhaps in combination with custom field(s)..  Any pointers for me?  thx")*

Hi,

For a long term solution, in HikaShop, it means to add new options for coupons and change the coupon system in depth in order to handle that.

For a way more simple solution, you could do that category check in one of the views of your checkout and automatically add/remove a product which would have a negative price (I think that it's possible). You can easily add a product to the cart by redirecting the customer to the URL:
index.php?option=com_hikashop&amp;ctrl=product&amp;task=updatecart&amp;product_id=XX&amp;quantity=YY&amp;checkout=1

where XX is the id of the product and YY is the new quantity of the product in the cart.

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

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

Less More

- Posts: 33
- Thank you received: 0
-
-

15 years 2 months ago -  15 years 2 months ago [\#25441](#25441) by [hko](/forum/user/3515-hko "View hko's Profile")  Replied by *[hko](/forum/user/3515-hko "View hko's Profile")* on topic *[Re: Best approach for discounts?](/forum/4-how-to/25251-best-approach-for-discounts#25441 "I was wondering what would be the best approach to have a certain discount when a user(group) order a certain amount (Euro's) per category.  Like in cat.A, if more the x in total, discount is 5% if more then y, discount is 10%. etc... but only for the products in that categorie, not for the whole cart.  I was thinking of writing a plugin for that, perhaps in combination with custom field(s)..  Any pointers for me?  thx")*

Hi Nicolas,

thx for the tips.
FYI, it is not possible to have a negative price for products with the normal admin HS interface. It will be converted to positive (ABS function). So the only way to do that is by modifying directly in the database... not nice.
Also, it looks a bit weird to have a product in the cart like that because you can change the amount etc as end user.. so that was a dead end.

I finally took the approach of adding some Joomla User groups and creating different discounts which are only available for that specific product group and also only for a specific (newly created) Joomla group.

Then created a Plugin which will calculate the total amount for that specific group and if above a threshold (which can be set in the plugin) it will add the shopping user to the next Joomla group. That results in HS now applying the next discount.
If the total amount is reduced again, the user will be removed from that extra group again.
(I just needed two steps above the standard discount)
Plugin ended as being a little bit bigger then expected but it seems to work flawlessly..

[ ![&#91;img](http://www.hikashop.com/media/kunena/attachments/legacy/images/ScreenShot399.jpg) ](http://www.hikashop.com/media/kunena/attachments/legacy/images/ScreenShot399.jpg "&#91;img")

Hope this helps others perhaps.

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

Last edit: 15 years 2 months ago by [hko](/forum/user/3515-hko "View hko's Profile").

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

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