Answer the question
In order to leave comments, you need to log in
How can I add a shopping cart to the website of an online store so that when you click on the "Buy" button, a shopping cart with a product is displayed?
Good afternoon! Can you please tell me how you can add a shopping cart to the website of an online clothing store so that when you click on the "Buy" button, a cart with the selected product, its quantity, size, price, total cost is displayed? And also to be able to add items to the cart and remove them. PHP and Java Script are used.
Answer the question
In order to leave comments, you need to log in
I suggest)))
There are exactly 2 fundamentally different options:
1. Store data about the goods added to the cart on the server
2. Store data about the goods added to the cart on the client
If your online store forces the user to log in, then you should implement the first option. If the store is not tied to the user in any way (there is no authorization of any kind, user data is not stored on the server), then option 2 will be the best for you.
And so, here are descriptive examples of the possible implementation of both options:
Option 1:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question