Need to create an online store. The user selects the goods, they are added to the basket. It is necessary to create a basket, with this principle and the problem, I do not know how to do that. I think it makes no sense to write code, I hope I asked the question clearly.
Closed due to the fact that the question is too general for the participants Sergey Gornostaev , entithat , iFr0z , Jarvis_J , Let's say Pie Dec 27 'at 18:20 .
Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .
- fiveru.stackoverflow.com/help/dont-ask - michael_best
- oneThere is no point in asking without a code. here is not a forum but a knowledge base, there is a specific question but a specific answer to it. - Arendach
1 answer
In your application I will display products that are somewhere placed, in a real store or online store, it does not matter. You will have a list of these products and then you need to realize the ability to add to the cart. I would advise you to make a singleton class in which the array of goods that are in the basket will be stored. When you click on the item itself, or when you click on a button specially created for these needs, you update the array stored in your singleton. And then when you go to the cart you request this array and display the selected items in the list. Everything is very simple, but I do not rule out the option that someone will offer a more worthy option that will be more effective in the context of your problem. If you have any questions or difficulties, do not hesitate and ask, we will try to help as much as we can. Good luck :)