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

#   Price filter and discount

##

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

Less More

- Posts: 432
- Thank you received: 22
-

2 years 7 months ago [\#360154](#360154) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  *[Price filter and discount](/forum/45-filters-search/908000-price-filter-and-discount#360154 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4  I use sort filter by price. It works, but only on regular price. If I add some discount on products, filter still use regular price for sorting. Is any way to take discounted price (lowest) for sorting?")* was created by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")*

-- HikaShop version -- : 5.0.3
-- Joomla version -- : 4

I use sort filter by price. It works, but only on regular price. If I add some discount on products, filter still use regular price for sorting.
Is any way to take discounted price (lowest) for sorting?

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

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

2 years 7 months ago [\#360156](#360156) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Price filter and discount](/forum/45-filters-search/908000-price-filter-and-discount#360156 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4  I use sort filter by price. It works, but only on regular price. If I add some discount on products, filter still use regular price for sorting. Is any way to take discounted price (lowest) for sorting?")*

Hi,

No. The discounts are calculated dynamically in PHP when the prices of the product are loaded, after the list of the products is queried from the database. The sorting and filtering is done during the querying of the list of the products.
So it's not possible to take into account the discounts in a filter.
What you can do is to use the "product_sort_price" column instead of the "price" column for your sorting.
This is a value which is calculated dynamically when the price is changed.
You could use a "Display the results" action on this column (with a mass action) to edit the value in order to reflect the discount.
But beware that next time you change the price of these products, you'll loose the modification in the product_sort_price.
You could also create a mass action which would run after each product modification to set the product_sort_price based on the price minus a flat fee. That way it will allow to keep the synchronization when the products are updated.
This still means that when the discounts are changes, you would have to update your mass actions. And if you have complex discounts, it might not be practical either.

You could also develop a plugin to recalculate the sort price periodically with your own algorithm, and store it in a custom product field, which you could select for the sorting of your filter. But this require to be well versed in PHP and it's not just a few lines as supporting all the different kind of discounts on products requires quite a bit of processing.

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

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

Less More

- Posts: 432
- Thank you received: 22
-

2 years 7 months ago [\#360228](#360228) by [mojweb](/forum/user/5128-mojweb "View mojweb's Profile")  Replied by *[mojweb](/forum/user/5128-mojweb "View mojweb's Profile")* on topic *[Price filter and discount](/forum/45-filters-search/908000-price-filter-and-discount#360228 "-- HikaShop version -- : 5.0.3 -- Joomla version -- : 4  I use sort filter by price. It works, but only on regular price. If I add some discount on products, filter still use regular price for sorting. Is any way to take discounted price (lowest) for sorting?")*

Sorry to hear that. Then filter by price is in most case useless. I dont know of well made shop with that logic.

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

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