I'm trying to fetch a product collection by custom attribute:
The products will be saved in the backend with this attribute, which is a multi-select field. So there will be comma separated values like AE,ES,DK. The product will be hidden in these countries. If the user is browsing from any of these countries the product will not be displayed.
I have the current country code of user browsing from:
$current_country = 'AE';
While I'm trying to filter attribute, I cannot filter the product collection as per my requirement. I tried:
.... .... ->addAttributeToFilter('hidden_countries', array('nin'=>array('finset'=>$current_country)));
Don't know how to check !finset.
Example : The database field(hidden_countries ) will hold the value as : 'AE,DK,US,ES' etc Current country based on IP address : 'DK'
i don't want to select the row(s) that have DK in the field(hidden_countries)