cancel
Showing results for 
Search instead for 
Did you mean: 

Override Magento_Checkout template

Override Magento_Checkout template

Hello, I'm trying to override Magento_Checkout default.phtml template with a custom template. I'm creating new module. CustomCheckout and giving the custom template path and block.

But i'm still rendering the default template. This is my html: 

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceBlock name="checkout.cart.item.renderers">
<block class="Auxionize\CustomCheckout\Block\Cart\Item\Renderer" as="default" template="Auxionize_CustomCheckout::cart/item/default.phtml">
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.default.actions" as="actions">
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.default.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.default.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
</block>
</block>
<block class="Auxionize\CustomCheckout\Block\Cart\Item\Renderer" as="simple" template="Auxionize_CustomCheckout::cart/item/default.phtml">
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions" name="checkout.cart.item.renderers.simple.actions" as="actions">
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Edit" name="checkout.cart.item.renderers.simple.actions.edit" template="Magento_Checkout::cart/item/renderer/actions/edit.phtml"/>
<block class="Magento\Checkout\Block\Cart\Item\Renderer\Actions\Remove" name="checkout.cart.item.renderers.simple.actions.remove" template="Magento_Checkout::cart/item/renderer/actions/remove.phtml"/>
</block>
</block>
</referenceBlock>
</body>
</page>
2 REPLIES

Re: Override Magento_Checkout template

maybe you should add <referenceBlock name="checkout.cart.item.renderers" remove="true"> 
to remove default checkout block and then create new one with the <block> one 

Re: Override Magento_Checkout template

Hello,

 

Could you please first all make sure with following stuff.

 

1) Make sure that you extension should in list while bin/magento setup:upgrade

2) Remove all folders from var and except .htacess

3) Remove all folder pub/static/

4) Your extension should be developed in app/code/

 

Thanks

Sam