Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / Manufacturer description

Manufacturer description

Locked

Views: 3,766

Results 1 to 13 of 13
This thread is locked. New replies are disabled.
25 Jan 2008, 10:12 PM
#1
lbowenc avatar

lbowenc

New Zenner

Join Date:
Jan 2004
Posts:
38
Plugin Contributions:
1

Manufacturer description

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!!

25 Jan 2008, 11:43 PM
#2
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manufacturer description

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.

20 Apr 2008, 7:52 PM
#3
molywerks avatar

molywerks

Zen Follower

Join Date:
Aug 2006
Posts:
136
Plugin Contributions:
0

Re: Manufacturer description

kuroi:

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.
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!

26 Apr 2008, 12:34 PM
#5
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manufacturer description

guysoul:

hi,.. can anyone help me on my manufacturer page? the images are not showing..This is thread hijacking. You issue is different to the problem that we are trying to solve in this thread, and the intervention serves only to confuse the issue. please start a new thread for your problem.

26 Apr 2008, 12:41 PM
#6
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manufacturer description

cartguin:

Would you please point me to (file > line number) or show me (file > )) some other file's code that extracts this info?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.

20 Jun 2008, 4:21 AM
#7
molywerks avatar

molywerks

Zen Follower

Join Date:
Aug 2006
Posts:
136
Plugin Contributions:
0

Re: Manufacturer description

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.

kuroi:

...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.

  1. How would I tell if $_GET['manufacturers_id'] is set or not?
  2. What additional entry would need to be added?
  3. And what is a switch statement?

kuroi:

You would then output it in . . . /tpl_index_product_list.php
Right. I get that. What I don't get is:

  • What code outputs the info I need to display?

Thanks for any further help.

1 Jul 2008, 2:30 PM
#8
molywerks avatar

molywerks

Zen Follower

Join Date:
Aug 2006
Posts:
136
Plugin Contributions:
0

Re: Manufacturer description

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

<h1 id="productListHeading"><?php echo $breadcrumb->last(); ?></h1>
  1. REPLACE WITH*
<?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>'; 
  }  
?>
  1. 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.

*You may not want to replace Zen's more standardized H1 code. If so, remove the following:

<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>
26 Dec 2008, 3:33 AM
#9
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Manufacturer description

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: ```

<?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>'; } ?>
26 Dec 2008, 9:33 AM
#10
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Manufacturer description

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:

  1. prefix where you use $_GET['manufacturers_id'] (as opposed to just testing that it is set) with (int) for security reasons
  2. add "LIMIT 1" to your SQL to ensure that you are returning a single record.
  3. The manufacturers_info lookup should also contain a condition that matches the language to that currently in the languages SESSION variable.
  4. I notice that the code that you have posted opens 4 DIVs, but only closes 3.
26 Dec 2008, 4:08 PM
#11
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Manufacturer description

I am sorry but I was referring to post by cartguin in this thread. I have installed the manufacturer about mod, which creates a table for the manufacturer description and add a description to the manufacturer page in the admin. The way that mod works is by creating a new sidebox (Simillar to the manufacturers info plus you created) and a new page called manufacturer about page. This mod will also add a link to the manufacturer about page in the side box so you can read more about the manufacturer.

I didn't have any issues with the code. It worked just like the developer said but what I am trying to do is just display the description that was added in the admin right under the manufacturer name in the product info page in the div called productDetailsList.

I have installed your manufacturer info plus and styled to match the site so that will display the manufacturer image and a link to the manufacturer products but I want the information about the manufacturer to be displayed under the details tab (which will be added soon)

I think it would be nice if you look into the file posted in the archieve and get it to work with the latest zen cart. I noticed that alot of questions have been asked about the manufacturer description in this forum and no body added the solution to the download section yet.

Another questtion: How can I add the manufacturer name under the image in the manufacturer info plus???

28 Dec 2008, 5:01 AM
#12
coolcarpartsonline avatar

coolcarpartsonline

Totally Zenned

Join Date:
Feb 2008
Posts:
1,386
Plugin Contributions:
0

Re: Manufacturer description

Is there anyone who knows how to do it???