The shipping option ID is the unique string that WooCommerce assigns to a shipping method so it can recognize the selected option throughout the checkout process. Because the Table Rate method can return more than one option from the same method, the unique ID has three parts:
betrs_shipping:1–2
The method ID is ‘betrs_shipping’. That is the ID that was assigned to this method when it was first created. All of your Table Rate methods with this plugin will have this ID. The first number after the colon is the instance ID. This tells WooCommerce which Table Rate method the option is coming from. With the introduction of shipping zones, you may have multiple Table Rate methods, one or two in each zone. This instance ID is what sets them apart. The last number, just after the hyphen, refers to the table ID. This part is unique to this Table Rate method. It refers to which option/table in the method that this particular option is coming from.
Finding the ID Values
Much of this information is hidden in the dashboard as it’s not necessary unless you are a developer. The method IDs can often be found in documentation for the plugin you are working with. It is a constant value that is not different between sites. The instance and option IDs, however, are specific to the user’s setup.
An instance ID is listed in the URL of the shipping method when you are modifying its settings. As an example with this Table Rate method, after clicking on the method you wish to edit, your URL would look something like this:
https://www.yourwebsite.com/wp-admin/admin.php?page=wc-settings&tab=shipping&instance_id=8
Marked in bold is the instance ID listed in the URL. So in this example, the instance ID is 8.
The option ID is much easier to find. Also while viewing your Table Rate settings page, open the section Table of Rates to view your configuration tables. At the top of each option’s box is the option ID.
Alternative Way to Finding the ID
Browser tools are another great way to find the ID. Using Developer Tools in Google Chrome allows you to view specific sources of code, which can also reveal an option’s ID. Right click on the ‘Shipping’ box of your checkout page when the option you need is available. The option ID can be found nearby in the source code, as seen below.
Removing the Table ID
Sometimes adding this extra number to the option ID causes a compatibility problem with other plugins. If your site falls into this category, it is very simple to remove it with a code snippet (added to your theme’s functions.php file). Please remember that all options you create will need to have their own table rate method within the same zone. By removing the table ID from the shipping option ID, only one option will ever appear from a single Table Rate method.
A simple checkbox option will be available in the settings page with the Table Rate 4.4 update. This checkbox feature will also work with our WPML & Polylang support. The code above will not work with descriptions that have been translated by these other plugins.