Dscho Posted October 20, 2008 Share Posted October 20, 2008 Hi,i want to show features instead of short description in products listing.Has somebody done this already.Best regardsDscho Link to comment Share on other sites More sharing options...
Dscho Posted October 22, 2008 Author Share Posted October 22, 2008 Hi,i did the changes myself now :-)If somebody needs the same here are the description:1. File: category.phpSearch for: $cat_products = $category->getProducts(intval($cookie->id_lang), intval($p), intval($n), $orderBy, $orderWay); add after: foreach ($cat_products as $product) { $id_lang = intval($cookie->id_lang); $id_product = $product['id_product']; $product['features'] = Db::getInstance()->ExecuteS(' SELECT name, value, pf.id_feature FROM '._DB_PREFIX_.'feature_product pf LEFT JOIN '._DB_PREFIX_.'feature_lang fl ON (fl.id_feature = pf.id_feature AND fl.id_lang = '.intval($id_lang).') LEFT JOIN '._DB_PREFIX_.'feature_value_lang fvl ON (fvl.id_feature_value = pf.id_feature_value AND fvl.id_lang = '.intval($id_lang).') WHERE pf.id_product = '.intval($id_product)); } 2. File: [your template]\product-list.tpladd a new foreach(find your own position): {foreach from=$product.features item=feature name=features} {$feature.name|escape:'htmlall':'UTF-8'}: {$feature.value|escape:'htmlall':'UTF-8'} {/foreach} 3. File: [your template]\css\global.cssSearch for ul#product_list li {and change height:130px; into /* height:130px;*/ or delete the lineThats all :-)Our result: http://lichtinnovation.tmedia-cross-communications.de/category.php?id_category=18Best RegardsDscho install.txt Link to comment Share on other sites More sharing options...
msk69 Posted October 23, 2008 Share Posted October 23, 2008 Love the idea! Thanks! Link to comment Share on other sites More sharing options...
anniebel Posted November 18, 2008 Share Posted November 18, 2008 WOW!!!! Exactly what I was searching... 2 hours spend, thank you very much for sharing your tip! Link to comment Share on other sites More sharing options...
first1 Posted May 4, 2009 Share Posted May 4, 2009 I get error: Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/category.php on line 63I have done the above change and everything works BUT: when i click on one the categories THAT HAS SUBCATEGORY (meaning it has a little + sign next to it) in the category block i get the above error on the top of the page.What am i missing? Link to comment Share on other sites More sharing options...
first1 Posted May 4, 2009 Share Posted May 4, 2009 do you think that i am getting this error because it looks for features in the subcategories and obviously there is none. how can we fix this? Link to comment Share on other sites More sharing options...
zubb33 Posted July 15, 2009 Share Posted July 15, 2009 Dscho,thanks you very much to have shared thisI've used your codes and merged it to my own needs, it works perfectly.Cya Link to comment Share on other sites More sharing options...
Recommended Posts