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
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
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
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....
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
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.