TransWikia.com

Add Upsell Product On Checkout Cart Page -Magento 2.3

Magento Asked by Wajahat - Banyo on November 25, 2021

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

Thanks

One Answer

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="MagentoCheckoutBlockCartUpsell" name="checkout.cart.upsell" template="Magento_Catalog::product/list/items.phtml" after="-">
                <arguments>
                    <argument name="type" xsi:type="string">upsell</argument>
                </arguments>
                <block class="MagentoCatalogBlockProductProductListItemContainer" name="upsell.product.addto" as="addto">
                    <block class="MagentoCatalogBlockProductProductListItemAddToCompare"
                           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.

Answered by Mohit Patel on November 25, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP