Lunara Solutions Posted June 1, 2007 Posted June 1, 2007 My problem is that I purchases a template off of Template Monster and the index page and new product page is pretty bare! I would like to know how to add the manufacturer name under the product image and also have it be linked to anything that manufacturer currently carries. Here is the code in my new_products: <td width="153" height="176" valign="top" <? if ($col!=2) echo 'class="tall_y"';?> <? if ($col!=0) echo 'style="padding-left:10px;"';?>> <a href="<?=tep_href_link('product_info.php?products_id='.$new_products['products_id'])?>"><?=tep_image(DIR_WS_IMAGES.$new_products['products_image'],$new_products['products_name'],SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT)?></a><br> <br style="line-height:7px"> <ul> <li> <a href="<?=tep_href_link('products_new.php')?>"><? printf ($new_products['products_name']);?></a><br> <strong><? printf ("$%.2f",$new_products['products_price']);?></strong> </li> </ul> <br style="line-height:9px"> <a href="<?= tep_href_link("products_new.php","action=buy_now&products_id=".$new_products['products_id'])?>"><?=tep_image_button("order.gif");?></a> </td> I'm assuming I need to call the manufacturer name from the database somewhere in here: <?php $info_box_contents = sprintf(TABLE_HEADING_NEW_PRODUCTS, strftime('%B')); if ( (!isset($new_products_category_id)) || ($new_products_category_id == '0') ) { $new_products_query = tep_db_query("select p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } else { $new_products_query = tep_db_query("select distinct p.products_id, p.products_image, p.products_tax_class_id, if(s.status, s.specials_new_products_price, p.products_price) as products_price from " . TABLE_PRODUCTS . " p left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '" . (int)$new_products_category_id . "' and p.products_status = '1' order by p.products_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS); } $row = 0; $col = 0; ?> If anyone could just take a few minutes and post the code, I would really really appreciate it. I've searched the back posts for most of the day today but haven't found what I'm looking for because of this stripped down template. Thanks so much
Lunara Solutions Posted June 1, 2007 Author Posted June 1, 2007 I found this in my functions file. Do I call this at the top of the file? and how of course: function tep_get_manufacturers($manufacturers_array = '') { if (!is_array($manufacturers_array)) $manufacturers_array = array(); $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name"); while ($manufacturers = tep_db_fetch_array($manufacturers_query)) { $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']); } return $manufacturers_array; }
Lunara Solutions Posted June 1, 2007 Author Posted June 1, 2007 I GOT IT TO WORK!!!!!! I will post what I did later on today. Now, can anyone tell me who I can add the link back in that when I click on manufacturers, it will take them to just the manufacturer's products??? I'm feeling kind of lonely over here posting to my own thread!
Recommended Posts
Archived
This topic is now archived and is closed to further replies.