Can not order quantities 0.35 (mshop_stock.stocklevel = integer)

Help for integrating the Laravel package
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
columbo
Advanced
Posts: 153
Joined: 09 Oct 2019, 09:42

Can not order quantities 0.35 (mshop_stock.stocklevel = integer)

Post by columbo » 01 Jun 2024, 12:17

Hi,

Some of our products can also be ordered in quantities <1, e.g. 0.08kg, 0.75kg etc.
already set product.scale and price.quantity to 0.01.

Adding products to the basket works fine, but when submitting the basket we get the error Invalid text representation: 7 ERROR: Invalid input syntax for type integer: '0.75'.

UPDATE 'mshop_stock
SET 'stocklevel' = 'stocklevel' - ?, 'mtime' = ?, 'editor' = ?
WHERE 'prodid' = ? AND 'type' = ? AND ('siteid' IN ('','1.') )
[0.75,„2024-06-01 14:08:54“,„Test“,17557,„default“]

setup/default/schema/stock.php
stocklevel is defined as integer, shouldn't it be decimal?
Or what other setting is wrong?

Thank you!

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

Re: Can not order quantities 0.35 (mshop_stock.stocklevel = integer)

Post by aimeos » 02 Jun 2024, 07:41

Yes, you are right, integer makes no sense if fractional quantities can be bought. This has been fixed in dev-master now and will be part of the next release:
https://github.com/aimeos/aimeos-core/c ... 438724a34a
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, Image give us a star

Post Reply