Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions Model/Dibs/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -212,11 +212,13 @@ public function addItems($items)
$qty = $qty*$parentQty; //parentQty will be != 1 only for quote, when item qty need to be multiplied with parent qty (for bundle)
}

$sku = $item->getSku();
//make sku unique (sku could not be unique when we have product with options)
if (isset($this->_cart[$sku])) {
$sku = $sku . '-' . $item->getId();
// Always suffix it with quote_item_id to support partial invoice
$quoteId = $item->getId();
if ($item instanceof \Magento\Sales\Model\Order\Invoice\Item ||
$item instanceof \Magento\Sales\Model\Order\Creditmemo\Item) {
$quoteId = $item->getOrderItem()->getQuoteItemId();
}
$sku = $item->getSku() . '-' . $quoteId;

$unitPrice = $addPrices ? $this->addZeroes($item->getPriceInclTax()) : 0;
$unitPriceExclTax = $addPrices ? $this->addZeroes($item->getPrice()) : 0;
Expand Down