3

I am using matrixrates for shipping methods for my store. For some methods I have the same name but different prices, like "Standard" for above $350 and "Standard" for below $350. So programmatically I have distinct these two by putting ":2" with the below rate. so it becomes "Standard:2" I have successfully modified the front and backend to display "Standard" for both rates but in email send to customer "Standard:2" is sending. So I goes to the code deeply. New order email template is in locale/template/emai/sales/new_order.html, and for shipping details this function is used.

{{var order.getShippingDescription()}}

I found this function in Core/Mage/Checkout/Block/Onepage/Progress.php. But by changing the return value, does not effect the shipping description in email. I am wondering where this function getShippingDescription() is so I can modify it.

3

Actually this is a string saved to object not actual value that you can depend on. Best bet would be to alter the shipping method code to use different label on different rate directly.

you can see where it is genreated and set in code

grep '>setShippingDescription' app/code -rsn
app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php:320:        $this->getQuote()->getShippingAddress()->setShippingDescription($order->getShippingDescription());
app/code/core/Mage/GoogleCheckout/Model/Api/Xml/Callback.php:696:                ->setShippingDescription($shipping['shipping-name']['VALUE']);
app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php:169:                    $address->setShippingDescription(trim($shippingDescription, ' -'));
app/code/core/Mage/Sales/Model/Quote/Address.php:824:                ->setShippingDescription('');
  • Thanks, I am able to change it here app/code/core/Mage/Sales/Model/Quote/Address/Total/Shipping.php:169: – Tariq Aziz Apr 3 '13 at 18:15

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.