Is there an add-on available that will allow a manufacturer's description field that behaves like the category description field? ...I need to give manufacturer information above the product list just as I can do for categories...I need help!!
Is there an add-on available that will allow a manufacturer's description field that behaves like the category description field? ...I need to give manufacturer information above the product list just as I can do for categories...I need help!!
Not that I know off. You would need to add a manufacturers description to the manufacturers_info table and code to maintain it to the manufacturers page in admin, then extract it in the pages/index/main_template_vars.php when $_GET['manufacturers_id'} is set and then display it in tpl_index_product_list.php.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
So far I've got the back end working but I'm unsure how to extract the info and display it in the catalog. Extraction and display has been the most confusing part for me in learning the Zen Cart code base. (I'm a PHP newbie -- WordPress had me fooled in how easy it would be to hack Zen's DB/core and display the data!)
Would you please point me to (file > line number) or show me (file > )) some other file's code that extracts this info?
Thanks!
hi,.. can anyone help me on my manufacturer page? the images are not showing.. Kindly refer to this link
http://www.bestmilagechip.com/index....ain_page=index
Its not showing.. tnx ahead.. :)
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
The exact line numbers would depend upon which version of Zen Cart you are using. But basically to extract from the database you would look for the includes/modules/pages/index/main_template_vars.php and if $_GET['manufacturers_id'] is set add an additional entry to the $select_column_list variable just after the switch statement towards the bottom of the file.
You would then output it in the includes/templates/YOUR_TEMPLATE/templates/tpl_index_product_list.php file but the line number would depend upon where you wanted to position it.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Okay, I am finally back to this. And sorry that I still do not understand. Data extraction and its display confuses me. If there is another core 1.3.8a file that does all this, with line numbers pointing to each part, I am pretty sure I can solve it from there.
- How would I tell if $_GET['manufacturers_id'] is set or not?
- What additional entry would need to be added?
- And what is a switch statement?
Right. I get that. What I don't get is:
- What code outputs the info I need to display?
Thanks for any further help.
Here is a solution which adds the manufacturer's image, name and description. Works with 1.3.8a.
1. DOWNLOAD and INSTALL manufacturer_about-1.2.7 (direct link to zen cart archives zip file)
2. OPEN includes\templates\TEMPLATE_DEFAULT\templates\tpl_index_product_list.php (or your version of it)
3. FIND
4. REPLACE WITH*Code:<h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>
5. Edit CSS as necessary. I left the img spacer HTML in there because they work best for me to maintain a more rigid (pixel) flow.Code:<?php if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { $chk_manufacturers_image_query = "select m.manufacturers_image, m.manufacturers_name, m.manufacturers_id from " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = " . $_GET['manufacturers_id']; $chk_manufacturers_image = $db->Execute($chk_manufacturers_image_query); echo '<div id="mfrInfo"><div class="floatLeft"><a href="' . zen_href_link(FILENAME_MANUFACTURERS_ABOUT, 'manufacturers_about_id=' . $chk_manufacturers_image->fields['manufacturers_id']) . '">' . zen_image(DIR_WS_IMAGES . $chk_manufacturers_image->fields['manufacturers_image']) . '</a><h1 class="about"><a href="' . zen_href_link(FILENAME_MANUFACTURERS_ABOUT, 'manufacturers_about_id=' . $chk_manufacturers_image->fields['manufacturers_id']) . '">' . $chk_manufacturers_image->fields['manufacturers_name'] . '</a></h1></div>'; } ?> <?php if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { $chk_manufacturers_about_query = "select mi.manufacturers_about from " . TABLE_MANUFACTURERS_INFO . " mi where mi.manufacturers_id = " . $_GET['manufacturers_id']; $chk_manufacturers_about = $db->Execute($chk_manufacturers_about_query); echo '<div class="text">' . $chk_manufacturers_about->fields['manufacturers_about'] . '</div></div> <div><img src=images/pixel_trans.gif width="100%" height="10px" /></div>'; } ?>
*You may not want to replace Zen's more standardized H1 code. If so, remove the following:
Code:<h1 class="about"><a href="' . zen_href_link(FILENAME_MANUFACTURERS_ABOUT, 'manufacturers_about_id=' . $chk_manufacturers_image->fields['manufacturers_id']) . '">' . $chk_manufacturers_image->fields['manufacturers_name'] . '</a></h1>
Sorry to bump this post up but I have been trying to play arround with this mod but can't get it to do what I want.
I got this mod to work as explained above. But what I am trying to display the manufacturer description on the product display page under the productDetailsList. I will be switching my product display page to Tabs so it will be nice to display the manufacturer description under that tab.
I noticed the kuri is been helpful in giving information about creating this mod. It would be great if I can get a reply from him or anybody else that know how I can get this working.
I don't really care about the sidebox that came with this mod.
The code I have been working with is:Code:<?php if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { $chk_manufacturers_image_query = "select m.manufacturers_image, m.manufacturers_name, m.manufacturers_id from " . TABLE_MANUFACTURERS . " m where m.manufacturers_id = " . $_GET['manufacturers_id']; $chk_manufacturers_image = $db->Execute($chk_manufacturers_image_query); echo '<div id="mfrInfo"><div class="floatLeft"><a href="' . zen_href_link(FILENAME_MANUFACTURERS_ABOUT, 'manufacturers_about_id=' . $chk_manufacturers_image->fields['manufacturers_id']) . '">' . zen_image(DIR_WS_IMAGES . $chk_manufacturers_image->fields['manufacturers_image']) . '</a><h1 class="about"><a href="' . zen_href_link(FILENAME_MANUFACTURERS_ABOUT, 'manufacturers_about_id=' . $chk_manufacturers_image->fields['manufacturers_id']) . '">' . $chk_manufacturers_image->fields['manufacturers_name'] . '</a></h1></div>'; } ?> <?php if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { $chk_manufacturers_about_query = "select mi.manufacturers_about from " . TABLE_MANUFACTURERS_INFO . " mi where mi.manufacturers_id = " . $_GET['manufacturers_id']; $chk_manufacturers_about = $db->Execute($chk_manufacturers_about_query); echo '<div class="text">' . $chk_manufacturers_about->fields['manufacturers_about'] . '</div></div> <div><img src=images/pixel_trans.gif width="100%" height="10px" /></div>'; } ?>
You haven't actually told us what the problem you are having, and even then, it can be very difficult to debug snippets of code out of context, but things that occur to me are:
- prefix where you use $_GET['manufacturers_id'] (as opposed to just testing that it is set) with (int) for security reasons
- add "LIMIT 1" to your SQL to ensure that you are returning a single record.
- The manufacturers_info lookup should also contain a condition that matches the language to that currently in the languages SESSION variable.
- I notice that the code that you have posted opens 4 DIVs, but only closes 3.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)