Jump to content

Query to update order current_state and order_history


Recommended Posts

Hello,

My shop is built with Prestashop 1.56.2.

I would like to use an SQL UPDATE query to do the following :

1-Change the state of a list of orders to state 100 (100 is the state related to shipped order)

So, in the ps_orders Table, I need to update the current_state value to 100
This first part is easy.

2- But, I would like also to do simultaneously the following :
- create entries in the ps_order_history table as follows :
id_order_history : a value to be incremented for each new entry
id_employee : always the same, as 0, for instance
id_order : list to be included in the query
id_order_state : 100
date-add : the current date

Would anyone know how to make this query ?

I thank you in advance for any reply.

Patrick

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