How to prevent ordering certain products - or a category - from a specific country

I have a category dedicated for exported goods , obviously , they will not be sold locally . so , how can I prevent customers who are from my country from ordering products that are meant only for exporting.. and showing an error message .. please help !


I would say that you will have to create a new product type. You'll need a new module (use Daniel's excellent kick-start extension: and then have your model extend Mage_Catalog_Model_Product_Type_Simple.

Then, add a new attribute for your new product type to capture Allowed Countries, and implement the isSalable method in your Model to check for Allowed Countries.

This is not trivial, but it should be the right approach. The guys at Inchoo (who write a great blog) have a good tutorial on the process: link text and in fact they've provided the shell of the module.

Good luck! JD

Need Your Help

Can wkhtml2pdf support CSS counters?


I have counter-reset and counter-increment working fine in HTML, but they are not appearing in the rendered PDF. Are they supported? (An hour of Googling didn't help.)

Macro to create a uniquely named OpenMP critical section?

c++ c macros openmp

Several posts explain that it is best to assign names to OpenMP critical sections so that their synchronizations do not conflict.