Jump to content

Prices drop show only products with reduction > 10%


Recommended Posts

Hi,

 

The specials block displays a random special using the getRandomSpecial function in the Products class, as opposed to the function getPricesDrop, which extracts all specials. The actual reduction value of the selected product is only extracted from the database once a random product has already been chosen from an initial database operation. Thus sorting directly from the specials block module isn't possible by default.

 

An alternative specials module, TM Specials, actually just uses getPricesDrop to extract all the specials but only displays 6 of them in price descending order. It would be interesting to know if this method is signifcantly slower. If you don't want to modify a parameter in getPriceDrop that allows sorting by reduction as a percentage, keeping in mind that I guess you'd have to manually calculate non-percentage reductions as percentages, you could use a similar method of employing getPriceDrop and then filter and randomise downstream. 

 

To be honest, I don't know the impact on speed and whether it's worth it for a single special that you may not necessarily need/want to randomise in the first place.

Link to comment
Share on other sites

×
×
  • Create New...