Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Qty Uses Decimals" doesn't work for simple product #774

Closed
smoskaluk opened this issue Mar 27, 2018 · 5 comments
Closed

"Qty Uses Decimals" doesn't work for simple product #774

smoskaluk opened this issue Mar 27, 2018 · 5 comments

Comments

@smoskaluk
Copy link

Preconditions

  1. Magento MSI
  2. Simple product created

Steps to reproduce

  1. In "Advanced Inventory" enable "Qty Use Decimals" for your simple product
  2. Go to home page and open simple product page
  3. Try to add to cart simple product with qty 1.23

Expected result

  1. Product should be added to the cart

Actual result

  1. Error message: The requested qty is not a valid increment
    image
@smoskaluk smoskaluk added this to the MSI Part I milestone Mar 27, 2018
@nmalevanec nmalevanec self-assigned this Mar 27, 2018
@OlgaBurtyka OlgaBurtyka self-assigned this Apr 5, 2018
@OlgaBurtyka
Copy link

I see some other error
screenshot_20180405_140551

@maghamed
Copy link
Contributor

We have next code

        /**
         * Check quantity type
         */
        $result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal());
        if (!$stockItem->getIsQtyDecimal()) {
            $result->setHasQtyOptionUpdate(true);
            $qty = intval($qty);
            /**
             * Adding stock data to quote item
             */
            $result->setItemQty($qty);
            $qty = $this->getNumber($qty);
            $origQty = intval($origQty);
            $result->setOrigQty($origQty);
        }

In legacy implementation
\Magento\CatalogInventory\Model\StockStateProvider::checkQuoteItemQty

This case is not covered in MSI

@OlgaBurtyka
Copy link

I did some changes in commit, which allow save decimal qty_increment in configuration. But it's not all. There in many places exist issue regarding decimal. For example on admin in product page we can save decimal increment, but if one edit product page after re-save we will 0 in field(qty_increment);
export 7
export 8
export 9
export 10

@phoenix128
Copy link
Contributor

Fixed in core branch due to code freeze: magento/magento2#14806

@naydav
Copy link

naydav commented Apr 30, 2018

Closed due to magento#14806

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants