Magento 2 Mini Cart – Display ‘Not Visible Individually’ for Simple Product

magento2mini-cart

I want to display not visible individually simple products in the mini cart section.

This product displays inside the cart page, but it doesn't display inside the top minicart section.

Best Answer

You need to override

magento2\vendor\magento\module-checkout\CustomerData\Cart.php

Find getRecentItems() function replace

if (!isset($products[$productId])) {
    continue;
}

with

if (!isset($products[$productId])) {   
    $items[] =  $this->itemPoolInterface->getItemData($item);  
    continue;
  }

Please let me know above code not work.

Related Topic