👉Hello magento friends today's i'm share with you to how to add breadcrumbs to checkout cart page in Magento
👉 Friends mine case I want to show breadcrumbs to the shopping cart page before the page title like this :
if uou are used magento2 default theme to select first step :
Method 1) : Firstly Create a file app/design/frontend/vendor/theme/Magento_Checkout/layout/checkout_cart_index.xml
and add following code in checkout_cart_index.xml file
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceBlock name="breadcrumbs">
<action method="addCrumb">
<argument name="crumbName" xsi:type="string">Home</argument>
<argument name="crumbInfo" xsi:type="array">
<item name="title" xsi:type="string">Home</item>
<item name="label" xsi:type="string">Home</item>
<item name="link" xsi:type="string">/</item>
</argument>
</action>
<action method="addCrumb">
<argument name="crumbName" xsi:type="string">Shopping Cart</argument>
<argument name="crumbInfo" xsi:type="array">
<item name="title" xsi:type="string">Shopping Cart</item>
<item name="label" xsi:type="string">Shopping Cart</item>
</argument>
</action>
</referenceBlock>
</body>
</page>
if uou are used magento2 custom theme to select first Method 2:
👉 Overwrite in your custom theme magento\vendor\magento\module-checkout\view\frontend\layout\checkout_cart_index.xml
to
👉 magento\app\design\frontend\<Vendor>\<Theme_Name>\Magento_Checkout\layout\checkout_cart_index.xml
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<update handle="checkout_cart_item_renderers"/>
<body>
<referenceBlock name="page.main.title" display="true"> // True/False
<action method="setPageTitle">
<argument name="title" translate="true" xsi:type="string">Shopping Cart</argument>
</action>
</referenceBlock>
<referenceBlock name="breadcrumbs">
<action method="addCrumb">
<argument name="crumbName" xsi:type="string">Home</argument>
<argument name="crumbInfo" xsi:type="array">
<item name="title" xsi:type="string">Home</item>
<item name="label" xsi:type="string">Home</item>
<item name="link" xsi:type="string">{{baseUrl}}</item>
</argument>
</action>
<action method="addCrumb">
<argument name="crumbName" xsi:type="string">Shopping Cart</argument>
<argument name="crumbInfo" xsi:type="array">
<item name="title" xsi:type="string">Shopping Cart</item>
<item name="label" xsi:type="string">Shopping Cart</item>
</argument>
</action>
</referenceBlock>
</body>
</page>