Answer the question
In order to leave comments, you need to log in
javascript cart function
Can you please tell me or give me a tip how to make cart functions in native js? The biggest difficulty is that you need to parse the data of the product under which you clicked "order" (cost, name, etc.), so how to determine what exactly under a particular product was clicked order and forbid it from being added to the cart again? Thank you.
Answer the question
In order to leave comments, you need to log in
What if I want 2 identical items?
Well, in general, check the array with goods for the presence of the same ones, if there is one in the basket, then we add it to the quantity 1, and do not add it as a new position
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question