Define custom view page template with theme_hook_suggestions I would like to define 'theme_hook_suggestions' for a custom views-view.tpl.php file.

To achieve this, I wrote the following code into my template.php file:

/**
 * Implements hook_preprocess_views_view().
 */
function MYTHEME_preprocess_views_view(&amp;$variables) {
  // Some logic to decide if the hook_suggestions should set or not
  // ...
  $variables['theme_hook_suggestions'][] = 'foo';
}


After that, I created a copy of views-view.tpl.php in the templates folder named foo.tpl.php.

Sadly, my template file is ignored by Drupal and the default views-view.tpl.php file is rendered on the page. 

What's the matter? I debugged the theme_registry and the template path should be correct (points to my theme).

Update
The target is that I can switch between two template files which are defined in my preprocess function (see above). Because in some cases, my layout markup is significant different as in other cases.

I don't want to use the same template file for both cases; when I do this, the file is full of tousands of if() just for adjusting the markup for some cases.
Your approach is fine. The only problem is with the name of the hook suggestion and the equivelant tpl.php file.

Since you are preprocessing views_view the hook suggestion should be named something that starts with views_view ex: views_view__[anything]. Note that all the undersores will be replaced with dashes for the filename. So it should be something like views-view--[anything].tpl.php 

For example:

/**
 * Implements hook_preprocess_views_view().
 */
function MYTHEME_preprocess_views_view(&amp;$variables) {
  // Some logic to decide if the hook_suggestions should set or not
  // ...
  $variables['theme_hook_suggestions'][] = 'views_view__foo';
}


And the filename will be views-view--foo.tpl.php