tbray Posted February 21, 2004 Posted February 21, 2004 Hi! When one clicks on my product image, off you go to the product_info.php screen, which shows in bold letters at the left hand top corner the product name, and below it the product number in [brackets]. At the top right in nice big font is the price. Under the product name, I would like the program to automatically insert the Manufacturers name, in the same big letters as the product name. I'm sure this is done by adding code to the product_info file, but I'm not sure which code to add nor where I should add it. Could someone lead me out of darkness? :blink:
TerryK Posted February 21, 2004 Posted February 21, 2004 In catalog/product_info.php, look for this code: ? ?if (tep_not_null($product_info['products_model'])) { ? ? ?$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; ? ?} else { ? ? ?$products_name = $product_info['products_name']; ? ?} Replace with: ? ?if (tep_not_null($product_info['products_model'])) { ? ? ?$products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; ? ?} else { ? ? ?$products_name = $product_info['products_name']; ? ?} $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p ?where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); Then look for this code: ? ? ? ? ? ?<td class="pageHeading" valign="top"><?php echo $products_name; ?></td> Replace with: ? ? ? ? ? ?<td class="pageHeading" valign="top"><?php echo $products_name; ?><BR CLEAR="all"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT , 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">'. $manufacturer['manufacturers_name'] . '</a>'; ?></td> I wrapped the manufacturer name around a <div> class which I created in stylesheet.css so it displayed with a smaller font. You might want to play around with that. I think that'll do it! :) HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
tbray Posted February 21, 2004 Author Posted February 21, 2004 I appreciate it! Unfortunately, I'm getting this error: Parse error: parse error in /home/thomasbr/public_html/banknotes/product_info.php on line 84 :unsure:
TerryK Posted February 21, 2004 Posted February 21, 2004 Please post code from around line 75 to 100 -- can't comment on parse error without comparing to the code. Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
tbray Posted February 22, 2004 Author Posted February 22, 2004 tep_db_query("update " . TABLE_PRODUCTS_DESCRIPTION . " set products_viewed = products_viewed+1 where products_id = '" . (int)$HTTP_GET_VARS['products_id'] . "' and language_id = '" . (int)$languages_id . "'"); if ($new_price = tep_get_products_special_price($product_info['products_id'])) { $products_price = '<s>' . $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])) . '</s> <span class="productSpecialPrice">' . $currencies->display_price($new_price, tep_get_tax_rate($product_info['products_tax_class_id'])) . '</span>'; } else { $products_price = $currencies->display_price($product_info['products_price'], tep_get_tax_rate($product_info['products_tax_class_id'])); } if (tep_not_null($product_info['products_model'])) { ? ? ? $products_name = $product_info['products_name'] . '<br><span class="smallText">[' . $product_info['products_model'] . ']</span>'; ? ?} else { ? ? ?$products_name = $product_info['products_name']; ? ?} $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p ?where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); ?> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading" valign="top"><?php echo $products_name; ?><BR CLEAR="all"> <?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT , 'manufacturers_id=' . $manufacturer['manufacturers_id']) . '">'. $manufacturer['manufacturers_name'] . '</a>'; ?></td> <td class="pageHeading" align="right" valign="top"><?php echo $products_price; ?></td> </tr> </table></td> </tr> <tr> <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> Thanks :)
TerryK Posted February 22, 2004 Posted February 22, 2004 Try changing: $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); ?> to: $manufacturer_query = tep_db_query("select m.manufacturers_id, m.manufacturers_name, m.manufacturers_image from " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS . " p where p.products_id = '" . $HTTP_GET_VARS['products_id'] . "' and p.manufacturers_id = m.manufacturers_id"); $manufacturer = tep_db_fetch_array($manufacturer_query); } ?> and see if that works. (Note: I am absolutely NOT a PHP expert, so if that doesn't work, I'm not sure I'll be able to help troubleshoot it further -- I've made a number of other mods with my code, so it's hard to find just the one part to make this work, but I'm sure it's gotta be close...) HTH, Terry Terry Kluytmans Contribs Installed: Purchase Without Account (PWA); Big Images, Product Availability, Description in Product Listing, Graphical Infobox, Header Tags Controller, Login Box, Option Type Feature, plus many layout changes & other mods of my own, like: Add order total to checkout_shipment Add order total to checkout_payment Add radio buttons at checkout_shipping (for backorder options, etc.) Duplicate Table Rate Shipping Module Better Product Review Flow * If at first you don't succeed, find out if there's a prize for the loser. *
tbray Posted February 22, 2004 Author Posted February 22, 2004 Unfortunately, it did not work. :( But i want to thank you for taking the time to try and help me! :D Eventually, i'll figure it out! Cheers! Thom
Recommended Posts
Archived
This topic is now archived and is closed to further replies.