Developer forum

Forum » CMS - Standard features » How to sort products on top selling

How to sort products on top selling

Mikkel Belchuke
Mikkel Belchuke
Reply

Hi. 

Is it possible to sort products on top sellers? I can't seem to find any documentation regarding this. 


Replies

 
Nicolai Pedersen
Reply

Nope - not easy anyways.

You can create a custom field for products, call it "SoldItemsLast30Days" or something. Then create SQL that will update products set SoldItemsLast30Days = (sub query of sales) and use a scheduled task that executes that SQL every 24 hours/7 days.

Then the field will automatically be indexed and you can use it for sorting.

BR Nicolai

 

You must be logged in to post in the forum