0

I need to show my custom param in product detail page i am planning to create product attribute.Can i show that attribute in product detail page is that correct way?

3

Yes, thats correct way.

You can create attribute from admin and can call on product details page by layout:

ie: catalog_product_view.xml:

<block class="Magento\Catalog\Block\Product\View\Description" name="product.info.brand" template="product/view/attribute.phtml" >
    <arguments>
        <argument name="at_call" xsi:type="string">getAttributecode </argument>
        <argument name="at_code" xsi:type="string">attributecode</argument>
        <argument name="css_class" xsi:type="string">attributecode </argument>
        <argument name="at_label" xsi:type="string">none</argument>
        <argument name="add_attribute" xsi:type="string">itemprop="attributecode"</argument> <!-- For Scehema/rich-snipptes   -->
    </arguments>
</block>

example attribute: attributecode

0

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