Comments (12)
grr yea I know... I once did a path that introduced a form with proper validation for the cart view but then I found out that the product detali view suffers from the same problem.
I had started on another patch to introduce a django form to the product detail view as well but then I faced yet another delicate problem:
SQL can only save so big values in the field that holds the sum of all items. While we might be able to check that the toal sum is not too big on the cart overview (in the form's clean method), we cannot check that so easily on the product detail view. Someone might enter a quantity of 999999999, which might still be ok, but then THAT has to be multiplied with some price and will most probably already result in a value that is too big for the database. additionaly, someone might add 99999999 items to his cart, then go back to the product detail page and add another 999999999...
I don't know what the best practice is for ecommerce solutions. I bet every shop has to deal with this? Do they just assume that no one will ever enter crazy amounts?
from django-shop.
I know it's a pretty ugly solution, but how about putting a setting or a constant for it? I think nobody will blame us if we put "cart can only handle 99999 objects of the same type" in a "known limitations" somewhere... What do you think?
from django-shop.
I mean put one higher limit on the price as well obviously... I think It's fair to assume people buying 5x5000k$ yatchs will probably not use an online shop?
from django-shop.
I'm kind of spammy, but I noticed this shop in particular uses another trick to limit the amount (drop down boxes).
http://shop.canonical.com/
from django-shop.
Hehe the DDLs there are kind of silly because on the cart they offer text inputs again :) But it's a nice idea.
from django-shop.
IMHO shop should handle big values. For example we build a panel for wholesale customers, and this panel should be able to handle very big values.
from django-shop.
zeus sure, everyone would want to have that feature. But how do you think this can be done? It's the database that restricts us. Should we save all prices and amounts and total sums as strings? o_O
from django-shop.
mbrochh AFAIK we have DecimalField for these fields. And DecimalField stored in db with Deciaml type which is in fact just string. I can't see db level limitations here :(.
from django-shop.
Hmm then I have to try to debug that issue again. As far as I can remember I got a MYSQL error when having a large amount of products which result in a very large total amount.
from django-shop.
We have limitation here - https://github.com/divio/django-shop/blob/master/shop/util/fields.py#L6 since someone think, that sum/prices can't contains more than 12 digits >_<.
My personal opinion - this should be configurable option with default = 20.
from django-shop.
This is changed and should be fixed in #138
Let me know if that addresses the problem
from django-shop.
Closed. Please check version 0.9.
from django-shop.
Related Issues (20)
- Overridden AdminSite
- Supporting filter_backends option for ProductRetrieveView
- OperationalError at / no such table: cms_urlconfrevision HOT 1
- "Can not add/subtract money in different currencies." HOT 4
- Decoupling Django Shop from Django CMS HOT 11
- Is there a way to checkout without billing or shipping addresses? HOT 1
- Bug with endless scrolling when there are has offset HOT 6
- Missing phonenumber option in link plugin
- Cannot install: No module named weakref
- Clear Cart functionality (aka delete all items in Cart at once)
- pipenv run ./manage.py initialize_shop_demo [ERROR] HOT 2
- Django 3.2 HOT 2
- filterChanged() not working
- Is project still active? HOT 2
- An admin for model "User" has to be registered to be referenced by FolderAdmin.autocomplete_fields HOT 2
- Multi-Tenancy Doc is not finished
- error while installation HOT 1
- Install error while parsing `--sequential` requirements HOT 2
- Problem with css variables HOT 2
- Django-shop elasticsearch bug "Unexpected queryset model" HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django-shop.