I'm running a commerce shop where we're gonna sell stuff we don't have worldwide rights to.

By using the countries module I've ticked of which countries we can sell each product in by having a countries field on products. (see screenshot below).

I'm thinking it must be possible to make a rule banning to sell a product in a territory that hasn't been ticket of. It should be the billing country of the customer that needs to be validated against what countries the product is sellable in.

Any ideas on how to configure a rule (or another solution) that does this check?


territories screendump

  • Are you sure you meant rules module? If no, please remove tag and rephrase a bit. If yes, please make it clear. – Mołot Aug 29 '15 at 22:36
  • Depends on the way u r obtaining user's location: before/during/after ordering or durin checkout process, or mb during user regustration. – ar7max Sep 2 '15 at 19:46
  • 1
    Thanks to you both @Molot. I've edited my post to provide more details. – Kristoffer Rom Sep 6 '15 at 18:47
  • @ar7max in the checkout (billing address) – Kristoffer Rom Sep 6 '15 at 18:47

You can use Smart IP to determine the location of the user and with the help of drupal views, you can filter the products not available for sale on that country.

That means only the products which are OK for sale in that country will be displayed to the user..

  • This is a very nice solution to most cases I guess - but I do need to display the products. The ideal solution would be to display them with a badge saying something like 'not available in your region' in stead of the add to cart fields. Do you think that's possible @Swarnendu Dutta? – Kristoffer Rom Sep 6 '15 at 18:50
  • You can try with views_conditional using replacement variables in that case.. – Swarnendu Dutta Sep 7 '15 at 6:05

Not the answer you're looking for? Browse other questions tagged or ask your own question.