1

I need to remove subtext of shipping in checkout summary here tried as below location enter image description here

/app/design/frontend/Vendor/theme-web/Magento_Checkout/web/js/view/summary/shipping.js

here I returning blank but still () is appearing. how to remove this

define(
    [
        'jquery',
        'Magento_Checkout/js/view/summary/abstract-total',
        'Magento_Checkout/js/model/quote'
    ],
    function ($, Component, quote) {
        return Component.extend({
            defaults: {
                template: 'Magento_Checkout/summary/shipping'
            },
            quoteIsVirtual: quote.isVirtual(),
            totals: quote.getTotals(),
            getShippingMethodTitle: function() {
                if (!this.isCalculated()) {
                    return '';
                }
                var shippingMethod = quote.shippingMethod();
                return shippingMethod ? '' : '';  //HERE Returning Blank***
            },
            isCalculated: function() {
                return this.totals() && this.isFullMode() && null != quote.shippingMethod();
            },
            getValue: function() {
                if (!this.isCalculated()) {
                    return this.notCalculatedMessage;
                }
                var price =  this.totals().shipping_amount;
                return this.getFormattedPrice(price);
            }
        });
    }
);

where am I doing wrong? Can I get help? Thank you in advance

4
  • clear cache and do static-content:deploy then it will come , but override core files to your local folder and do changes
    – User0434
    Jan 3, 2020 at 10:32
  • You need to remove it from web html file. Jan 3, 2020 at 10:34
  • Which Magento version you are using? Jan 3, 2020 at 10:41
  • Thank you @Dhaduk Mitesh for replaying. am using Magento 2.1.5 Jan 3, 2020 at 11:16

2 Answers 2

0

Override shipping.html in your theme.

<!-- ko if: quoteIsVirtual == 0 -->
    <tr class="totals shipping excl">
        <th class="mark" scope="row">
            <span class="label" data-bind="i18n: title"></span>
            <!-- <span class="value" data-bind="text: getShippingMethodTitle()"></span> -->
        </th>
        <td class="amount">
            <!-- ko if: isCalculated() -->
            <span class="price"
                  data-bind="text: getValue(), attr: {'data-th': title}"></span>
            <!-- /ko -->
            <!-- ko ifnot: isCalculated() -->
            <span class="not-calculated"
                  data-bind="text: getValue(), attr: {'data-th': title}"></span>
            <!-- /ko -->
        </td>
    </tr>
<!-- /ko -->

And comment span tag and then check it.

14
  • Thank you @Dhaduk Mitesh for replaying. am overriden file app/design/frontend/Vendor/theme-web/Magento_Checkout/web/template/summary/shipping.html. did static-content:deploy. But its still its same Jan 3, 2020 at 11:23
  • Have you comment value span tag? Jan 3, 2020 at 11:27
  • yes I commented. Jan 3, 2020 at 11:30
  • Check custom shipping.html is call or not. Jan 3, 2020 at 11:33
  • I Commented in vendor and overridden file both. according to path I think it is calling. app/design/frontend/Vendor/theme-web/Magento_Checkout/web/template/summary/shipping.html Jan 3, 2020 at 11:40
0

Here I found my answer by Overriding below file

app/design/frontend/Vendor/theme-web/Magento_Checkout/web/template/cart/totals/shipping.html

<th class="mark" colspan="1" scope="row" data-bind="text: title + ' (' + getShippingMethodTitle() + ')'"></th>

Replace this With

<th class="mark" colspan="1" scope="row">SHIPPING COST</th>

Your Answer

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

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