2

I am trying to pass multiple package weight in app/code/local/Mage/Usa/Model/Shipping/Carrier/Fedex.php , when the shipping package weight is greater than 150 Lbs. Currently it showing Freight charges if package weight is greater than 150 Lbs. What I am trying to do is whenever the package weight is more than 150 Lbs for ex.- 374 Lbs, Then the weight will divide into smaller packages like (150 , 150 , 74). And that's the way to avoid freight charges in fedex shippment.

After some debugging I found that weight is passing in request like this in my fedex.php file.

<?php $ratesRequest = array( 'WebAuthenticationDetail' => array( 'UserCredential' => array( 'Key' => $r->getKey(), 'Password' => $r->getPassword() ) ), 'ClientDetail' => array( 'AccountNumber' => $r->getAccount(), 'MeterNumber' => $r->getMeterNumber() ), 'Version' => $this->getVersionInfo(), 'RequestedShipment' => array( 'DropoffType' => $r->getDropoffType(), 'ShipTimestamp' => date('c'), 'PackagingType' => $r->getPackaging(), 'TotalInsuredValue' => array( 'Amount' => $r->getValue(), 'Currency' => $this->getCurrencyCode() ), 'Shipper' => array( 'Address' => array( 'PostalCode' => $r->getOrigPostal(), 'CountryCode' => $r->getOrigCountry() ) ), 'Recipient' => array( 'Address' => array( 'PostalCode' => $r->getDestPostal(), 'CountryCode' => $r->getDestCountry(), 'Residential' => (bool)$this->getConfigData('residence_delivery') ) ), 'ShippingChargesPayment' => array( 'PaymentType' => 'SENDER', 'Payor' => array( 'AccountNumber' => $r->getAccount(), 'CountryCode' => $r->getOrigCountry() ) ), 'CustomsClearanceDetail' => array( 'CustomsValue' => array( 'Amount' => $r->getValue(), 'Currency' => $this->getCurrencyCode() ) ), 'RateRequestTypes' => 'LIST', 'PackageCount' => '1', 'PackageDetail' => 'INDIVIDUAL_PACKAGES', 'RequestedPackageLineItems' => array( '0' => array( 'Weight' => array( 'Value' => $weight, 'Units' => 'LB' ), 'GroupPackageCount' => 1 ) ) ) ); ?>

and array of multiple package weight which I'm getting is like -

<?php Array( [0] => 150, [1] => 150, [2] => 74 ) ?>

But not getting how can I pass this array of multiple weight in Fedex weight.

Please help me to do this. Any suggestion would be appreciate.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.