How to add product attribute value in minicart magento 2
How to add product attribute value in minicart magento 2? First need to do is create a plugin so add plugin at di.xml at first. di.xml <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceschemalocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <type name="Magento\Checkout\CustomerData\DefaultItem"> <plugin disabled="false" name="AddAttPlug" sortorder="10" type="Your\Module\Plugin\DefaultItem"> </plugin></type> </config> Now create a plugin class and below line of code. Default.php <?php namespace Your\Module\Plugin; use Magento\Quote\Model\Quote\Item; class DefaultItem { public function aroundGetItemData($subject, \Closure $proceed, Item $item) { $data = $proceed($item); $product = $item->getProduct(); $atts = [ "product_weight" => $product->ge...