Developer forum

Forum » Ecommerce - Standard features » Order quantity in decimal numbers

Order quantity in decimal numbers

Ivan Marijanović
Ivan Marijanović
Reply

Hi,

we have customer selling parquets and flooring woods but in cart we are forced to have quantities in whole number, so customer cannot order 45,6 sqm of flooring.

How we can change this?

 

Ivan


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Could this maybe just be a Rapido issue? The Quantity property of the OrderLine class is a Double in code and should support decimals. The same is true for the OrderlineQuantity column in the database. So as far as I can tell this should work on a standard implementation. 

Imar

 
Nicolai Pedersen
Reply
This post has been marked as an answer

input type="number" is used in the cart. It has a step attribute where the default value is "1" meaning it will step 1-2-3-4 etc. You can change that to be step=.1 and it will go 1 - 1.1 - 1.2 etc.

BR Nicolai

Votes for this answer: 1
 
Ivan Marijanović
Ivan Marijanović
Reply

Thank you both for your answers!

Ivan

 
Ivan Marijanović
Ivan Marijanović
Reply

Nicolai

I tried what you suggested like this:

@Render(new NumberField {

                                    Id = product.GetString("Ecom:Order:OrderLine.Id"),
                                    Min = 0,
                                    OnChange = "document.getElementById('CheckoutForm').submit()",
                                    Name = "QuantityOrderLine" + product.GetString("Ecom:Order:OrderLine.Id"),
                                    Value = product.GetString("Ecom:Order:OrderLine.Quantity"),
Step = 0.001
                                })
 
but step is integer number so i get:
 
 
Nicolai Pedersen
Reply

Yes - that seems to be hardcoded as an integer in Rapido.

You would have to not use that render method and numberfield, but render the markup manually.

Sorry about the inconvenience.

BR Nicolai

 
Jon Thorne
Jon Thorne
Reply

Hi Nicolai,

Is there any plan for Rapido to be updated to allow decimal numbers in the cart quantity field?

Jon.

 
Nicolai Pedersen
Reply

Hi Jon

No - it will not be part of a Rapido release. But you can change the markup yourself and have support for it.

BR Nicolai

 

You must be logged in to post in the forum