1

i would like to create a banner on product view page and move this banner AFTER the short description and before the tab content.

product view page

I user this code under catalog_product_view.xml

<move element="product.info.banner" destination="content" after="product.info.description" />

but it's not working and i cannot resolve my problem. Can someone help me solving this problem? Best regards

The results should be the same in this pictureresult

TEST1:

gave me this resulttest1

EDIT2: My xml

<?xml version="1.0"?>

<referenceBlock name="product.info.review" remove="true"/>

<referenceContainer name="content">
  <container name="product.info.banner" htmlTag="div" htmlClass="product banner permuta">
    <block class="Magento\Catalog\Block\Product\View" name="product.banner_tradein" template="Magento_Catalog::banner_tradein.phtml">
      <arguments>
        <argument translate="true" name="title" xsi:type="string">BannerTradin</argument>
      </arguments>
    </block>
  </container>
</referenceContainer>

<referenceBlock name="product.info.details">

  <block class="Magento\Catalog\Block\Product\View" name="product.tab.condizioni" template="Magento_Catalog::condizioni.phtml" group="detailed_info">
    <arguments>
      <argument translate="true" name="title" xsi:type="string">Condizioni</argument>
    </arguments>
  </block>
</referenceBlock>

<referenceContainer name="product.info.extrahint">
  <referenceContainer name="product.info.social">
    <referenceBlock name="product.info.addto" remove="true"/>
    <referenceBlock name="product.info.mailto" remove="true"/>
  </referenceContainer>
</referenceContainer>

<referenceContainer name="product.info.stock.sku" remove="true"/>
<move element="product.info.banner" destination="content" as="banner_tradein" after="product.info.media" before="product.info.overview"/>

1
  • Update your catalog_product_view.xml code. Commented Oct 24, 2018 at 13:54

3 Answers 3

1

try this code :

<move element="product.info.banner" destination="product.info.details" after="product.info.description" />

After making changes clean your cache.

0

try this

<move element="product.info.banner" destination="content" before="product.info.details"/>
5
  • Hi, with this solution i have the banner right before the title. Attached photo
    – Francesco
    Commented Oct 24, 2018 at 13:44
  • update your layout file code Commented Oct 24, 2018 at 13:46
  • what do you mean?
    – Francesco
    Commented Oct 24, 2018 at 13:54
  • add your catalog_product_view.xml file code in question . I think you have already move other elements so this issue happens Commented Oct 24, 2018 at 13:55
  • May be its css issue because its overlap on other text. do inspect element and check where div is created Commented Oct 24, 2018 at 14:08
0

Solve, css issue:

Addedd

clear:both on div and the div has been put down the description

0

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.