0

I'm trying to setup shipping method aliases for the checkout process.

for example for USPS, instead of the end-user seeing

"Priority Mail 1-Day Small Flat Rate Box"

I'd like to display

"Standard Ground"

thanks

1

Another possible solution would be overriding the template file:

in case of the rwd (Magento 1.9.0.1) you can find it here : app/design/frontend/base/default/template/checkout/onepage/shipping_method/available.phtml

Around line 58 you can find following code:

<label for="s_method_<?php echo $_rate->getCode() ?>"><?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>

the important part of it is :

<?php echo $this->escapeHtml($_rate->getMethodTitle()) ?>

Now you can replace it with your logic for example :

<?php if($_rate->getMethodTitle() == 'blalalalala'): ?>
 <?php echo 'yourName'; ?>
<?php endif; ?>

Hope my answer helped you.

|improve this answer|||||
  • this worked . thank you. I did add <?php else : echo $this->escapeHtml($_rate->getMethodTitle()) ?> – provence shop Sep 12 '14 at 17:43
  • For a cleaner solution, use Magento's built in translation functionality and add the translation to your translation file, e.g: <?php echo $this->__($this->escapeHtml($_rate->getMethodTitle())) ?> – Louis B. Aug 22 '17 at 14:09
2

Looking through the USPS code it appears that all the titles are passed through the Magento translation tool. If this is the case you should be able to simply add them to your theme's translation file. This will save you having to edit any code or templates to change the title of the method.

|improve this answer|||||
2

Just update it in the locale file, you can change any text like this.

Zero code.

|improve this answer|||||
0

Goto and copy app/code/core/Mage/Checkout/Block/Onepage/Progress.php copy to

app/code/local/Mage/Checkout/Block/Onepage/Progress.php

And edit function

 public function getShippingDescription()
    {
      if($this->getQuote()->getShippingAddress()->getShippingMethod()=='flatrate_flatrate'){ 
return "MY Flat rate";

  }
 // this type of condition here
        return $this->getQuote()->getShippingAddress()->getShippingDescription();
    }
|improve this answer|||||

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.