Tuesday, 5 March 2019

How to get (cart) items programatically shows duplicate SKUs for both the configurable and simple product in magento


As you have using getAllItems() then on for loop you need to check is it has parent item $item->getParentItemId().

foreach ($cart->getAllItems() as $item) {
    / * add this */
    if ($item->getParentItemId()) {
        continue;
    }
........
}

No comments:

Post a Comment