How To Sell WooCommerce Products With Two Different Prices

Home » Blog » How To Sell WooCommerce Products With Two Different Prices

For the past couple of months, we have been working on several e-Commerce projects, and as we have already been using WordPress for websites & blogs, it was an obvious choice for us to go with something which was as simple & flexible as WordPress for building an online store too.

The majority of our clients who are from India came up to us asking for a solution to sell WooCommerce products at two separate prices Indian rupee & US dollar. The catch here is, it won’t be based on exchange rates; rather store will have a fixed separate price for both countries. Now, most of the payment gateways our clients come up with don’t have support for international currency & WooCommerce, so we technically can have only one base currency. So if we have the rupee set as the base currency, we won’t be able to configure PayPal, as it doesn’t support Indian currency. If we have the dollar as the default currency, Indian payment gateways won’t accept it. All we needed was to have Instamojo as the payment gateway for Indian customers and PayPal for the rest of the world. PayPal by default hides when currency is not supported by which was not the case with instamojo. So to make things work, we needed a combination of PayPal and Instamojo.

Here’s how we did it…

After several hours of digging into the WordPress plugin repository and woocommerce documentation, we found some pointers that would help us.

  • Setting country-specific prices, which can be achieved via WooCommerce’s price by country
  • Set the dollar ($) as a base currency in WooCommerce
  • Using WooCommerce filters to unset the payment gateway based on user location

Let’s get the ball rolling…

Step 1

Install the plugin WooCommerce Price Based on Country by your preferred method (Plugin Interface, Zip file, or FTP)

Step 2

Configure the installed plugin to have country-specific pricing. Once the plugin is installed, you can find a new tab “Price Based On Country” in woocommerce settings. The plugin lets you define the price for as many countries as you want. If the price for a specific country is not defined, we can either have the exchange price calculated based on the base price or have the regular price of the product as a fallback, which will be in the base currency. Add the price of India and save.

woocommerce price based on country india
woocommerce price based on country India

Step 3

Set the US dollar as the base currency under woocommerce settings

woocommerce general base currency
woocommerce general base currency

Step 4

Add the following code to your functions.php to remove instamojo for non Indian customers

[wpgist id=”b3dec6fdf060cde68f04″]

Step 5

Add a new product under woocommerce, now you will have additional price fields, one for India and one for the rest of the world.

woocommerce product country pricing
woocommerce product country pricing

So this is how we achieved the solution. If ever you run into any problems or need to extend your online store features, there will always be someone to turn to. So what are you waiting for?

Ajit Bohra Avatar

Leave comment

8 responses

  1. Sudhir Dixit

    Wrong Link of Plugin : woocommerce price by country
    Please change the Link to Proper Plugin

    1. Ajit Bohra

      Link has been updated

  2. Shailender Kaushik

    How to disable PayUmoney or PayUindia along with Instamojo, while using USD or EUR?

    1. Ajit Bohra

      @shailenderkaushik:disqus You can do that using following code:

      unset( $available_gateways[‘YOUR-GATEWAYNAME-HERE’] );

  3. Ricardo Rodrigues

    everything seems ok except the prices are not visisble from the frontend …

    1. Ajit Bohra

      Hi Ricardo,
      Can you elaborate further along with screenshot. Price is visible for the current applicable zone/country.

  4. Lohith M

    Hi Ajit, Is there any way to set prices based on the city locations.

    1. Ajit Bohra

      Hi Lohit,

      Currently plugin does not support price based on city but possible with custom implementation. Can you share the case study there might be some workaround to achieve this without coding?

Leave a Reply

Your email address will not be published. Required fields are marked *