Page 1 of 1

Get number of sales for a product

Posted: Mon Mar 18, 2013 10:02 am
by Rqton
Hi,

I'm facing a problem of complexity.

My problem is that i have a list of 20 products and i have to sort them according to their number of sales.
The basic solution is to cover all the orders for each product. But if i have 1000+ orders, the complexity will be too high.

Do you know a better solution to do this type of sort ?

Thanks in advance for your help !

Re: Get number of sales for a product

Posted: Mon Mar 25, 2013 9:54 am
by Rqton
Hi,

I found a quite good solution :

Create attribute "private long sales" for a product to keep his number of sales.
Create an Activity in the checkout workflow.In this activity, i increase the number of sales for each product in the order.

So, when a customer checkout an order, the number of sales to each product in this order is increase.

Now, for each product, i have his number of sales.
I can easily sort my products by number of sales.

I hope it will help somebody else :D
PS : Sorry for my "bad" english.

Re: Get number of sales for a product

Posted: Mon Mar 25, 2013 10:24 am
by phillipuniverse
Excellent solution, and definitely the one that I would recommend. Great job!