0

I tried different xml code but unable to achieve. I am getting attribute value using below code, but above the sku, I want to place it in the short description block after it's content.

    <referenceContainer name="product.info.price">
        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.brand" template="product/view/brand_info.phtml" before ="-">
        <arguments>
        <argument name="at_call" xsi:type="string">getBrand</argument>
        <argument name="at_code" xsi:type="string">manufacturer</argument>
        <argument name="css_class" xsi:type="string">brand</argument>
        <argument name="at_label" xsi:type="string">default</argument>
        <argument name="add_attribute" xsi:type="string">itemprop="manufacturer"</argument>
        </arguments>
        </block>
    </referenceContainer>

block image

1 Answer 1

1

product.info.overview - is the short description block

product.info.brand - your block, and you should move it after the overview

For example:

view/frontend/layout/catalog_product_view.xml

<move element="product.info.brand" destination="product.info.main" after="product.info.overview" />

or change it directly in your xml

 <referenceContainer name="product.info.main">
        <block class="Magento\Catalog\Block\Product\View\Description" name="product.info.brand" template="product/view/brand_info.phtml" after ="product.info.overview">
            <arguments>
                <argument name="at_call" xsi:type="string">getBrand</argument>
                <argument name="at_code" xsi:type="string">manufacturer</argument>
                <argument name="css_class" xsi:type="string">brand</argument>
                <argument name="at_label" xsi:type="string">default</argument>
                <argument name="add_attribute" xsi:type="string">itemprop="manufacturer"</argument>
            </arguments>
        </block>
    </referenceContainer>
1
  • :D thanks man, actually I am a newbie Jun 25, 2020 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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