Anonymous users "having" a country

Topics: Customizing Orchard
May 16, 2013 at 5:47 PM
I'm new to Orchard - and we're attempting to use it to build a fairly typical company website.

One wrinkle that will probably require some customization is having local content show up for visitors from that region, and I'm looking for advice on how it would be best to proceed.

The company in question operates in Canada and the USA, but the products offered in each country are different. We've got a Product content type which enumerates the different regions where the product could be available.

What I want to happen is to have a country "selector" in the top menu of the website, so unauthenticated users (i.e. website visitors) can set which country they are from (a setting stored in a cookie), and that setting would be defaulted using a geo ip lookup.

It is easy to see how (using Queries) we can filter the products, but I'm not sure how I can get the user's current country setting to be a parameter in that query.
May 16, 2013 at 6:05 PM
Interesting, and should be fairly easy. There is a module on the gallery with a Culture Layer which will let you display widgets based on the selected culture. Also you might need the same thing for Queries, either there is already a Filter for that or you can create it, should be easy to write if it doesn't exist already.
May 16, 2013 at 8:08 PM
Thank-you for the suggestion! I'll give that a shot.