Magento2: Decimal Qty Increments not working correctly

Created on 3 Feb 2017  路  8Comments  路  Source: magento/magento2


Preconditions


  1. Magento 2.1.3
  2. PHP 7.0.8 & MySQL 5.6.31-0ubuntu0.14.04.2

Steps to reproduce

  1. Add number with decimals as qty increment.
  2. (Use quantity decimals should be set "Yes").
  3. 3.

Expected result

  1. Product advanced inventory form in admin panel quantity should so as decimal and not int
  2. Frontend should show qty increment as decimal

Actual result

  1. Advance inventory form shows qty incerement as int
  2. Qty increment shows as int on frontend

This happens because on line 403 of Magento\CatalogInventory\Model\Stock\Item
the qty increment is converted to integer.
image

Catalog Cannot Reproduce Format is valid bug report

Most helpful comment

@magento-engcom-team

I can confirm that there is a continued issue for "Qty Increment" client-side validation. Please see below.

Preconditions

  • Magento 2.2
  • PHP 7.0.22
  • Ubuntu 16.04.3 LTS

Steps to Reproduce

  • Admin Panel: "Products" -> "Add Product"
  • Open "Advanced Inventory" dialog
  • Set "Qty Uses Decimals" to "Yes"
  • Set "Enable Qty Increments" to "Yes"
  • Enter a "Qty Increments" value containing a decimal value (i.e. 12.5)

Expected Result

  • Form submission will continue as normal
  • User will be able to finish product creation
  • Product will be created
  • Product will use decimal "Qty Increments" value as specified during creation.

Actual Result

  • Client-side validation is triggered by the inputting of a . character into the "Qty Increments" field
  • Form submission is prevented due to client-side validation failure
  • User cannot create product with decimal value for "Qty Increments" field.

All 8 comments

Is there any news about this issue yet?

@PiimegaOy, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@PiimegaOy, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.
We tested the issue on 2.3.0-dev, 2.2.0, 2.1.9

@magento-engcom-team

I can confirm that there is a continued issue for "Qty Increment" client-side validation. Please see below.

Preconditions

  • Magento 2.2
  • PHP 7.0.22
  • Ubuntu 16.04.3 LTS

Steps to Reproduce

  • Admin Panel: "Products" -> "Add Product"
  • Open "Advanced Inventory" dialog
  • Set "Qty Uses Decimals" to "Yes"
  • Set "Enable Qty Increments" to "Yes"
  • Enter a "Qty Increments" value containing a decimal value (i.e. 12.5)

Expected Result

  • Form submission will continue as normal
  • User will be able to finish product creation
  • Product will be created
  • Product will use decimal "Qty Increments" value as specified during creation.

Actual Result

  • Client-side validation is triggered by the inputting of a . character into the "Qty Increments" field
  • Form submission is prevented due to client-side validation failure
  • User cannot create product with decimal value for "Qty Increments" field.

@magento-engcom-team

Can confirm the issue:
Magento 2.1.9
PHP 7.0.24
Debian Jessie

I have also added a quantity button using the tutorial https://magenticians.com/quantity-increment-decrement-magento-2/ . I think here you can find the solution of your query as before starting i have a default product text field and now i have a quantity button to increment and decrement.

I can confirm this problem still exists on Magento version 2.2.3

#12914 falls in line with this bug, and is the second part of it.

Was this page helpful?
0 / 5 - 0 ratings