Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How to get tracking number? 
 
rareus
Jr. Member
 
Total Posts:  17
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!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
rareus
Jr. Member
 
Total Posts:  17
Joined:  2012-04-06
 

anyone knows how to do this? smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
anilbiswal
Jr. Member
 
Total Posts:  14
Joined:  2011-04-30
 

Hi there, did you find out how to do that? I’m stuck in exactly the same area…

 
Magento Community Magento Community
Magento Community
Magento Community
 
BillRust
Member
 
Avatar
Total Posts:  43
Joined:  2011-07-16
 

I don’t have an answer for the OP’s question, but I am curious how you are getting the tracking number into your system?  I need to figure out a way to automate grabbing the tracking number from FedEx once an order is “completed”, then send it to the customer in an email.

Not trying to thread jack, just curious what method the OP or anyone else is using to get the first part of this process.

Thanks,
Bill

 
Magento Community Magento Community
Magento Community
Magento Community
 
gcobbunc1
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2012-01-25
Summerfield NC
 

FedEx has just recently added “event based” tracking to go along with “on demand” tracking by reference/tracking number.  Allow your customers to choose when they want to be updated, even by text message.  The extension also supports emailing tracking number, which can be used in parallel with on demand tracking.

Checkout this extension:
http://www.cobbconsulting.net/magento-fedex-extension.html

It fully integrates Magento with all the latest FedEx APIs:  print shipping label, enhanced rate quotes for “dead on” rate quotes, detailed address validation is also a a new feature for Magento.  Our extension is currently the only extension that offers this service without a “monthly license” fee.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top