How To Disable A Shipping Method In Woocommerce

WooCommerce comes with a few shipping methods and with plugins, you can add more. So, you can have literally unlimited shipping options.  Having multiple shipping methods seems to be a good thing since it gives the customers more options. However, if you know that your customers will use only a certain shipping methods, having more than that can cause confusion.  In this post, we are going to find out how to disable a shipping method in Woocommerce so your customers will have only the methods that suit them.

How To Disable A Shipping Method In Woocommerce

First, go to Woocommerce->Settings and click on Shipping.

woocommerce shipping screen

In the first screen, you can see the list of shipping zones. If you don’t know what shipping zones are, they are the area you can define to apply different shipping policies. This is a very nice option of WooCommerce. For example, you want to apply free shipping in Asia and a flat rate $10 in Europe, you can add two zones Asia and Europe and apply the appropriate shipping methods to those zones.

Now, one zone can have multiple shipping method. For example, my customers in Asia will see this when they checkout:

Pretty confusing, right? Now, I would like to remove the Free shipping option, here is what I’ll do:

  1. Click on the shipping zone I want to modify its shipping methods, in my case, I will click on Asia.

As you can see, all the options are listed in the next screen. To disable any shipping method, simply click on the toggle button to turn it off. Here, I’m going to turn off free shipping. Don’t forget to click on Save changes.

If I go and check the checkout page now, the Free shipping method is no longer available:

That’s it! Now you know how to enable and disable a shipping method for a particular zone in Woocommerce. Thanks for reading and if you have any comments, please leave it below.

How To Add New Currency To WooCommerce

Woocommerce comes with quite many currencies. In fact, if you are selling items internationally, you got a plenty of options to choose from such as USD, GBP, EUR or even BTC (bitcoin). However, there are a lot of currencies isn’t in that list. For example, what if you want to accept ETH (Ethereum) as your currency? Don’t worry, we can make that work.

Check if your currency is supported by Woocommerce

Woocomemerce is updated frequently. Thus, chances are your currency get added in the latest release. The first thing you need to do is to:

  1. Update Woocommerce to the latest version
  2. Go to Woocommerce->Settings->General->Scroll to the bottom to see the currency options. You can see the list of supported currencies there

If your desired currency is in the list, that’s great! You don’t need to do anything else. If it isn’t, read on.

Introducing the necessary hooks

If you are unfamiliar with the term hooks, you can take a look at the official document here. However, it is not necessary to understand it thoroughly to add new currencies to Woocommerce.

There are two filter hooks you need to use to add new currency to Woocommerce

  1. woocommerce_currencies
  2. woocommerce_currency_symbol

As the names suggest, the first one will be used to register new currency and the second one will be used to register the currency’s symbol.

The actual code

I’m going to register the Ethereum currency to Woocommerce. However, you can define and add any type of currency you want. You can even invent a currency that isn’t available right now.

add_filter( 'woocommerce_currencies', 'bc_add_new_currency' );
add_filter( 'woocommerce_currency_symbol', 'bc_add_new_currency_symbol', 10, 2 );

function bc_add_new_currency( $currencies ) {
     $currencies['ETH'] = __( 'Ethereum', 'your-theme-text-domain' );
     return $currencies;
}


function bc_add_new_currency_symbol( $symbol, $currency ) {
     
     if( $currency == 'ETH' ) {
          $symbol = '♦';
     }
     return $symbol;
}

There are a few places in the code above you need to pay attention to:

  1. The symbol of ETH is ♦. You can replace this with your currency’s symbol .
  2. Name of your currency. In the code, it is “Ethereum”. You can change this to the name of your currency. For example: Bitcoin Cash
  3. The index key ‘ETH’. This can be anything but unique across all currencies.

Now, after you modify the code to match your currency of choice, put it at the end of the functions.php file in your active theme folder:

The result

Now, if you go to Woocommerce->Settings->General and scroll down to Currency Options, you can search for the new currency:

That’s it! That’s how you can add new currencies to Woocommerce. You can add as many new currencies as you want, there is no limit.