5

Managing a product's inventory settings, if a product is set to Manage Stock = No then the option for Qty uses decimals is no longer visible. This does not make sense as you may want customers to order based on decimal quantities, but you don't want to manage stock for that product. If I sold dirt (a weird example, I know) I probably have a big pile of dirt that I just fill in a container and send to a customer. I don't need to manage inventory, but I still want to price per cubic foot and let them order non-whole values.

Indeed, if you disable stock management for that product, the setting for Qty uses decimals is still honored as the value is still saved to the product model even if the field isn't visible in the form (or if you inspect element and remove display: none).

Is there a reason why this option is not always visible? If I want stock management disabled but still want to use decimal quantities, are there any known side-effects of saving the value as mentioned?

1

Did you try in the frontend, whether you can insert a decimal quantity? The information about this is stored in the stock item, if you don't want to track the stock, everything is disabled.

But you are right, it doesn't make sense to disable this functionality - if this happens.

All the disable/show/hide stuff can be found in app/design/adminhtml/default/default/template/catalog/product/tab/inventory.phtml I would assume, you found a bug.

0

Go to vendor\magento\module-catalog-inventory\view\adminhtml\ui_component\product_form.xml and remove the line 335 : <item name="visible" xsi:type="string">${$.provider}:data.product.stock_data.manage_stock</item>

Tested in Magento 2.1.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.