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

  • You added your mixins code in requirejs-config.js file, right? – Jaimin Sutariya Jul 23 '18 at 10:14
  • Yes............ – Mano M Jul 23 '18 at 10:15
  • why not remove label from admin cart rule. – kunj Jul 23 '18 at 10:21
  • I need this for discount calculation – Mano M Jul 23 '18 at 10:22
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, privacy policy and cookie policy

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