1
  • How Add after/before positioning in pre existing xml block

  • How to upsell block move before product.info.details block

    <block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.upsellslider" template="Magento_Catalog::product/list/upsell.phtml">  
          <arguments>
              <argument name="type" xsi:type="string">upsell</argument>
         </arguments>
    </block>
    
1

put below line after product.info.details

<move element="<blockName>" destination="<DestinationName>" after="product.info.details"/>

You have to put above line after product.info.details block/container will be generated else it will not find that block.

1

Now add your upsell block before="product.info.details"

  <block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.upsellslider" before="product.info.details" template="Magento_Catalog::product/list/upsell.phtml">
    <arguments>
        <argument name="type" xsi:type="string">upsell</argument>
    </arguments>
  </block>               

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.