How to programmatically set views format? On install I'm trying to set my commerce_products view from table to list. Where and how do I do this? I also need to add a class to the list.

I'm a Drupal noob so if answers could be detailed that would be appreciated.
From your comments it sounds like you want to change the style_plugin from your theme.  You need to implement hook_views_default_views_alter() in your theme.

Something like this: 

function themename_views_default_views_alter(&amp;$views) {
 if (isset($views['commerce_products']) {
  $views['commerce_products']-&gt;display['default']-&gt;display_options['style_plugin'] = 'table';
 }
}


I'm not too familiar with commerce so you might not want to target the default display if that display is used elsewhere; you might just want to target the 'page' display.