Jump to content

Manufacturer filter in product list


djpaul

Recommended Posts

Hey hello!

I am busy to create a dropdown menu where all manufacturers exist in the selected category.

When you select a manufacturer, it must show all products from that specified manufacturer.

But I am stuck. As far as I can see I have to make the dropdown menu in the product-list.tpl.

So now I made an foreach in there and all i get was 15 times the same manufacturer. And he has to show all the manufacturers in that category (even if there are more pages).

 

Where can i put the loop in php to get all manufacurers?

 

I saw more of these questions but they where all older and i use 1.4.7.3.

 

I have this idea:

$manufacturers = array();
foreach ($products as $mf){
 if(!key_exists($manufacturers){
  $manufacturers = $mf['manufacturer_name'];
 }
}

 

Well, any help would be apreciated!

 

Regards,

Paul

Link to comment
Share on other sites

Hi,

 

You can have it in product_list.tpl but not in the foreach named 'products'.

 

That code makes no sense.

 

You need to make sure the manufacturer id is selected from the database, add id, if not exists, to an array, get manufacturer name, assign it to smarty, process it in the tpl file.

 

Also you will need to create the code to display products only from that manufacturer within the category.

Link to comment
Share on other sites

Hey Cart expert. i know that doesn't make a lot of sense, but the meaning is that that type of code must come into a php file.

But I am not sure which php creates the products that are in the product list.

If i do, then I can see what i need to do. Or do you have any examples that will do the job?

 

Thanks!

Paul

Edited by djpaul (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...