Magento 2 how default fedex / ups shipping rating logic works

By | April 14, 2024
Spread the love

Default Magento 2, send single package to FedEx / UPS API with just total weight. If cart total weight exceed with max package weight limit then magento divide weight to multiple equal weight packages.

For example, Cart have two item with weight 100 lbs. and 60 lbs.  Admin have defined max package weight is 150 lbs. which is generally max limit of default fedex and ups for ground shipment. For heavy item, they use LTL shipment.

Item A 
  Weight = 100 lbs
  Qty = 1 
  Price = 100 $

Item B
  Weight = 60 lbs
  Qty = 1
  Price = 200 $


Total cart weight is 100 x 1 + 60 x 1 = 160 lbs which is greater than max package weight 150 lbs.

Total Number of Packages =  ceil( 160 / 150 ) = 2
Each Package Weight = 160 / 2 = 80 lbs.

So FedEx / UPS will get each package weight with 60 lbs. There will be no product dimensions.

$requestedPackageLineItems = array(
    '0' => array(
         'weight' => array(
            'value' => 60,
            'units' => "IN"
         ),
    )
);

When rates received from FedEx / UPS then rates will be multiply with number of packages. For example if FedEx / UPS return 30 $ for one package cost, then total 30 x 2 = 60 $ will show to customer on cart / checkout page.

If UPS / FedEx returned discounted rates then Magento have setting to use it or not. If enabled account level discounted rates then rates will replace.

 

If you wants to improve package rating logic with auto address validation then check below plugins.

https://www.ecomplugins.com/magento2-fedex-shipping-carrier-with-rest-api

https://www.ecomplugins.com/magento2-ups-ground-with-rest-api