Jump to content

Lets Make Decimal Quantities for Product


lophie

Recommended Posts

Hello all,

 

It has been a while for me working on something involving Prestashop. I am amazed and proud of this community! we have gone along way!

 

Anyway I am currently developing a small module for someone and I was shocked that Prestashop is yet to enable fractional quantities for products. I searched and searched with no avail. People wants the feature, but the developers are not interested.

 

So I decided to do it! and as I am doing it I would appreciate help and tips from developers around here and maybe if my implementation get acceptance, one day it will be included in Prestashop core (Fingers crossed).

 

I think the developers just don't want to complicate things on the backend and they don't want the database to bloat and bloat. I think there is another way of approaching this by deceiving the user interface. Seeing in fractions does not mean to actually use fractions! The main idea behind my implementation is to add a field to the products table called decimals. this field would be a single positive integer. If it is set to "0" then this product use integer quantities and if it is set for example to "2" then the minimum possible amount is "0.01" (Notice that minimum possible quantity does not have anything to do with minimum quantity for ordering).

 

then all we have to do is to process how they are displayed to the users and process them back to integer before we store them in the database (or even in variables).

 

What do you guys think and if you can think of any pitfalls I might fall into please mention them. Thanks.

 

Best regards,

 

- Lophie

Link to comment
Share on other sites

  • 6 months later...
  • 4 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...