If this is your first visit, check our documentation. To post, register or login.
Forums / General Questions / General Questions / get manufacturer id from product

get manufacturer id from product

Started by perfumbg on 22 Oct 2012, 8:14 PM · Views: 1,326

Results 1 to 4 of 4
22 Oct 2012, 8:14 PM
#1
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Post #1 by perfumbg

Hello zenners,

I want to build internal linking from my products to their manufacturers. I am here right now i get it from old threat:

<?php //Display Manufacturer name
echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . '<b>' . TEXT_PRODUCT_MANUFACTURER . '</b><a href="' . zen_href_link(zen_get_products_manufacturers_id($product_id). FILENAME_DEFAULT,'manufacturers_id=' .'cPath=' . $_GET['manufacturers_id']). '">' . $manufacturers_name . '</a></li>' : '') . "\n"; ?>

All fine but i cant get the id of the right manufacturer. Is there a way to get the products, manufacturer ID.

Many regards

My most recent work: magprom.net

22 Oct 2012, 8:39 PM
#2
perfumbg avatar

perfumbg

Zen Follower

Join Date:
May 2010
Posts:
192
Plugin Contributions:
5

Post #2 by perfumbg

Never mind, I found my mistake. Here is what i've done

<?php //Display Manufacturer name
echo (($flag_show_product_info_manufacturer == 1 and !empty($manufacturers_name)) ? '<li>' . '<b>' . TEXT_PRODUCT_MANUFACTURER . '</b><a href="' . zen_href_link(zen_get_products_manufacturers_id($product_id). FILENAME_DEFAULT,'manufacturers_id=' . $product_info->fields['manufacturers_id']). '">' . $manufacturers_name . '</a></li>' : '') . "\n"; ?>

My most recent work: magprom.net

21 Nov 2014, 4:00 AM
#3
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Post #3 by mikeel100

Thank you...saved me some time! Was able to get rid of that silly little sidebox that pops up when on product pages. Matter of fact, I'm trying to move all sidebox functions into the center column and make my website a little cleaner on the layout!

21 Nov 2014, 5:37 AM
#4
mikeel100 avatar

mikeel100

Zen Follower

Join Date:
Sep 2012
Location:
West Jefferson, NC
Posts:
391
Plugin Contributions:
0

Post #4 by mikeel100

Do you know how to accomplish the same thing in the products_all listing?

I tried plugging the anchor part of your code into this tpl_modules_products_all_listing.php but it is not retrieving the manufacturers_id.

if (PRODUCT_ALL_LIST_MANUFACTURER != '0' and zen_get_show_product_switch($products_all->fields['products_id'], 'manufacturer')) {
$display_products_manufacturers_name = ($products_all->fields['manufacturers_name'] != '' ? TEXT_MANUFACTURER . ' ' . '<a href="' . zen_href_link(zen_get_products_manufacturers_id($product_id). FILENAME_DEFAULT,'manufacturers_id=' . $product_info->fields['manufacturers_id']). '">' . $products_all->fields['manufacturers_name'] . '</a>' . str_repeat('<br clear="all" />', substr(PRODUCT_ALL_LIST_MANUFACTURER, 3, 1)) : '');
} else {
$display_products_manufacturers_name = '';
}

I also tried replacing $product_info with $products_all but that didn't work.

I will appreciate any insight that you or anyone else can provide.