I'm currently working on a Woo project for a client, however, something is stumping me :
They have a variety of categories of products, and they are offering free shipping on everything, which makes the shipping nice and simple.
However, they have one particular category which is a kind of "sample pack" which they wish to only be able to ship to certain postcodes. I guess because it's not worth their while to shell out loads of shipping on it to certain other areas.
I've been scratching my head over this one. I can set up a Shipping Zone, for example, and allow my client to enter in postcode restrictions to it in the admin backend - for the Shipping Zone, that would be "Zone regions - limit by specific zipcode/postcode" under the "Shipping Zones" tab. No problem, this does basically work, by not offering any shipping options to the customer if they are outside of these postcodes.
However, how to limit this postcode restriction to only apply to a case where they have a product from the sample pack category in their cart?
I'm fairly at home with writing functions to iterate through cart items and suchlike, but just can't find anything that will work for me here with these postcode restrictions. It seems to be that Woocommerce sets it up to be all or nothing.
I don't think that "Shipping Classes" really helps me out here at all either.
I've been mucking around a lot with the woocommerce_package_rates filter but as of yet can't get anything to work.
Any ideas? Preferably without using a plugin.