WooCommerce FedEx Shipping – Limit Rate to the Customer

In this article, we will explain to you how to limit the shipping rate to the customer while using the WooCommerce FedEx Shipping Plugin with Print Label. Read below to know more.

Recently one of our customers (a developer himself) came up with a query on our FedEx plugin:

[porto_blockquote footer_before=”Business Problem ” skin=”quaternary” color=”00FFFE”]Our client provides overseas free shipping when the product subtotal is above 200 Singapore Dollars (SGD). However, in some cases, the shipping fee FedEx provides exceeds our client’s acceptable range to absorb. This leads to a thought to split the shipping fee when it is over a certain amount (let’s say $100). Here we put $50 on top of the customer’s bill, and our client (the store owner) will absorb the rest, and populate the fee properly in the WooCommerce order.[/porto_blockquote]

That is quite an interesting and practical case. The shop owner must be facing deep problems if the shipping is from, say, “United States” to “India” as shipping cost may reach over $100 dollars for heavy items. For him, to provide it free seems practically impossible.

WooCommerce FedEx Shipping – Limit Shipping Fee to a Constant Value

We at PluginHive came up with a simple solution (a code snippet) that allows the shop owner to limit the shipping fee to a constant value.
Here is the code for it :

Just add this code to Appearance --> Editor --> functions.php and the solution is guaranteed.

So for example, if the shipping cost returned by FedEx is $120, the customer at the cart page will be shown a charge of $50. The shop owner will bear the rest of the charge.
Before incorporating the solution, the cart was showing an amount greater than $100 as shipping charge shown below:
FedEx International Shipping

After incorporating the solution, the cart is shown with a constant shipping charge of $50 :
FedEx international