hello,
my question was how to get the categories variable (and attributes) in the best seller , latest modules etc..
i found the tpl file catalog/view/theme/pavilion/template/tb/widget/_list_products.tpl
but i have tp change the corresponding controller file, but where is it for this oneā¦ ?
thx
|
|
Ok i finally find the file, and manage to add the categories.. here it is if it can help someone
file:
tb_themes/pavilion/catalog/plugin/ProductPlugin.php
find:
foreach ($products as &$product) {
add right afterwards:
// add categories and attribute variables
$querycats = $this->getOcModel('catalog/product')->getCategories( $product['product_id']);
$categories = array();
foreach( $querycats as $item ) {
$categ = $this->getOcModel('catalog/category')->getCategory($item['category_id']);
$catinfo['id'] = $item['category_id'];
$catinfo['name'] = $categ['name'];
$catinfo['href'] = $this->manager->getOcUrl()->link('product/category', 'path=' . $item['category_id']);
$categories[] = $catinfo;
}
$product['attribute_groups'] = $this->getOcModel('catalog/product')->getProductAttributes( $product['product_id']);
$product['categories'] = $categories;
You can then use those variables in the tpl file catalog/view/theme/pavilion/template/tb/widget/_list_products.tpl
have fun
|
|
Thanks for the share. We can use it in future versions
BR,
ThemeBurn team
|
|