Developer forum

Forum » Ecommerce - Standard features » Cart Quantity decimal values

Cart Quantity decimal values

Dawid Leśniak
Reply

When on Product Page or Product List Page, I can add to a cart product with a decimal quanityt ex. 1.5
When I open a Cart View I can see quantity is 1.5
But when I try to change quanityty to any other decimal value in Cart View it is not saved and previous value is rendered.

DynamicWeb Version: 9.15.12

Example in screenshot. Added 5.2 to the cart from product details -> Went to cart and changed to 5.4. DW is still rendering 5.2
If I try numeric value it would work.
 

 

quantity.PNG

Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Dawid

I believe that is a bug in the template or JS of add to cart. Maybe it is Swift? Swift have gotten a number of bug fixes on this issue, e.g. 1.26.3 here: https://github.com/dynamicweb/Swift/releases/tag/v1.26.3

I can see that you have customizations - so you might need to find the pull request in Git that matches this fix.

Sorry about the inconvenience.

BR Nicolai

 
Dawid Leśniak
Reply

Hi Nicolai,

For me it doesn't sound like a JS/Swift. I can see that a correct value is in a Form Data Payload and this is where Swift responsibilit ends.

Also, when I create NotificationSubscriber like Order.BeforeSave or Cart.Line.Increased the first one is triggered always and Request.Form holds correct quantity but wrong one is beeing saved.

Second one is triggered only when I POST a numeric values.

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Dawid

I have just checked the Dynamicweb 9 code and it does not look we have made any changes here in years.

In the below test it does work on our test environment.

I can add 1.2 products and change it to 1.4. The product it self has a step purchase quantity of 0.1

The quantity you POST will eventually be checked against minimum and step quantities set on the prodcut like below - and that can affect the resulting orderline quanitty - as DW will try to change whatever you post to a valid value given the settings on the product:

So, my question is if step and min purchase quantity is set according to this?

If this does not get you furhter I will need a URL where we can see the issue to investigate.

BR Nicolai

 

You must be logged in to post in the forum