WooCommerce UPS Shipping Rate for US-US & Europe-Europe

WooCommerce UPS Shipping plugin is one of the best shipping plugins. It provides advanced features such as real-time shipping rates, UPS domestic and international shipping labels, shipment tracking, and much more. However, no matter the features that it provides, WooCommerce store owners can come up with some really interesting scenarios that can challenge the functionality of the plugin. A similar thing happened when one of our customers requested to add functionality to the plugin.

According to Jesper, “…I have a shipping location in the USA and one in Europe. Can your UPS plugin add-on calculate ups rates from each origin, and only show shipping rates from the US to the US, and only Europe to Europe..?” Before getting to the end result, let us first try to understand what exactly needs to be done here.

Jasper’s Request…

According to Jasper, he needs to be able to switch his origin address based on the address entered by his customer. This scenario can be achieved using the WooCommerce UPS Shipping plugin simply with the help of a code snippet published here.

However, before placing the code, there is something that you need to take into consideration. The store owners may be using a single or multiple UPS accounts while shipping from separate origin addresses. The code provides a way to switch the UPS accounts as well as the Origin address based on the address provided by the customer on the checkout page.

Besides the UPS account and the origin address, there is one more thing that the store owners need to take care of. Different countries can have different measurement units. Hence, while changing the origin address, store owners will also have to update the measurement units in the code.

Before the Code

The following image shows the Origin address that was set up by default in the plugin settings.

origin address

After the Code

Once we provided the Canadian store’s address in the code, the updated Canadian Origin address is shown based on the destination address.

origin address


This article covers the process of changing the origin address based on the destination address provided by the customers. Using the WooCommerce UPS Shipping plugin and the code provided in the article, store owners will be able to switch between two UPS accounts and different origin addresses at the same time. This way they can optimize the shipping cost based on the address provided by their customers.

About the Plugin

WooCommerce UPS Shipping Plugin

  • Official real-time UPS shipping rates.
  • Shipping rate Adjustment
  • Advanced packing methods
  • Print UPS Shipping Labels
  • UPS Shipment Tracking
  • Premium Version Cost – $69

2 thoughts on “WooCommerce UPS Shipping Rate for US-US & Europe-Europe

  1. Benjamin
    Benjamin says:

    Thank’s a lot for this plugin, it’s exactly what I was looking for,

    But I have got a question, I don’t know where to place the code snippet (from git), is it in my theme functions.php ?
    When I put it there, the website doesn’t work anymore,

    I can’t find a functions.php file for the UPS plugin.

    I hope you’ll be able to help me !

    Thank you.

    • PluginHive Editorial Team
      PluginHive Editorial Team says:

      Hi Benjamin,

      You would need to place the snippet in your Appearance–> Editor–> functions.php file.
      Kindly ensure you are pasting the snippet correctly and not missing any of the lines from the snippet.

Comments are closed.