Allow Decimal Quantities in Cart (e.g., 1.2 sqm) – How to Achieve This?

How to configure and adapt Aimeos based shops as developer
Forum rules
Always add your Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
randomdennis
Posts: 38
Joined: 10 Oct 2024, 12:51

Allow Decimal Quantities in Cart (e.g., 1.2 sqm) – How to Achieve This?

Post by randomdennis » 29 Jan 2025, 11:48

Hi everyone,

I need to allow users to add decimal quantities of a product to the cart in Aimeos, for example, 1.2 square meters instead of just whole numbers.

I was able to set the minimum quantity to 0.1, but when adding the product to the cart, Aimeos automatically rounds the quantity up or down to a whole number.

Where do I need to adjust settings or code to allow precise decimal quantities in the cart and throughout the checkout process?
Is there a way to achieve this without custom modifications?

Thanks in advance for any help!

User avatar
aimeos
Administrator
Posts: 8620
Joined: 01 Jan 1970, 00:00

Re: Allow Decimal Quantities in Cart (e.g., 1.2 sqm) – How to Achieve This?

Post by aimeos » 31 Jan 2025, 14:15

Aimeos can already handle fractional quantities if you set the "Scale" value in your products to the minimum allowed fraction. This works for Aimeos 2023.10+
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply