Local Pickup: How To Hide The Shipping Option For Certain Product Categories

If you want to disable the Local Pickup Shipping option when products of a certain category in the cart, you can use the following snippet:

Please note: This will also disable the shipping option for mixed carts. So if you have products from Category A (not shippable) and Category B in the cart, the shipping option will be hidden.