Friday, October 21, 2011

Change shipment title based on country

Change shipment title based on country


For example :



We want to get shipment text as follows
Netherlands: TNT02

Belgium: TAX02

Others: DHL01

Go to
/app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php
Find
$address->setShippingDescription($rate->getCarrierTitle().' - '.$rate->getMethodTitle());
Replace with
if($address->getCountry()=='NL')
                                       {
                           $address->setShippingDescription('TNT02');
                                       }
                                       elseif($address->getCountry()=='BE')
                                       {
                                               $address->setShippingDescription('TAX02');
                                       }
                                       else
                                       {
                                               $address->setShippingDescription($rate->getMethodTitle());
                                       }

No comments:

Post a Comment