In Magento 1, we can directly add the breadcrumb in checkout page using XML.
But in Magento 2 there are some changes to add the breadcrumb
1. Copy the checkout_cart_index.xml file in your theme. And then write code in body tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
<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> <item name="link" xsi:type="string">/checkout/cart</item> </argument> </action> </referenceBlock> |
Now Refresh the page and check
To make texts translatable, you can add translate=”true” to title and label tags.
Thank Jaime for your feedback.
I will update your suggestion in blog soon.
Thank you, It works on me!!! Thanks again