Greetings,

I am trying to display 4 columns in the e-commerce product view (test.mysite.com/product) instead of the default 3.

I've tried overriding theme_product_view_collection() by creating a new entry in template.php and also changing the code in the product.module file (to $columns = 4; on line 25).

These changes are not being reflected when i go to the /product url. there are still 3 columns... )-8

what am i doing wrong??

Comments

notauseranymore’s picture

Hello,

I think what you are looking for is the theme_ecviews_product_list function provided by the contrib/ecviews module .

I created the following function in my template.php file of my theme.

function phptemplate_ecviews_product_list($view, $nodes, $type) {
  $teasers = TRUE;
  $links = TRUE;

  $rows = $row = array();
  foreach ($nodes as $count => $n) {
    $node = node_load($n->nid);
    if (!($count % 4)) {
      $rows[] = $row;
      $row = array();
    }
    $row[] = node_view($node, $teasers, FALSE, $links);
  }

  if (!empty($row)) {
    $rows[] = $row;
  }

  return theme('table', array(), $rows, array('class' => 'product-table'));
}

Hope that helps.

Christopher Hamersley
www.hemisphere3.com

slombardi’s picture

Ok..I had the same problem too.
Do I need to have views installed then if I want to use this code?
thanks