0

Tell me how can I remove the word "Discount" and parentheses from the label

3
1

Create a folder in your theme "i18n" and add en_US.csv , with the help of en_US.csv you can change "Discount" string to another string, it's one of the easiest method.

3
  • This is proper way than overiding the file
    – Asssd
    Oct 14 '21 at 13:19
  • It doesn`t work for me( Oct 14 '21 at 15:44
  • It`s work but need to change "Discount (%1)" Oct 18 '21 at 14:40
0

Override this file in your theme or module:

vendor/magento/module-sales-rule/view/frontend/web/template/summary/discount.html

And paste this content. You might need to add some css to make it visible.

<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<!-- ko if: isDisplayed() -->
<tr class="totals discount">
    <th class="mark" scope="row">
     <!-- add css display: block; if your theme extends from luma -->
        <span class="discount coupon" data-bind="text: getCouponCode()"></span>
    </th>
    <td class="amount">
        <span class="price" data-bind="text: getValue(), attr: {'data-th': name}"></span>
    </td>
</tr>
<!-- /ko -->
2
  • This method remove all title I need to remove only "Discount " word Oct 14 '21 at 14:53
  • See the class span tag having class "discount coupon". This is set to display:none; You to need add css to make it display: block; You will get the desired result. Oct 15 '21 at 15:11

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.