Comments (13)
You mean Decimal?
from django-shop.
yes
from django-shop.
There are quite a lot of other places it should be changed as well:
- OrderItem
- CartItem
get_cart_item_formset
(https://github.com/divio/django-shop/blob/master/shop/forms.py#L35)
from django-shop.
Yes, add_product we need to replace int with decimal - https://github.com/divio/django-shop/blob/master/shop/models/defaults/bases.py#L143
from django-shop.
I can see why there would be a need for this. In my own experience I have had cases where I have wanted decimal type quantities in an ecommerce environment which didn't offer them.
The only thing is that a decision would need to be made on the default max_digits
and decimal_places
if using django.db.models.DecimalField
.
from django-shop.
Basically this is need for marketing issues.
Its a marketing problem, that had to be solved with programmers help.
For example, one meter of textile cost a $12.
But you can't buy 1 meter of textile - you can buy only a pack of textile, in pack is a 2.75 meters.
One way - you need to set price in packs at you admin area, and this is a right way, cause goods sends in packs.
But marketers saying, no we need to set price in meter, its looks much cheaper in meters.
In fact, when you buy 1 meter - its only a 1/3 part of one goods. But you can purchase 1/3 of goods, so actually you're buying 2.75 meters, or 5.50, or 8.25 meter and etc, and this value you need to store in database.
Cause seller want to have prices in meters.
Guys, hope you understand my English.
I'm sorry about that.
from django-shop.
Wouldn't just using a smaller metric solve the problem? For example, using grams instead of kg?
from django-shop.
Well, sometimes client want to see kg, and don't want to see grams
sad true
from django-shop.
you could make a templatetag or filter that converts to the desired unit ;)
from django-shop.
hm, not a good solution, as for me.
Cause i will need to change many templates in admin area
from django-shop.
ah, true. unfortunately i don't see this being solved soon, unless somebody sends an awesome pull request :)
from django-shop.
i will send my solution of this problem.
will see if it ok or not
from django-shop.
Closed. Please check version 0.9. The quantity can by any of these types: Integer, Float, Decimal
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.