I have a large database of products. None of these products have a weight and probably won't have a weight added in for future entries. I do however know what the weight of a shipment will be for all packages.

Is there a way to hard code the weight of the shipment which is passed on to UPS via the UPS shipping module included with Store?


You could simply hard code this in the shipping plugin. You need to remember not to replace this file when you upgrade Store though.

Open store/libraries/store_shipping/store_shipping_ups.php, and around line 135 you will find this:

// order weight must not be zero
if ((float)$rating_request->Shipment->Package[$i]->PackageWeight->Weight <= 0)
    $rating_request->Shipment->Package[$i]->PackageWeight->Weight = '0.1';

Add this line directly after it:

// force weight to 50 lb
$rating_request->Shipment->Package[$i]->PackageWeight->Weight = 50;
| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.