0

I have successfully created a custom shipping method using this tutorial. I am unable to display this information in the admin panel correctly. This is my code just like the one in above tutorial

class Excellence_Pickup_Model_Sales_Order extends Mage_Sales_Model_Order{
public function getShippingDescription(){
    $desc = parent::getShippingDescription();
   // print_r($desc);
    $pickupObject = $this->getPickupObject();
    if($pickupObject){
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getShp_carrier();
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getAccountno();
        $desc.= '\r\nShipping Carrier:'.$pickupObject->getShp_method();
    }

    return $desc;
}

}

As you can see i am using "\r\n", i also have tried using "br" tags but they also appear as it is in the admin panel as shown in the image belowShipping & Handling Information admin panel.

What is the way forward?

1 Answer 1

1

The HTML is being filtered in the template:

//From sales/order/view/tab/info.phtml

<?php if ($_order->getShippingDescription()): ?>
    <strong><?php echo $this->escapeHtml($_order->getShippingDescription()) ?></strong>

//...

To fix this, override the template and remove the call to escapeHtml(). That should fix it.

Please let me know if you have any questions!

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.