Forums / General Questions / Question regarding $manufacturers_id in tpl_product_info_display.php

Question regarding $manufacturers_id in tpl_product_info_display.php

Views: 568

Results 1 to 3 of 3
8 Jul 2013, 8:14 AM
#1
shirster avatar

shirster

Zen Follower

Join Date:
Sep 2005
Location:
Hong Kong
Posts:
301
Plugin Contributions:
0

Question regarding $manufacturers_id in tpl_product_info_display.php

Hi everyone,

In my previous shopping cart (1.3.8) I was able to use these codes in tpl_product_info_display.php to turn the manufacturer name into a link, but now that I'm using 1.5.1 the codes no longer work... It correctly turns into a link but there is nothing at the end of "index.php?main_page=index&manufacturers_id=", which means when I click on the link it redirects me to the homepage.

I'm not familiar with php so if anyone could help me out that would be greatly appreciated... thanks in advance!

<?php echo '<li>' . TEXT_PRODUCT_MANUFACTURER . '<a class="manufacturerlink" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_id) . '" title="' . $manufacturers_name . '">' . $manufacturers_name . "</a></li>\n"; ?>

Keywords: manufacturer link, clickable manufacturer name, manufacturer id

8 Jul 2013, 8:21 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,513
Plugin Contributions:
176

Re: Question regarding $manufacturers_id in tpl_product_info_display.php

Chances are your old site had made changes to the files in /includes/modules/pages/product_info/ and added code in there to retrieve the mfg value and put it into a variable named $manufacturers_id so that it could be output in your template.
You'll need to re-do that.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

9 Jul 2013, 3:59 AM
#3
shirster avatar

shirster

Zen Follower

Join Date:
Sep 2005
Location:
Hong Kong
Posts:
301
Plugin Contributions:
0

Re: Question regarding $manufacturers_id in tpl_product_info_display.php

Thank you, Dr. Byte sensei! I added this line in /includes/modules/pages/product_info/main_template_vars.php and it worked like a charm!

$manufacturers_id= zen_get_products_manufacturers_id((int)$_GET['products_id']);