can we change Tax text to other text like "US 6% Sales Tax", in the checkout,

enter image description here


It is easy way to follow step and change your text :-

First this file override your theme checkout_cart_index.xml and change your text


<?xml version="1.0"?>
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
        <referenceBlock name="checkout.cart.totals">
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="block-totals" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="tax" xsi:type="array">
                                    <item name="component" xsi:type="string">Magento_Tax/js/view/checkout/cart/totals/tax</item>
                                    <item name="config" xsi:type="array">
                                        <item name="template" xsi:type="string">Magento_Tax/checkout/cart/totals/tax</item>
                                        <item name="title" xsi:type="string" translate="true">US 6% Sales Tax</item>

After you change run below command :-

php bin/magento s:up
php bin/magento s:s:d -f
php bin/magento c:c
php bin/magento c:f

And Check Output :-

enter image description here



Find file


And find this code

<?php else: ?>
        <?php echo $this->getTotal()->getTitle() ?>
<?php endif;?>

I just commented out the echo part.... and replaced with "Your word".

I know this is not correct way but your work will be done.


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.