0

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"/>

  • Update your catalog_product_view.xml code. – Rakesh Varma Oct 24 '18 at 13:54
0

try this

<move element="product.info.banner" destination="content" before="product.info.details"/>
  • Hi, with this solution i have the banner right before the title. Attached photo – Francesco Oct 24 '18 at 13:44
  • update your layout file code – Rakesh Varma Oct 24 '18 at 13:46
  • what do you mean? – Francesco Oct 24 '18 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 – Rakesh Varma Oct 24 '18 at 13:55
  • May be its css issue because its overlap on other text. do inspect element and check where div is created – Rakesh Varma Oct 24 '18 at 14:08
0

try this code :

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

After making changes clean your cache.

0

Solve, css issue:

Addedd

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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