DEV Community

Paboda Hettiarachchi
Paboda Hettiarachchi

Posted on

Show custom product attribute in quote item

In order to make a custom product attribute available in quote item: Vendor/Module/etc/catalog_attributes.xml

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd">
    <group name="quote_item">
        <attribute name="vat_eligibility_count"/>
    </group>
</config>
Enter fullscreen mode Exit fullscreen mode

You will be able to get the attribute value as the following:
$quoteItem->getProduct()->getValEligibilityCount()

Top comments (0)