8

I want to add breadcrumbs to the shopping cart page before the page title like this:

enter image description here

How can I achieve this.?

Thanks..!

2 Answers 2

16

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"?> <!-- /** * Copyright © 2013-2017 Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ --> <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> 
0
6

Overwrite in ur 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 & add

<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> 
1
  • Thanks for your answer. Your answer is much better than accepted answer and it resolves my issue. Commented Feb 27, 2018 at 6:53

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.