Add Extra Fees Based on Box Size using WooCommerce UPS Shipping Plugin

In this article, we will tell you how to add extra fees based on the box size when using the WooCommerce UPS Shipping Plugin. Read below to know more about it.

David runs an eCommerce store where he sells tropical fruits. Shipping of perishable goods becomes a tricky task since he has to take special care of its packing. The seller has to guarantee that the fruits that reach the customer are of the promised quality.

Each fruit might require a box of a different type and size. Consequently, the boxes would have different rates too. Not willing to take chances, he decides to use expensive boxes for shipping his fruits.

Shipping perishable goods need expensive boxes of varied sizes – How to account for the extra cost?

The root cause of the problem is that expensive boxes of different sizes are required to ship perishable goods. David has to figure a way to account for this extra cost.

Moreover, the size of the box would also depend on the number of fruits it is meant to carry. Accordingly, David would require to attach a special cost to his packages based on the box size.

Now, the standard UPS API doesn’t allow this flexibility but PluginHive has a solution for this.

WooCommerce UPS Shipping solution of PluginHive allows charging of extra fees based on the box sizes

With this code snippet, David would be able to add extra costs based on the box sizes. As you can see below, the highlighted part denotes the box dimensions and the corresponding fees associated with it.

The part can be modified as per the user’s requirements. This extra cost would be added to the shipping charges.

woocommerce debug

Here’s an example, before adding the above code snippet, the shipping rates are as follows –
shipping rate

After adding the code snippet, as per the selected box (In this case, the second box is selected), $15 is added to every shipping services –
ups shipping rates

Last Updated On April 24, 2020