Ok, I found this thread and this is just exactly, I think, what a customer of mine would like to accomplish.
She has a digital scrapbooking site that has amassed it's inventory from a bunch of contributing designers. A previous hired hand changed the english.php file to display the heading "Designers" in place of "Manufacturers". The products are all added to communal categories, but they keep track of whose is whose by using the Manufacturer function.
A customer can choose to sort the products by Designer (manufacturer).
What she is wanting to know is, the designers all have their own logo/banners and when creating their "Manufacturer" content, they want to upload their image/banner and if someone sorts by using the Manufacturer (Designer) dropdown, when that designer's name is chosen, they want their banner to display. This would be the one they uploaded as "Manufacturer's Image" in admin.
So, how do I call that on the product listing page (not product details, but the main page that lists all the designer's products)?
is this the code I would use?
function zen_get_manufacturers_image($manufacturers_id) {
global $db;
$check_manufacturers_query = "select m.manufacturers_image
from " . TABLE_MANUFACTURERS . " m
where m.manufacturers_id = '" . (int)$manufacturers_id . "'";
$check_manufacturers =$db->Execute($check_manufacturers_query);
return ($check_manufacturers->RecordCount() > 0) ? $check_manufacturers->fields['manufacturers_image'] : "";
}
and if so, will that fetch the image only if one exists? and if only sorting by manufacturer?
TIA
Jeri