If you want to display brand attribute value in the product view page, You can use the following code:
1 2 3 4 5 6 7 8 9 10 11 |
<referenceContainer name="product.info.main"> <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.brand" template="product/view/attribute.phtml" before="-"> <arguments> <argument name="at_call" xsi:type="string">getBrand</argument> <argument name="at_code" xsi:type="string">brand</argument> <argument name="css_class" xsi:type="string">brand</argument> <argument name="at_label" xsi:type="string">none</argument> <argument name="add_attribute" xsi:type="string">itemprop="brand"</argument> </arguments> </block> </referenceContainer> |
Also If you need to display text before this attribute value in the product page something like:
Brand: Apple
For that you need to change ‘none’ to ‘default’ as shown below in ‘at_label’ :
From:
1 |
<argument name="at_label" xsi:type="string">none</argument> |
To:
1 |
<argument name="at_label" xsi:type="string">default</argument> |
Now you can see product attribute value with it’s label in the product page.
[crayon-63d3e371167e2886851247/] Using above fucntion Images can be imported directly from...
Override view block using di.xml and add the below code...
You can check a list of called layout XML for...
Follow the below steps to install and set up PWA...
If you want to remove all leading zero's from order,...
Let our Magento expert connect to discuss your requirement.
We offer Magento
certified developers.
Our Magento clientele
is 500+.
We sign NDA for the
security of your projects.
We’ve performed 100+
Magento migration projects.
Free quotation
on your project.
Three months warranty on
code developed by us.