0

How to add up-sells block in to cart page for every item?

I have added in checkout_cart_index.xml.

<block class="Magento\Catalog\Block\Product\ProductList\Upsell" name="product.info.upsell" template="Magento_Catalog::product/list/items.phtml">
            <arguments>
                <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>

After that I have called this block in to Magento_Checkout\templates\cart\item\default.phtml but up-sells product not showing can any one tell best to display up-sells product in cart page for every item after additional info ?

  • Have you mapped up-sell products for the product level from Magento Admin? – Shailesh Katarmal Mar 19 at 14:20
  • in admin i have added up-sells products it showing in product page but i tried add same code in to cart page not showing – Pawankumar Mar 19 at 15:20
  • @ShaileshKatarmal can you tell me – Pawankumar Mar 19 at 15:28

Your Answer

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

Browse other questions tagged or ask your own question.