-
- rareus

-
Total Posts: 13
Joined: 2012-04-06
|
Hey guys,
I’m trying to retrieve tracking number from an order, which will be automatically placed into the tracking URL given by my carrier.
Here’s my code for app/design/frontend/base/default/template/sales/order/view.phtml:
<?php $shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection') ->setOrderFilter($order) ->load(); foreach ($shipmentCollection as $shipment){ // This will give me the shipment IncrementId, but not the actual tracking information. foreach($shipment->getAllTracks() as $tracknum) { $tracknums[]=$tracknum->getNumber(); }
} ?> <?php endif; ?> <?php $_order = $this->getOrder() ?> <h2 class="table-caption"><?php echo $this->__('Items Ordered') ?> <?php if ($_order->getTracksCollection()->count()) : ?> <?php /* <span class="separator">|</span> <a href="#" onclick="popWin('<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($_order) ?>','trackorder','top=0,left=0,width=800,height=600,resizable=yes,scrollbars=yes'); return false;" title="<?php echo $this->__('Track your order') ?>"><?php echo $this->__('Track your order') ?></a> */ ?> <span class="separator">|</span> <a href="http://www.singpost.com/index.php?option=com_tablink&controller;=tracking&task;=trackdetail&layout;=show_detail&tmpl;=component&ranumber;=<?php echo $this->helper('shipping')->getTrackingPopupUrlBySalesModel($tracknums) ?>" target="_blank"><?php echo $this->__('Track your order') ?></a> <?php endif; ?> </h2>
I got this code from some other guy, I’m trying to place the tracking number ($tracknums) into the URL below:
http://www.singpost.com/index.php?option=com_tablink&controller;=tracking&task;=trackdetail&layout;=show_detail&tmpl;=component&ranumber;=[THIS IS WHERE THE TRACKING NUMBER COMES IN]
So by right, when customers click “Track your order”, it should bring up a page with the URL containing the tracking number, which will show all the tracking details from my carrier. Looks pretty simple, but I’ve been struggling for over 5 hours with it.
Please help me! Thanks!!
|