How to restrict a product for a single country and change it’s currency in WooCommerce

Question

I am selling some services on a site where each service are basically virtual products and has variations like plans. Now the site doesn’t show the shop page to any public user instead uses pricing table to show different plans for different services. Each plan column has a button which has custom URL with product id, attribute name, variation id etc. in it so that clicking on that button will directly take the user to checkout instead of adding the product in the cart.

Now I have a service which is only available in India. But as the global currency has been selected as USD, I don’t see a way to change the currency of that specific product to INR.

Also as this is an India specific service, I want that if a person from any part of the world except India tries to buy it it will show them a notice saying this service is not available in your country and they can’t purchase it.

I have tried the plugin Country Based Restrictions for WooCommerce but as I need this feature on a single product I really don’t want to install a plugin and slow down the site. Instead, I prefer to write a code in the functions.php for that specific product id.

As I am very new to WooCommerce, I still not well familiar with all the programmable option, so if anyone can guide a bit on how to implement this, will be really helpful.

0
iSaumya 6 months 0 Answers 61 views 0

Leave an answer