How to block a delivery method for a USA state if cart contains a specific product?

How to block a delivery method for a USA state if cart contains a specific product?

Step 1. Please create a Shipping Restriction rule by navigating to the Magento Admin Panel → Sales → Shipping Restrictions section and clicking the Add Rule button.

Step 2. Make sure to select the shipping method that will be restricted from the Restrict Shipping Carriers and Methods dropdown. You can choose a whole carrier or a specific shipping option within the methods of the carrier:



Step 3. If you would like a message to be displayed instead of the restricted delivery option, please set the Show Restriction Message option to Yes and add your custom message to the corresponding field:




Step 4. Let’s move on to specifying the state which will be restricted from delivery if at least one product from the list of SKUs is in the cart. Add the requirements that should be met for the rule to get applied in the Conditions section like so:



    

Here is how the blocked shipping method is going to look on the frontend when all of the restriction conditions are met: