E-commerce website shopping cart, request interface problem

problem description

now it is planned that the shopping cart database should also be saved to ensure that you can see the same information on different terminals, so the question is when to change the request interface to change the database information. Each request to add items is OK, but it is not realistic to request the server after each change of quantity. When should I request the interface to submit the items in the current shopping cart?

the environmental background of the problems and what methods you have tried

related codes

/ / Please paste the code text below (do not replace the code with pictures)

what result do you expect? What is the error message actually seen?

Aug.12,2021

this is what I do. Before leaving the page, submit the latest shopping cart data


send the request as soon as the data changes. To prevent frequent requests, cancel the previous request

Menu