Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cart.py #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update cart.py #12

wants to merge 1 commit into from

Conversation

scutarius
Copy link

Please update code in the Cart.py

@michaelavila
Copy link
Contributor

@scutarius thanks for the pull-request! Could you provide some background information? Why you needed this? And how you'd go about testing what you've added? If you could add the unit tests yourself that would be awesome, but if that's not possible just a description will be good and we can go ahead and add the tests ourselves. Let me know what you think!

// cc @bmentges

@scutarius
Copy link
Author

Excuse me, I have a bad knowledge of English, so I use a translator. In one project, a simple online store, when suddenly the buyer wants to change the quantity of the goods, and the buyer on the product order page, then it's better to update the quantity on this page. And modify the functional baskets is not bad :)
In my views.py when quantity> 0
quantity> 0: cart.update (product, quantity)
But if you enter 0
elif quantity == 0: cart.remove (product)

@michaelavila
Copy link
Contributor

@scutarius thanks! We'll start looking at this. @bmentges is this something you can write some tests for? Let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants