Git Product home page Git Product logo

Comments (13)

bmihelac avatar bmihelac commented on June 24, 2024

You mean Decimal?

from django-shop.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

yes

from django-shop.

bmihelac avatar bmihelac commented on June 24, 2024

There are quite a lot of other places it should be changed as well:

from django-shop.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

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.

stephenmuss avatar stephenmuss commented on June 24, 2024

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.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

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.

alesdotio avatar alesdotio commented on June 24, 2024

Wouldn't just using a smaller metric solve the problem? For example, using grams instead of kg?

from django-shop.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

Well, sometimes client want to see kg, and don't want to see grams

sad true

from django-shop.

alesdotio avatar alesdotio commented on June 24, 2024

you could make a templatetag or filter that converts to the desired unit ;)

from django-shop.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

hm, not a good solution, as for me.

Cause i will need to change many templates in admin area

from django-shop.

alesdotio avatar alesdotio commented on June 24, 2024

ah, true. unfortunately i don't see this being solved soon, unless somebody sends an awesome pull request :)

from django-shop.

vladyslav2 avatar vladyslav2 commented on June 24, 2024

i will send my solution of this problem.
will see if it ok or not

from django-shop.

jrief avatar jrief commented on June 24, 2024

Closed. Please check version 0.9. The quantity can by any of these types: Integer, Float, Decimal

from django-shop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.