![]() |
Re: Display manufacturer list on category page
Good point - to avoid multiple queries you can go back to the original $products array and query for the manufacturer name as well as the id. But the array he is requesting is not already there. You can either add to the query in the php or cycle through the product and manufacturers arrays to get it.
--- |
Re: Display manufacturer list on category page
Here is a way to do it by cycling through the existing product and manufacturer arrays in php and avoiding adding multiple queries. You can also do it in smarty as Cherie suggests, I just find php to be easier.
in products.php: Code:
foreach ($products as $k => $v) { In subcategories.tpl Code:
{if $manuf_this_cat} The most efficient way would be to modify the original query for $products to include the manufacturers name by joining the manufacturers table, then you would not have to cycle through the manufacturers array to get the name. But that query is built in kind of a complex way and is used in many places, so, at least for me, it would take some effort to do it and test it. --- --- |
All times are GMT -8. The time now is 11:36 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.