You've to double check [`hook_views_query_alter()`][1] API, which say: > This hook should be placed in MODULENAME.views.inc and it will be auto-loaded. MODULENAME.views.inc must be in the directory specified by the 'path' key returned by MODULENAME_views_api(), or the same directory as the .module file, if 'path' is unspecified. So I'm guessing that you need to place it in `MODULENAME.views.inc` (unless it's already defined by Feature) and make sure that you've `MODULENAME_views_api` in the module where is your view (`collection_products`) defined. See also: [How do I use hook_views_query_alter()?][2] If it's still not working, make sure that your view doesn't have *Disable SQL rewriting* option enabled as it'll prevent node_access checks as well as other modules that implement `hook_query_alter()`. [1]: https://api.drupal.org/api/views/views.api.php/function/hook_views_query_alter/7 [2]: http://drupal.stackexchange.com/q/3869/1908