A
A
Alexander2015-03-17 15:55:06
CMS
Alexander, 2015-03-17 15:55:06

How to make a new order get into the list of new orders of the same user?

Good day. Please tell me how it can be implemented, such that if a user places another order, while he has an order with the “new” status, the second order should not be created as a separate one, but added to the order with the “new” status. ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander, 2015-03-17
@Dil0ng

What is an order? This is a set of some parameters and properties + a basket.
A set of products is taken from the cart, but the order amount is stored separately, like other properties.
From this, the logic is as follows:
When creating an order, it is necessary to check whether this client has an order with the status new.
If there is, take the composition of the basket from it, get the goods and their quantities from there. Add all these products in the right quantity to the current cart.
Take property values ​​from an existing order and create a new order by filling in the properties from what was already there, hooking the current basket to it, and deleting the order that was.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question