You may have a set of products in your shop that are restricted from shipping to some areas. For instance, you may be shipping alcohol, or CDB products, or brand restricted products.
Here is how to do it:
Add Rates to your Default group ( or any product group )
Add Shipping Rate to a zone
Choose a shipping rate type and click Next
Configure your rate, and then scroll to the Rules section, and click the dropdown and select the rule type Hide rate when....
Click the dropdown that says Quantity, and choose either Title, Vendor, or SKU variable to target your restricted products with. ( What if I can't target products with Title, Vendor, or SKU )
Then choose a comparison operator that works for you, and enter in your string of text to target.
You can also enter a comma separated list of values to quickly target multiple values.
Then Add Condition
And choose the variable of State/Province, or Country, or some other address variable.
Then enter a comma separated list of state/province abbreviations to target the restricted states. ( Same applies for countries, it uses the two digit country codes )
In this case, the restriction is for South Dakota and Idaho.
Then Save Rule
Your rule will look like this when saved.
Then make sure you save the entire rate.
Once saved, you will see the rate within your product group, with the note 'This rate is conditionally hidden' .
You can click the Show Rules link at the top, to see the rule applied without having to go into the rate.
This means the rate you have configured will be hidden when the title of any product contains either 'CBD' or 'Cannabidol' and the state is either South Dakota or Idaho.
If you have no other rates set-up within the app, or within your Shopify Shipping Settings, then this means no rates will show and checkout will be prevented.