1. If you want to remove the upsell products from product details page.
Open Your theme catalog_product_view.xml and add the following code.
File location:
app/design/frontend/Vendor/Theme/Magento_Catalog/layout/catalog_product_view.xml
<referenceBlock name="product.info.upsell" remove="true"/>
2. Add upsell product block under Tab section.
<referenceBlock name="product.info.details"> <block class="Magento\Catalog\Block\Product\ProductList\Upsell" template="Magento_Catalog::product/list/items.phtml" name="upsell.tab" as="upselltab" group="detailed_info" > <arguments> <argument translate="true" name="title" xsi:type="string">Upsell</argument> <argument name="type" xsi:type="string">upsell</argument> </arguments> <block class="Magento\Catalog\Block\Product\ProductList\Item\Container" name="upsell.product.addto" as="addto"> <block class="Magento\Catalog\Block\Product\ProductList\Item\AddTo\Compare" name="upsell.product.addto.compare" as="compare" template="Magento_Catalog::product/list/addto/compare.phtml"/> </block> </block> </referenceBlock>
0 Comments