Jump to content

Get ID's of last Products Sold


Recommended Posts

Thanks for your replies , 

Maybe I was unclear, I want to show those products front end,to the customers. In my eshop Home page not admin home page. And I want to do it dynamically, with each new order, products shown in front home page will be updated automatically with the newly sold items. 

Link to comment
Share on other sites

Hi,

The products purchased are in the ps_order_detail table. Basically, you just have to make a select, ordering them in descending order. If you want something more complex, you can also check the current status of the order that the products are part of, so that it is not a canceled order, or one that has not yet been processed.

  • Like 1
Link to comment
Share on other sites

50 minutes ago, Ress said:

Hi,

The products purchased are in the ps_order_detail table. Basically, you just have to make a select, ordering them in descending order. If you want something more complex, you can also check the current status of the order that the products are part of, so that it is not a canceled order, or one that has not yet been processed.

Indeed. Also use LIMIT 10 in your SQL query, to get only the 10 latest instead of filtering in PHP.

  • Like 1
Link to comment
Share on other sites

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...