Jump to content

Features in products listing

Recommended Posts


i did the changes myself now :-)

If somebody needs the same here are the description:

1. File: category.php

Search 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.tpl

add 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'}


3. File: [your template]\css\global.css

Search for ul#product_list li {
and change height:130px; into /* height:130px;*/ or delete the line

Thats all :-)

Our result: http://lichtinnovation.tmedia-cross-communications.de/category.php?id_category=18

Best Regards


Share this post

Link to post
Share on other sites

  • 4 weeks later...
  • 5 months later...

I get error:
Warning: Invalid argument supplied for foreach() in /home/xxxxx/public_html/category.php on line 63

I 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?

Share this post

Link to post
Share on other sites

  • 2 months later...

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More