Monday, July 6, 2015

Programmatically create view mode for product in Drupal Commerce

1. First create the view mode by using the following hook or Entity View Mode module. 

2. Then create the template file commerce-product--product--{view-mode}.tpl.php
3. Inside the template file, you can render what ever you want.
4. Then clear the cache.