Jump to content

SQL Statement to Extract Sales


Recommended Posts



I would like to know if its possible to extract the sales from a sql statement at Prestashop. I am using version


The statement I am using is the following without results:

select distinct or.id_order ID, or.date_add FECHA, ord.product_name PRODUCTO, ord.product_reference REFERENCIA, ord.product_quantity CANTIDAD
from pr_order_detail ord, pr_orders or
where or.current_state in (4,5)
and or.id_order = ord.id_order
and or.id_lang = 7 
order by or.date_add, or.id_order

I have take out the id_lang field condition also the current_state without results in the query.

Link to comment
Share on other sites


perhaps ps_product_sale table is what you're looking for ?


Hi Vekia, thanks. What I look for is to extract all the quantity sold by month for each combination of each product. If possible make the filter of dates in the sql statement like the sql statement I described before because the table seems to show the total sales.


Also if you have information about how to extrack the stock also of each product each combination. I describe the issue in this topic:


Link to comment
Share on other sites

  • 1 month later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...