7
7
7a-6662020-05-15 17:33:44
Django
7a-666, 2020-05-15 17:33:44

What is the best way to implement a shopping cart?

Now I have such an idea to create a temporary basket model and associate it with the product model, that is, you add a product, its id is added to the basket, and if you delete it, then accordingly it moves away from there
. It turns out a temporary model that stores the data that is now in the basket The
question is as follows such a solution would be optimal and is there a better alternative, for example, can it be implemented as cookies and if there is an alternative, please explain the principle in general terms and why it is better
Thanks for the answer;)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dr. Bacon, 2020-05-15
@bacon

When you talk about optimality, immediately voice the criteria, otherwise they are different. Well, if you want an alternative, then voice what problems you currently have with this solution, what exactly does not suit you in it?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question