Skip to content

Commit

Permalink
Set minimum qty 1 after cast to int
Browse files Browse the repository at this point in the history
  • Loading branch information
likemusic committed Mar 26, 2019
1 parent 677f1b6 commit d073b0c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?php
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
Expand Down Expand Up @@ -119,14 +119,12 @@ public function checkQuoteItemQty(StockItemInterface $stockItem, $qty, $summaryQ
$result->setItemIsQtyDecimal($stockItem->getIsQtyDecimal());
if (!$stockItem->getIsQtyDecimal()) {
$result->setHasQtyOptionUpdate(true);
$qty = (int) $qty;
$qty = (int) $qty ?: 1;
/**
* Adding stock data to quote item
*/
$result->setItemQty($qty);
$qty = $this->getNumber($qty);
$origQty = (int) $origQty;
$result->setOrigQty($origQty);
$result->setOrigQty((int)$this->getNumber($origQty) ?: 1);
}

if ($stockItem->getMinSaleQty() && $qty < $stockItem->getMinSaleQty()) {
Expand Down

0 comments on commit d073b0c

Please sign in to comment.