I need to add a shipping surcharge for USA


Due to the new security measures the US has put in, we are being charged an extra $9.00 per shipment for security checks (not to mention 48 hr delays!)

Any ideas on how to add a $9.00 surcharge for orders sent to USA?

I don’t use localizations.

I have real-time shipping methods setup (Australia Post) but it seems when you use real-time shipping you can’t then add cost/item/weight dependencies on a location basis?

If i use manual shipping it gives me the option to add dependencies by location but then i can’t use the real-time shipping calculations.

Other thoughts I had to get around it:

  1. I make a new product “Security Surcharge” $9.00 and then make it a required product but again I don’t know how to limit it to customers from a certain country.

  2. Surcharge on payment methods, but again can’t condition it to US only.

    I don’t want to use localizations which would help here because unless it somehow detects where a user is from (it doesn’t) it causes more hassles than benefits (for my situation)

    Thanks for any suggestions

Are you using realtime or manual shipping methods. If manual, just edit the Shipping charges for the USA location and add your $9.00 to the “If products total $0.00” element. This will add your $9.00 to all orders where the amount is greater than zero.

If realtime, there is no standard way to do it. You can make a mod int the shipping calculation code to add your $9.00 if $order_data[‘s_country’] == ‘US’. But it would be a manual change.

thanks for the quick reply.

Yes i use realtime shipping so will have to look at doing a mod…

i am happy to have a hack around if pointed in the right direction :slight_smile:

if you are able to point me in the right direction that would be great

The hook

fn_set_hook('apply_cart_shipping_rates', $cart, $cart_products, $auth, $shipping_rates);

is called from fn_apply_cart_shipping_rates() in core/fn.cart.php.

So you should be able to setup a hook to trap the shipping calculation and then make whatever adjustments you need in there. You probably want to adjust $cart[‘shipping_cost’] in your hook. Make sure to declare the parameter in your hook to be pass by reference, not by value.

thanks will give it a go