Question

I am building a site for a client who sells fabric. She'd like to allow her customers to order in decimals. Does anyone know if this is possible?

Was it helpful?

Solution

Magento already supports this. All you have to do is to set in the 'Inventory' the field 'Qty Uses Decimals' to 'Yes'. You can also set the increments in decimal if you want to sell in qty like 1.3, 2.6, 3.9, ....

I had an issue in the past with qty increments an decimal qty. In Mage_CatalogInventory_Model_Stock_Item::suggestQty() there is this line:

$qtyIncrements = (int)$this->getQtyIncrements(); // Currently only integer increments supported

I just removed the cast to int and it worked without problems with decimal increments also.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top