In Magento 1,It is very easy to override the Template. We are directly add the the code in .xml file. Now You think What happen in Magento 2.
So Don’t worry.
We can also do this thing in Magento 2,
Let’s see how we can do this.
1) Copy the .xml file in the theme which you want to override.
If we want to overwirte the checkout_cart_index.xml
Write this code to override template file
1 2 3 4 5 6 7 8 9 10 |
<?xml version="1.0"?> <page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="../../../../../../../lib/internal/Magento/Framework/View/Layout/etc/page_configuration.xsd"> <body> <referenceBlock name="checkout.cart"> <action method="setTemplate"> <argument name="template" xsi:type="string">Webmull_Templateoverride::cart.phtml</argument> </action> </referenceBlock> </body> </page> |
Now check, your cart.phtml file called from your theme.
Hi Team,
Hope you are doing well,
How can i override the cart item template.Like I want to use own template instead of the Magento_Checkout::cart/item/default.phtml
Thanks
Didn’t worked for me