Question

When I update a shipment in the admin with a tracking number, Magento will automatically figure out what kind of "speed" it is.

For example, I log on to admin -> Orders -> open an unprocessed order -> click to create a shipment. I would select "UPS", enter a tracking number, and submit the shipment. Once this is complete, Magento displays the following, even though I did not specify Next Day Air, nor is there any shipping rate request from UPS, as far as I can see on the admin side. The price is what the customer already paid during checkout.

Shipping & Handling Information
Track Order
United Parcel Service - *Next Day Air* $69.10

How or where does it figure out that this is a Next Day Air shipment?

UPDATE: made some clarifications.

UPDATE 2: In sales_flat_order.shipping_method, you'll find the shipping code responsible for the order.

Was it helpful?

Solution

It's not quite clear what you're asking, but in general Magento will communicate with the UPS API, which gives it access to UPS internal codes for package type, shipping, etc. Most of these are translated using code in the class file

app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php

For example, the origin shipment codes for US domestic packages

#File: app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php
        'originShipment'=>array(
            // United States Domestic Shipments
            'United States Domestic Shipments' => array(
                '01' => Mage::helper('usa')->__('UPS Next Day Air'),
                '02' => Mage::helper('usa')->__('UPS Second Day Air'),
                '03' => Mage::helper('usa')->__('UPS Ground'),
                '07' => Mage::helper('usa')->__('UPS Worldwide Express'),
                '08' => Mage::helper('usa')->__('UPS Worldwide Expedited'),
                '11' => Mage::helper('usa')->__('UPS Standard'),
                '12' => Mage::helper('usa')->__('UPS Three-Day Select'),
                '13' => Mage::helper('usa')->__('UPS Next Day Air Saver'),
                '14' => Mage::helper('usa')->__('UPS Next Day Air Early A.M.'),
                '54' => Mage::helper('usa')->__('UPS Worldwide Express Plus'),
                '59' => Mage::helper('usa')->__('UPS Second Day Air A.M.'),
                '65' => Mage::helper('usa')->__('UPS Saver'),
            ),

Or the actual method codes

        'method'=>array(
            '1DM'    => Mage::helper('usa')->__('Next Day Air Early AM'),
            '1DML'   => Mage::helper('usa')->__('Next Day Air Early AM Letter'),
            '1DA'    => Mage::helper('usa')->__('Next Day Air'),
            '1DAL'   => Mage::helper('usa')->__('Next Day Air Letter'),
            '1DAPI'  => Mage::helper('usa')->__('Next Day Air Intra (Puerto Rico)'),
            '1DP'    => Mage::helper('usa')->__('Next Day Air Saver'),
            '1DPL'   => Mage::helper('usa')->__('Next Day Air Saver Letter'),
            '2DM'    => Mage::helper('usa')->__('2nd Day Air AM'),
            '2DML'   => Mage::helper('usa')->__('2nd Day Air AM Letter'),
            '2DA'    => Mage::helper('usa')->__('2nd Day Air'),
            '2DAL'   => Mage::helper('usa')->__('2nd Day Air Letter'),
            '3DS'    => Mage::helper('usa')->__('3 Day Select'),
            'GND'    => Mage::helper('usa')->__('Ground'),
            'GNDCOM' => Mage::helper('usa')->__('Ground Commercial'),
            'GNDRES' => Mage::helper('usa')->__('Ground Residential'),
            'STD'    => Mage::helper('usa')->__('Canada Standard'),
            'XPR'    => Mage::helper('usa')->__('Worldwide Express'),
            'WXS'    => Mage::helper('usa')->__('Worldwide Express Saver'),
            'XPRL'   => Mage::helper('usa')->__('Worldwide Express Letter'),
            'XDM'    => Mage::helper('usa')->__('Worldwide Express Plus'),
            'XDML'   => Mage::helper('usa')->__('Worldwide Express Plus Letter'),
            'XPD'    => Mage::helper('usa')->__('Worldwide Expedited'),
        ),

etc.

If that's not what you were after, a little more specificity in your question would help.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top