If you need some specific shipping title change, then use the below method
For Ex. Priority Mail 1-Day instead of Priority Mail (2-3 Days)
Firstly, you need to add the following file.
1. Create file di.xml on app/code/Magemonkeys/UspsShipping/etc
<?xml version="1.0" ?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd"> <preference for="MagentoQuoteModelQuoteAddressRateResultMethod" type="MagemonkeysUspsShippingPluginModelQuoteAddressRateResultMethod" /> </config>
2. Create file Method.php on app/code/Magemonkeys/UspsShipping/Plugin/Model/Quote/Address/RateResult
<?php
namespace MagemonkeysUspsShippingPluginModelQuoteAddressRateResult;
class Method extends MagentoQuoteModelQuoteAddressRateResultMethod
{
public function setPrice($price)
{
if (strpos($this->getMethodTitle(), "Priority Mail 1-Day") !== false) {
$this->setMethodTitle("Priority Mail (2-3 Days)");
}
$this->setData('price', $this->priceCurrency->round($price));
return $this;
}
} ?>


