0

How to remove the line below

<span class="discount coupon" data-bind="text: getCouponLabel()"></span>

in Magento_SalesRule/cart/totals/discount.html

var config = {
    'config': {
        'mixins': {                
            'Magento_SalesRule/js/view/cart/totals/discount': {
                'XXX_YYY/js/view/cart/totals/discount': true

            },
        }}};

define([
    'Magento_Checkout/js/view/summary/abstract-total',
    'Magento_Checkout/js/model/quote'
], function (Component, quote) {
    'use strict';alert("cart");

    return function (target) {
        return target.extend({
            defaults: {
                template: 'XXX_YYY/cart/totals/discount'
            }});
    }
});

And remove the line in this template, But I can not get the template in UI

4
  • You added your mixins code in requirejs-config.js file, right? Commented Jul 23, 2018 at 10:14
  • Yes............
    – Mahi M
    Commented Jul 23, 2018 at 10:15
  • why not remove label from admin cart rule.
    – kunj
    Commented Jul 23, 2018 at 10:21
  • I need this for discount calculation
    – Mahi M
    Commented Jul 23, 2018 at 10:22

1 Answer 1

1

Override your discount.html file

open & copy file `vendor/magento/module-sales-rule/view/frontend/web/template/cart/totals/discount.html

Then put file here

app/design/frontend/Magento_SalesRule/web/template/cart/totals/discount.html

Remove condition in discount.html file

<!-- ko if: isDisplayed() --> 
<!-- /ko -->

Your discount.html file code look like.

 <!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<tr class="totals">
    <th colspan="1" style="" class="mark" scope="row">
        <span class="title" data-bind="text: title"></span>
    </th>
    <td class="amount" data-bind="attr: {'data-th': title}">
        <span><span class="price" data-bind="text: getValue()"></span></span>
    </td>
</tr>

Note : Please check discount file is not override any where

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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