Price filter ignoring discount

  • Posts: 2143
  • Thank you received: 747
10 years 4 weeks ago #176999

-- url of the page with the problem -- : local
-- HikaShop version -- : 2.3.4
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.19
-- Browser(s) name and version -- : any
-- Error-message(debug-mod must be tuned on) -- : none

Hi,

Generally, filters work fine - with one exception so far: when filtering by price, discounts are being 'ignored', meaning that products can end up showing in the 'wrong' price bracket. In other words, it appears that only the price before discount is being considered, not the price after discount.
Which IMHO is 'wrong' from the customer's perspective as presently he won't see products that are within his budget after discount.

Example:
- Two filter price brackets: one $0 - $1000, the other $1000-$2000.
- A product with a regular price of $1100.
- A discount of 10% applied to it.
Result: The discounted product, now $990, still shows in the $1000-$2000 price bracket, not in the $0-$1000 bracket where it belongs.

A fix would be appreciated - thanks!


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
10 years 4 weeks ago #177048

Hi,

Yes, discounts are not taken into account for prices filtering because it's not possible to calculate dynamically the discounts on the prices during the filtering in MySQL.
The only solution would be to pre calculate all the prices ahead of the filtering, with some kind of a calculation caching table.
That's a lot of work to put in place and create new problems as it requires the system to keep the prices up to date in the caching table when something changes in the prices of the products.
An easiest solution (although more work for you) is to create a custom product field where you would enter the price that you want to be used for the filtering in each product and then have your filter apply on that custom field instead of the price.

Please Log in or Create an account to join the conversation.

  • Posts: 2143
  • Thank you received: 747
10 years 4 weeks ago #177097

Aaaww, too bad, really thought it was just a thing of a bit more arithmetics... something computers are much better with than human beings.
Thanks anyway for the explanations, hope I'll be able to pass them on as well when asked...

nicolas wrote: An easiest solution (although more work for you) is to create a custom product field where you would enter the price that you want to be used for the filtering in each product and then have your filter apply on that custom field instead of the price.


I agree that it's a valid and practical workaround for a small to mid-sized store with the occasional discount. I'm already using custom fields as cheats for other, simpler purposes, but for a market thingy with lots of products and vendors, and ever-changing discounts I feel it doesn't want to be managed manually.
I'll see how far I get without the extra math.


Need help with customisations of layouts, style or other site development? PM me!
(Don't forget to turn on "E-mail notification of new messages" )

Please Log in or Create an account to join the conversation.

  • Posts: 410
  • Thank you received: 9
  • Hikaserial Subscription Hikashop Business
9 years 1 month ago #218238

Hello we've the same issue,
is there allready a way how we can get the discount prices to work also with the filter?
Thanks.

Please Log in or Create an account to join the conversation.

  • Posts: 26158
  • Thank you received: 4028
  • MODERATOR
9 years 1 month ago #218241

Hi,

The solution given by Nicolas is still the current answer for that request.

Regards,


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

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

Please Log in or Create an account to join the conversation.

  • Posts: 16
  • Thank you received: 0
8 years 9 months ago #230016

I'd like to put my two cents in.
Such behavior contradicts with seller's intention. As a seller, I'm giving discounts to attract a buyer, to make it visible to the buyer when he filters my product. For me, the more products he will find, the better. But hikashop filter, so to speak , works against me.
As a seller I don't care how many cache table my website is going to have or how mach server calculation resource I'm going to spend on pre-calculation of prices, simply because if my customer won't see this product - I won't sell it.
I for one will probably go with an additional custom field with pre-calculated price, but it would be nice to have even the simpliest workaround from hikashop team in future.

Please Log in or Create an account to join the conversation.

  • Posts: 82867
  • Thank you received: 13374
  • MODERATOR
8 years 9 months ago #230100

Hi,

Please note that there is now a solution for that.
You create a custom product field and have your filter apply on it, as explained earlier in this thread, and then you create a mass action to fill that custom product field with a massaction (you can use an action 'update the values on the column name of the custom field with the value price.price_value for that).

The mass action can be run once to generate all the prices, and/or can be made to be triggered each time a price is updated so that the value in the product field stays up to date.

The following user(s) said Thank You: BluepointWebdesign

Please Log in or Create an account to join the conversation.

Time to create page: 0.082 seconds
Powered by Kunena Forum