Forums / Setting Up Categories, Products, Attributes / Can I disable some products depending on country?

Can I disable some products depending on country?

Views: 2,699

Results 1 to 6 of 6
20 Dec 2007, 8:06 AM
#1
jmouse avatar

jmouse

New Zenner

Join Date:
Mar 2007
Posts:
53
Plugin Contributions:
0

Can I disable some products depending on country?

I am setting up a shop to sell in several countries. However, not all products will be available in all countries - is there a way to limit the display of products or even whole categories depending on the country selected?

thanks

20 Dec 2007, 8:43 AM
#2
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Can I disable some products depending on country?

This isn't something which is included with Zen as a standard, however, you could certainly add the code to your store. Would you be looking to disable the products depending on which address? You could use either the shipping address, the billing address or a geo-location function on the IP of your customer. Obviously, if you use the delivery or billing addresses, all products would need to be active when the customer is browsing, and only limit the products on checkout.

There is a function within includes/functions/general.php, which is zen_get_products_status(), which you may be able to adjust to suit your needs.

The final thing to consider is that the product listing pages just list products with a products status of 1, so there may be a few SQL statements to adjust.

One solution may be to add a new table, with Zone to Product relationships, where you can then set these up in the admin, and adjust the store side SQL statements. Depending on the way in which you want to restrict the products will affect which method of restriction is right for you in the end.

Good luck,

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

21 Dec 2007, 6:58 AM
#3
jmouse avatar

jmouse

New Zenner

Join Date:
Mar 2007
Posts:
53
Plugin Contributions:
0

Re: Can I disable some products depending on country?

Thanks for that - I shall check out the modules you suggest.

What I was wondering was whether to key it off the language selected rather than the actual customer details. Presumably zencart 'knows' which language it is using at the moment; then if I set an extra flag on the product/category with the key of the appropriate language (or 0 for all, say)?

I can see it's not going to be an easy one though....

24 Dec 2007, 2:56 PM
#4
absolute avatar

absolute

Totally Zenned

Join Date:
May 2005
Location:
Bath, Somerset
Posts:
1,054
Plugin Contributions:
2

Re: Can I disable some products depending on country?

The problem with language is it won't trully limit the products to countries. For example, in you want to stop customers buying a product in Canada, you would need to disable English and French. This would then disable the product for most of the world.

You can perform Geo-Positioning checks on user's IP addresses, which will then tell you roughly where a customer is. The only time this causes a slight problem is with some Proxy servers.

Absolute

Back, after a 4 year absence! Did you miss me?
Absolute Web Solutions Ltd
Interested in our work? Take a look at one of our sites - The Tech Store

8 Jun 2008, 5:35 AM
#5
laydiefa avatar

laydiefa

New Zenner

Join Date:
May 2008
Posts:
13
Plugin Contributions:
0

Re: Can I disable some products depending on country?

jmouse:

I am setting up a shop to sell in several countries. However, not all products will be available in all countries - is there a way to limit the display of products or even whole categories depending on the country selected?

thanks

jmouse,

may i know if you already found the solution to the given scenario? i'm facing the same problem now..

19 Feb 2010, 10:18 PM
#6
lausianne avatar

lausianne

New Zenner

Join Date:
Jan 2010
Location:
Switzerland
Posts:
20
Plugin Contributions:
0

Re: Can I disable some products depending on country?

I personally don't like automatic country detection at all.
Why not use language selection to select countries?

Canada: en_can or fr_can
USA: en_us
Germany: de_ger, en_ger
Switzerland: de_ch, fr_ch, it_ch, en_ch
Rest of the world: en_row

Without a special hack, there would then be English language files for each country. And flags would not work well. Should be a dropdown selection.

It would be more convenient to be able to choose the country independently from the language, of course. There's always the alternative to have several shops. If products are managed in an external database, products can be managed in one place for all shops.

Just a few ideas.

Cheers, Ralf.