How to we can add upsell products on checkout cart page as crossell products in Magento 2.3.5 ?
Thanks
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityYou can show Upsell products on checkout page by add below code to checkout_index_index.xml
Try this code :-
app/design/frontend/YourVendorName/YourTheme/Magento_Checkout
<?xml version="1.0"?>
<page
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="content">
<block class="Magento\Checkout\Block\Cart\Upsell" name="checkout.cart.upsell" template="Magento_Catalog::product/list/items.phtml" after="-">
<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>
</referenceBlock>
</body>
</page>
After change you run command :-
php bin/magento c:c
php bin/magento c:f
THANKS.