/** @var \Magento\Framework\DataObject $request */
                           $request = $this->dataFactory->create();
                           $request->setData('qty', (int)$qty)
                           $quote->addProduct($product, $request);

I have added the products to quote using the above code. But this merges the row qty for same SKU (as it supposes to).

How to create 2 different item-lines for the same SKU?

2 Answers 2


You can customize method Magento\Quote\Model\Quote\Item::representProduct() to return false if the product SKU matches your criteria.

Reference post: Magento 2: How to Prevent item's quantity from being added


All you need is to create the item object BEFORE adding it to the quote, instead of directly adding the product to the quote and letting Magento create the item.

/** @var \Magento\Quote\Model\Quote\Item $quoteItem */
$quoteItem = $this->itemFactory->create();

Original post link: https://magento.stackexchange.com/a/324605/54929

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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