3

I want to change button text into the update cart.I have add into the my custom code but overriding is not working.please refer the my following code

vendor\magento\module-checkout\view\frontend\layout\checkout_cart_configure.xml

<?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">
<head>
    <link src="Magento_Checkout::js/view/configure/product-customer-data.js"/>
</head>
<update handle="catalog_product_view"/>
<body>
    <referenceBlock name="head.components">
        <block class="Magento\Framework\View\Element\Js\Components" name="checkout_cart_configure_head_components" template="Magento_Checkout::js/components.phtml"/>
    </referenceBlock>
    <referenceBlock name="product.info">
        <block class="Magento\Checkout\Block\Cart\Item\Configure" name="checkout.cart.item.configure.block"/>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Magento_Checkout::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
</body>

Into my custom module layout file

app\code\Vendor\Module\view\frontend\layout\checkout_cart_configure.xml

<?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="product.info.addtocart">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Cirklestudio_Customproduct::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Cirklestudio_Customproduct::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
</body>

app\code\Vendor\Module\view\frontend\templates\cart\item\configure\updatecart.phtml

<?php

echo "worked";

Please refer following screenshot: enter image description here

Please provide me the solution how to override them Thanks

  • what do you want to do, change the text of the button? – fmsthird Mar 28 at 8:00
  • I want to add a custom button – Hardik Makwana Mar 28 at 8:00
1

After Long time I am Get the Answer

app\code\Vendor\Module\view\frontend\layout\checkout_cart_configure.xml

    <body>
    <referenceBlock name="product.info.addtocart">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Zarathemes_Customproduct::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
    <referenceBlock name="product.info.addtocart.additional">
        <action method="setTemplate">
            <argument name="template" xsi:type="string">Zarathemes_Customproduct::cart/item/configure/updatecart.phtml</argument>
        </action>
    </referenceBlock>
</body>

app\code\Vendor\Module\view\frontend\templates\cart\item\configure\updatecart.phtml

echo "worked";
die;

After Please run the following commands:

php bin/magento setup:upgrade

php bin/magento setup:static-content:deploy -f

php bin/magento indexer:reindex

php bin/magento cache:clean

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.