View Single Post
  #12  
Old 03-24-2012, 10:38 PM
 
Powertrain Powertrain is offline
 

Senior Member
  
Join Date: Mar 2011
Posts: 101
 

Default Re: Display manufacturer list on category page

Quote:
Originally Posted by gb2world
You will need to make an array of the manufacturers unique to that category. Try something like:
In products.php:
Code:
foreach ($products as $k => $v) { $manuf_this_cat[$products[$k]['manufacturerid']] = $manuf_this_cat[$products[$k]['manufacturerid']]+1; } $smarty->assign('manuf_this_cat',$manuf_this_cat);

Then in the template, probably subcategories.php, you can go through that array:
Code:
{if $manuf_this_cat} <hr /> <ul> {foreach from=$manuf_this_cat key=k item=v} <li> manufacturerid:{$k}<br /> number items this cat:{$v}<br /> name: {$manufacturers.$k.manufacturer}<br /> </li> {/foreach} </ul> <hr /> {/if}

We are getting somewhere now

That code display this list in array:
  • manufacturerid:4
    number items this cat:6
    name: Dodge
  • manufacturerid:5
    number items this cat:1
    name: Ford
Now we need to display those manufacturers as links with name as anchor text?

Thanks.
__________________
x-cart 4.4.2 Gold
Reply With Quote