Drupal 7, commerce kickstart2.
Need to create a view with ContentType ProductDisplay. ProductDisplay has field Product. A Product has multiple field of a Country type.
User object has a property Country filed by IP2Country Module. The view need to show only products with user’s country.
View: type=page, link= /products (no other arguments in url expected), added releation Product
Here what I tried
- Created Contextual filter: "Product: Country List (indexed)". Had to add index to this field so it can be select in contextual filter
- Configured default argument for the "When the filter value is NOT in the URL". By using "hook_views_plugins" created "Current user's Country name" argument type. It is working and providing correct argument value - user’s country
Didn’t manage to make it work. Also, tried some other things and spent few hours browsing web for a possible solution. Didn't find any similar problems or solution. There’re many examples with taxonomy terms and url args.
As a plan B, think to create view for every country and override main view, but don't like it
Is a better solution to the task possible?