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

#   max discount value

##

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

Less More

- Posts: 23
- Thank you received: 5
-
-

1 year 9 months ago [\#365288](#365288) by [mizso676](/forum/user/82243-mizso676 "View mizso676's Profile")  *[max discount value](/forum/46-discount-coupon/909040-max-discount-value#365288 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4.4.3 -- PHP version -- : 8.1.3 -- Browser(s) name and version -- : Chrome latest  Hi guys!  The following is my problem and the task to be solved: I need to set a maximum value for discounts per product, which overrides any preset Hikashop category discounts. What I have:  - A custom field where the value for each product is received from a CRM system (e.g., 30%). The custom field is named &quot;maxkedvezmeny.&quot; - Predefined Hikashop category discounts (e.g., the maximum discount that can be applied is 40%).  However, since not all products within the category can have a 40% discount, the system needs to consider the 30% value from the &quot;maxkedvezmeny&quot; field.  This was previously solved by a developer, and it worked, but it was deleted during a recent update.  Here is the translation:  If I am correct, I need to modify the currency.php file to override the Hikashop discount values when the &quot;maxkedvezmeny&quot; field is smaller than the discount value calculated by Hikashop.  Thanks in advance")* was created by *[mizso676](/forum/user/82243-mizso676 "View mizso676's Profile")*

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4.4.3
-- PHP version -- : 8.1.3
-- Browser(s) name and version -- : Chrome latest

Hi guys!

The following is my problem and the task to be solved: I need to set a maximum value for discounts per product, which overrides any preset Hikashop category discounts. What I have:

- A custom field where the value for each product is received from a CRM system (e.g., 30%). The custom field is named "maxkedvezmeny."
- Predefined Hikashop category discounts (e.g., the maximum discount that can be applied is 40%).

However, since not all products within the category can have a 40% discount, the system needs to consider the 30% value from the "maxkedvezmeny" field.

This was previously solved by a developer, and it worked, but it was deleted during a recent update.

Here is the translation:

If I am correct, I need to modify the currency.php file to override the Hikashop discount values when the "maxkedvezmeny" field is smaller than the discount value calculated by Hikashop.

Thanks in advance

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

1 year 9 months ago [\#365289](#365289) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[max discount value](/forum/46-discount-coupon/909040-max-discount-value#365289 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4.4.3 -- PHP version -- : 8.1.3 -- Browser(s) name and version -- : Chrome latest  Hi guys!  The following is my problem and the task to be solved: I need to set a maximum value for discounts per product, which overrides any preset Hikashop category discounts. What I have:  - A custom field where the value for each product is received from a CRM system (e.g., 30%). The custom field is named &quot;maxkedvezmeny.&quot; - Predefined Hikashop category discounts (e.g., the maximum discount that can be applied is 40%).  However, since not all products within the category can have a 40% discount, the system needs to consider the 30% value from the &quot;maxkedvezmeny&quot; field.  This was previously solved by a developer, and it worked, but it was deleted during a recent update.  Here is the translation:  If I am correct, I need to modify the currency.php file to override the Hikashop discount values when the &quot;maxkedvezmeny&quot; field is smaller than the discount value calculated by Hikashop.  Thanks in advance")*

Hi,

I really don't recommend modifying the currency.php file directly.
You'll end up losing your changes next time you update HikaShop.
A proper way to do it is to create a small plugin ( [ www.hikashop.com/support/documentation/6...r-documentation.html](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html) ) and implement, for example, the onAfterLoadProductPriceDiscount event:
[ www.hikashop.com/support/documentation/6...ProductPriceDiscount](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onAfterLoadProductPriceDiscount)
That way, when the discounts are being loaded, you can check the maxkedvezmeny value of each product and discard the discounts with a percentage value higher, or dynamically reduce their percentage, or clone the discount per product to be able to have different percentages of the same discount based on that maxkedvezmeny value.

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

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

Less More

- Posts: 23
- Thank you received: 5
-
-

1 year 9 months ago [\#365294](#365294) by [mizso676](/forum/user/82243-mizso676 "View mizso676's Profile")  Replied by *[mizso676](/forum/user/82243-mizso676 "View mizso676's Profile")* on topic *[max discount value](/forum/46-discount-coupon/909040-max-discount-value#365294 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4.4.3 -- PHP version -- : 8.1.3 -- Browser(s) name and version -- : Chrome latest  Hi guys!  The following is my problem and the task to be solved: I need to set a maximum value for discounts per product, which overrides any preset Hikashop category discounts. What I have:  - A custom field where the value for each product is received from a CRM system (e.g., 30%). The custom field is named &quot;maxkedvezmeny.&quot; - Predefined Hikashop category discounts (e.g., the maximum discount that can be applied is 40%).  However, since not all products within the category can have a 40% discount, the system needs to consider the 30% value from the &quot;maxkedvezmeny&quot; field.  This was previously solved by a developer, and it worked, but it was deleted during a recent update.  Here is the translation:  If I am correct, I need to modify the currency.php file to override the Hikashop discount values when the &quot;maxkedvezmeny&quot; field is smaller than the discount value calculated by Hikashop.  Thanks in advance")*

Thanks for your help, I've made it through currency.php, now trying to create a plugin!

The following user(s) said Thank You: [Philip](/forum/user/34318-philip "View Philip's Profile")

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

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