WooCommerce FedEx Shipping – Change Customs Duty Payer based on the Destination country

In this article, we will tell you how to change the customs duty payer based on the destination country when using the WooCommerce FedEx Shipping Plugin with Print Label.

Marijn has set up a prolific eCommerce store. He has all the products set up on the WooCommerce platform. As a shipping solution, he chooses FedEx. Now, Marijn wants predictability in his expenditure. He doesn’t like surprises when it comes to rates.

But, to his dismay, it is impossible to predict the shipping rates for every country he is shipping to. It seems like the rates change drastically on a regular basis. And that is adding some confusion to his regular business.

Customs Duty Fluctuation in Some Countries is the Root Cause of the Problem

Now he could finally figure out that this issue is being caused by the fact that in some countries, the customs duty rates fluctuate. So, as a solution to bring some certainty to his business, he would somehow have to prevent himself from paying the customs duties of those countries and instead make the receiver pay for the customs duties.

As an example, he can choose to pay the customs duties for the U.S. Shipments, because the duties in the US are non-fluctuating. Thus he can estimate the price and prevent his customers from having to pay extra while the shipment is delivered.

In some countries like Israel, the customs duty rates fluctuate on a daily basis. Within a day it can vacillate between 6% to 20%. In this case, he would want his customer to pay directly to FedEx as they won’t be willing to makeup for the rate differences later. And it would end up creating further inconvenience for his customers.

WooCommerce FedEx Shipping Solution of PluginHive allows changing the Customs Duty Payee

Looking at the WooCommerce FedEx Shipping plugin, this seems to be a one-time decision made in the plugin’s settings page itself. Fortunately, PluginHive could find a suitable solution for him by providing a code snippet.

The code snippet below can override the decision made on the settings page. It would set up different options based on countries. For some countries, it would make the sender pay for the customs duties, and for others, it would ask the recipient to pay customs duties.

add_filter( 'woocommerce_package_rates',  'wf_add_charge_if_exceed_cost', 15, 2 );
function wf_add_charge_if_exceed_cost( $available_shipping_methods, $package ){
   	$order_total_limit  = 10; //Set limit of cart total

    $extra_cost_to_add      = 0; // Give value here to add with shipping coast
    $extra_cost_to_percent  = 0; //Percentage value her to add with shipping coast (give negative value for discount).
    $limit_the_shipping_charge = 50; //Set maximum shipping charge taken from customer

    $cart_total = WC()->cart->cart_contents_total;

    if( $cart_total >= $order_total_limit ){
        foreach ($available_shipping_methods as $shipping_method => &$value) {
        	// Cost adjustment %
        	if ( ! empty( $extra_cost_to_percent ) ) {
        		$value->cost = $value->cost + ( $value->cost * ( floatval( $extra_cost_to_percent ) / 100 ) );
        	}
        	// Cost adjustment
        	if ( ! empty( $extra_cost_to_add ) ) {
        		$value->cost = $value->cost + floatval( $extra_cost_to_add );
        	}
        	//Set maximum shipping charge
        	if ( ! empty( $limit_the_shipping_charge ) && $value->cost > $limit_the_shipping_charge ) {
				$value->cost = $limit_the_shipping_charge;
        	}
        }   
    }
    return $available_shipping_methods;
}

In the above snippet, for ‘GB’ (United Kingdom), the customer would pay the customs duty and for ‘CA’ (Canada), the shop owner would be paying the customs duty. And that’s how the big headache of setting up different custom duty payers for different countries got resolved.

Check out the WooCommerce FedEx Shipping Plugin to find out great solutions like these. If you need help setting up FedEx shipping on your WooCommerce store then feel free to Contact PluginHive Customer Support.

Last Updated On April 23, 2020