Add to cart quantity as decimal double

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
11 years ago
Hi,

I’m using nopCommerce2.5 and I have searched far and wide for someone who has updated the “add to cart quantity” to a decimal. For one I need to be able to add a minimum of .25 and then increments of .25… I’ve tried using variants but that ends up looking very clunky. So I’ve come to the conclusion that the only way to do this is to begin with changing the Quantity field in the database from Int to Double and work my way through from there?

The next place to go would be to update:

public int Quantity { get; set; }

in

ShoppingCartModel.cs

to

public double Quantity { get; set; }

I would then have to go through:

ShoppingCartController.cs

And change all the Ints to Doubles, big job. From there I have no idea where I would have to make changes.

Has anyone done this, I have read that by doing so there is no way without lots of testing to work out how it would affect the shipping, tax and so on. In our case shipping and tax are not complicated, basically a flat rate.

What do you all think?

Cheers,

Mike.
11 years ago
Sorted, just do what I thought. Start with StockQuantity to get a feel, change the database value from int to decimal and then work your way through the models, interfaces and controllers until that works. Then tackle the Quantity, that’s a bigger job.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.