0

How to we can add upsell products on checkout cart page as crossell products in Magento 2.3.5 ?

Thanks

1 Answer 1

1

You 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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