I'm trying to track down the title/delivery method for shipments in my store for use in the tracking popup. In the popup template, I've got a Mage_Shipping_Model_Tracking_Result_Status object that looks like this:
object(Mage_Shipping_Model_Tracking_Result_Status)#182 (7)
{
["_data":protected]=> array(5)
{
["carrier"]=> string(3) "ups"
["carrier_title"]=> string(21) "United Parcel Service"
["tracking"]=> string(22) "9102969006713002493469"
["popup"]=> int(1)
["url"]=> string(211) "http://wwwapps.ups.com/WebTracking/processInputRequest?HTMLVersion=5.0&error_carried=true&tracknums_displayed=5&TypeOfInquiryNumber=T&loc=en_US&InquiryNumber1=9102969006713002493469&AgreeToTermsAndConditions=yes"
}
["_hasDataChanges":protected]=> bool(true)
["_origData":protected]=> NULL
["_idFieldName":protected]=> NULL
["_isDeleted":protected]=> bool(false)
["_oldFieldsMap":protected]=> array(0) { }
["_syncFieldsMap":protected]=> array(0) { }
}
The problem I'm having is that I need to know what the "title" is for the shipment as is seen in the admin panel. In the admin panel, I see this:
+-----------------------+------------------------+------------------------+--------+
| Carrier | Title | Number | Action |
+-----------------------+------------------------+------------------------+--------+
| United Parcel Service | MI Expedited Irregular | 9102969006713002493469 | Delete |
+-----------------------+------------------------+------------------------+--------+
Now what I'm looking for is the title from the table, that of "MI Expedited Irregular." I want that so I can put a check for it in the code so that it uses a different tracking URL then then the one listed in the url variable for the object. But I can't figure out how to use the object I listed above to get a Mage_Sales_Model_Order_Shipment_Track, where I believe the particular piece of data I'm looking for lives. In my latest attempts, I tried this
$forder = Mage::getModel('sales/order')->loadByIncrementId($shipid);
foreach($forder->getShipmentsCollection() as $shipment){
var_dump($shipment);
}
$ship_col = Mage::getResourceModel('sales/order_shipment_collection')->setOrderFilter($forder)->load();
var_dump($ship_col);
foreach($ship_col as $sc){
var_dump($sc);
}
$ship_col = Mage::getResourceModel('sales/order_shipment_collection');
$ship_col->addAttributeToFilter('order_id', $forder->getId());
foreach($ship_col as $sc){
$ship = Mage::getModel('sales/order_shipment');
$ship->load($sc->getId());
$ftrack = Mage::getModel('sales/order_shipment_track')->loadById($ship->getId());
foreach($ftrack as $tr){
var_dump($tr);
}
}
In all those tries, all I get is NULL/empty results in the var_dumps. The file I'm trying to add the functionality to is popup.phtml, which is in app/design/frontend/default//template/shipping/tracking.
So I guess the two things I'm trying to find are 1) Where is the "title" field, as is seen in the table that shows on a shipment details page in the admin panel, in the mix of objects and tables that is Magento? 2) How do I get that value so I can run my check against it?