How to display only "Shipping" text instead of "Shipping(Flat Rate - Fixed)" text in Cart, Checkout and Emails.

enter image description here

4 Answers 4


The string "Flat Rate - Fixed" is generated based on the shipping method configuration in \Magento\Checkout\Model\Type\Onepage::saveShippingMethod():

$shippingDescription = $rate->getCarrierTitle() . ' - ' . $rate->getMethodTitle();
$shippingAddress->setShippingDescription(trim($shippingDescription, ' -'));

Later, it is appended to "Shipping" in \Magento\Quote\Model\ResourceModel\Quote\Address\Attribute\Frontend\Shipping::fetchTotals():

$title = __('Shipping & Handling');
if ($address->getShippingDescription()) {
    $title .= sprintf(' (%s)', $address->getShippingDescription());

As you can see, if getShippingDescription() is empty, nothing is added (i.e. no empty brackets), so you can get your desired result by unsetting the shipping description.


This can be done in several places, IMHO the best option is to do it right before the shipping address is saved:

  • using the event sales_quote_address_save_before OR
  • using a "before" plugin for \Magento\Quote\Model\Quote\Address::save()


<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
    <type name="Magento\OfflineShipping\Model\Carrier\Freeshipping">
        <plugin name="disable-freeshipping" type="Vendor\Module\Model\Carrier\Freeshipping" sortOrder="1" />



namespace Vendor\Module\Model\Carrier;

class Freeshipping
    protected $tablerate;

    protected $_resultMethodFactory;

    protected $_rateResultFactory;

    public function __construct(
        \Magento\OfflineShipping\Model\Carrier\Tablerate $tablerate,
        \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $resultMethodFactory,
        \Magento\Shipping\Model\Rate\ResultFactory $rateResultFactory,
        \Magento\CatalogInventory\Model\StockRegistry $stockRegistry
    ) {
        $this->tablerate = $tablerate;
        $this->_rateResultFactory = $rateResultFactory;
        $this->_resultMethodFactory = $resultMethodFactory;
        $this->stockRegistry = $stockRegistry;

    public function aroundCollectRates(\Magento\OfflineShipping\Model\Carrier\Freeshipping $freeshipping, \Closure $proceed, $request)
        // $resTableRate = $this->tablerate->collectRates($request);
        // foreach ($resTableRate->getAllRates() as $rate) {
        //     if ($rate->getMethod()) {
        //          return false;
        //     }
        // }

        if ($request->getAllItems()) {
            $items = $request->getAllItems();
            $yourSkus = array('your sku');
            $isExist = false;
            foreach ($items as $key => $item) {
                if(in_array($item->getSku(),$yourSkus)) {
                    $isExist = true;
                    $normalItemCheck = false;

            $title = '';
            $name ='';
            if($isExist) {
                $title ='Free Shipping';
                $name ='Item will ship (10-14 days)';

            if($name != '' || $title != '') {
                $result = $this->_rateResultFactory->create();
                $method = $this->_resultMethodFactory->create();



                return $result;
        return $proceed($request);

There are several options for changing the visible text. Here are two clear options.

  • Magento's translation system. I will direct you to the M2 Developer Documentation. Essentially, you will create a .csv file in a special location. This will let you make statements like "Shipping (Flat Rate - Fixed)","Shipping", instructing Magento to replace every occurrence of the left string with the right string.

  • In your theme, override the .phtml template that contains the string. Again, I will direct you to Magento's M2 documentation on adding templates to your theme. Once you have a working theme, if you include a .phtml at the correct location, Magento will use your template instead of the parent theme's template.

  • 1
    While this is true for most texts in Magento, here it does not work. These values are built dynamically in the shipping carrier models (the implementations of \Magento\Shipping\Model\Carrier\AbstractCarrierInterface::collectRates()), based on the configured carrier title ("Flat Rate") and method title ("Fixed"). There is no translation involved and no template contains the string. Feb 17, 2017 at 9:10

1. vendor/module/etc/di.xml

<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../../lib/internal/Magento/Framework/ObjectManager/etc/config.xsd">
    <type name="Magento\OfflineShipping\Model\Carrier\Freeshipping">
        <plugin name="shipping_title_update" type="vendor\module\Plugin\FreeShipping"/>

2. vendor\module\Plugin\FreeShipping.php

namespace vendor\module\Plugin;

use Magento\OfflineShipping\Model\Carrier\Freeshipping as OriginalFreeShipping;
use Magento\Checkout\Model\Session;

class FreeShipping
    /** @var Session|\Magento\Backend\Model\Session\Quote */
    protected $session;

     * FreeShipping constructor.
     * @param Session                              $checkoutSession
     * @param \Magento\Backend\Model\Session\Quote $backendQuoteSession
     * @param \Magento\Framework\App\State         $state
     * @param \Magento\Customer\Model\Session      $customerSession
     * @throws \Magento\Framework\Exception\LocalizedException
    public function __construct(
        Session $checkoutSession,
        \Magento\Backend\Model\Session\Quote $backendQuoteSession,
        \Magento\Framework\App\State $state,
        \Magento\Customer\Model\Session $customerSession
    ) {
        if ($state->getAreaCode() == \Magento\Framework\App\Area::AREA_ADMINHTML) {
            $this->session = $backendQuoteSession;
        } else {
            $this->session = $checkoutSession;

     * @param OriginalFreeShipping $subject
     * @param callable             $proceed
     * @param                      $field
     * @return float
    public function aroundGetConfigData(OriginalFreeShipping $subject, callable $proceed, $field)
        $value = $proceed($field);
        if ($field == 'title') {
            $value ='Method Title ';

        if ($field == 'name') {
            $value ='method Name ';
        return $value;

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.