Bobber Posted October 7, 2015 Share Posted October 7, 2015 Hi Everyone! I am having a bit of trouble trying to make a change... I am using this code on my products information page to display the manufacturer's name: $manufacturer_info_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = " . (int)$product_info['manufacturers_id'] ); $manufacturers_info = tep_db_fetch_array($manufacturer_info_query); if (tep_not_null($manufacturers_info['manufacturers_name'])) { $products_name = $product_info['products_name'] . '<br /><h3>MFG: <strong>' . $manufacturers_info['manufacturers_name'] . '</strong></h3>'; } else { $products_name = $product_info['products_name']; } I want to change this so it is not just text, but rather a clickable link that would lead to the manufacturer's complete product offerings... /index.php?manufacturers_id= For example... Any Ideas??? Link to comment Share on other sites More sharing options...
Bobber Posted May 22, 2016 Author Share Posted May 22, 2016 Here is the solution I found: <div> <?php $manufacturer_query = tep_db_query("select m.manufacturers_name, m.manufacturers_id 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);?> <?php if (tep_not_null($manufacturer['manufacturers_name'])) {echo '<h3>MFG: <strong><a href="' . tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer['manufacturers_id'] , 'NONSSL') . '">'. $manufacturer['manufacturers_name'] . '</strong></h3></a>';}?> </div> This is an original piece of code that I created and it works great for me! What this does is make the Manufacturer's Name into a clickable link. It is not underlined, but you should be able to change that depending upon your application and CSS code for your website. Once you click on the link it takes you to a product root page with all of the items associated with the manufacturer. I hope this addition is a positive contribution to your website as well :-) Link to comment Share on other sites More sharing options...
Bobber Posted May 22, 2016 Author Share Posted May 22, 2016 I created an Oscommerce Add-On for this as I believe this is a valuable contribution to this community: http://addons.oscommerce.com/info/9475 Link to comment Share on other sites More sharing options...
♥14steve14 Posted May 22, 2016 Share Posted May 22, 2016 Is this not a standard feature in all versions. There is the ability to turn on a manufacturers info box in the left or right column which shows a logo and clickable link to a page that shows all of the manufacturers products, plus a drop down to see categories that feature the manufacturers products. Whilst I am not knocking the work you did, you should really have made this into a module that needs no core code changes, and can be easily added with one click, which is the way that oscommerce is trying to head. REMEMBER BACKUP, BACKUP AND BACKUP Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.