Hello, I have begun coding backend-part for online-shop using Django. I have some problems with the cart, I read many directories and videos, but can’t find a solution for this problem. Have added checking for the items in the cart. The cart is empty, don’t understand why it’s doesn’t work.
I need to show products that was added in the cart.
For us to help you, you’re going to need to provide a lot more specific information, including posting the relevent code here. You’ll need to explain exactly what problem you’re having, and what you’re expecting to have happen that isn’t. Providing this information in the context of some sample data may help.
We’re probably going to need to see the models, views, and forms involved. If you’re using JavaScript for any client-side activities, let us know what JavaScript libraries you’re using, and include any relevent JavaScript code needed to understand what you’re trying to do.
Also, when posting code, templates, html, etc, here enclose each block of lines between lines of three backtick - ` characters. That means you’ll have a line of ```, then your lines of code, then another line of ```. Do not post screenshots or images of code or templates.
With a brief sight to your code, I am not sure but it looks like you have made web development in Java EE in the past, am I wrong?
IMHO it could be more idiomatic to build a cart around a Django Model, the session based cart is harder to debug, maintain and extends.
Now returning to your code, I can be wrong but Don’t you need anther construction in order to use values() method? Have you tried in console and what type of returning you have?