How to make a product available only in specific cities. Example organic products will be available only in certain cities, so during checkout if the user selects city other than specified then the checkout process should give error stating "Products available only in so and so city.". Checkout process should not be completed unless a proper city is selected. I have tried with Shopping cart price rules but no luck. Any ideas or suggestions please?
Thanks,
Best Answer
Create a product attribute called
city
that has a plaintext City Name - match on this in an observer for the predispatch event of theMage_Checkout_OnepageController::saveShippingAction
.However, this is the easiest part - the reason Zones Manager is so complex is because this is a very complex problem. Thinking through this - there are many considerations:
(corrected the code by putting the missing curly bracket to close the foreach loop)