Forums / Templates, Stylesheets, Page Layout / Manufacturer-link in the product_info

Manufacturer-link in the product_info

Locked

Started by raimond on 23 Jul 2007, 9:22 PM · Views: 4,417

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
23 Jul 2007, 9:22 PM
#1
raimond avatar

raimond

Zen Follower

Join Date:
Jul 2004
Location:
The Netherlands, Wierden
Posts:
423
Plugin Contributions:
0

Manufacturer-link in the product_info

I want to have an image with link of my to my manufacturers products in the product_info

Like the sideboxes of manufacturers, when you click on the link you will get all the products of the manufacturer.

I've created now for the tpl_product_info.php an image with link for the manufacturers.....The image works great, but i can't get the manufacturers_id into the link.

This is what i've got:

  <?php
  
   if ($check_image = zen_get_products_manufacturers_image((int)$_GET['products_id'])) {
     echo '<a href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturer_info_sidebox->fields['manufacturers_id']) . '">' . zen_image(DIR_WS_IMAGES . $check_image) . '</a>' . "\n" ;
   } else {
     echo 'NO IMAGE';
   }
   
 ?>
23 Jul 2007, 9:24 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Manufacturer-link in the product_info

Peek in the functions_lookups.php ... there should be a function for grabbing the manufacturers_image ... :smile:

It is probably labeled something silly like:
zen_get_products_manufacturers_image

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Jul 2007, 9:31 PM
#3
raimond avatar

raimond

Zen Follower

Join Date:
Jul 2004
Location:
The Netherlands, Wierden
Posts:
423
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

I found this, but how can i get that manufacterer_id

 /*
 * Return a product's manufacturer's image, from Prod ID
 * TABLES: products, manufacturers
 */
  function zen_get_products_manufacturers_image($product_id) {
    global $db;

    $product_query = "select m.manufacturers_image
                      from " . TABLE_PRODUCTS . " p, " .
                            TABLE_MANUFACTURERS . " m
                      where p.products_id = '" . (int)$product_id . "'
                      and p.manufacturers_id = m.manufacturers_id";

    $product =$db->Execute($product_query);

    return $product->fields['manufacturers_image'];
  }

/*
 * Return a product's manufacturer's id, from Prod ID
 * TABLES: products
 */
  function zen_get_products_manufacturers_id($product_id) {
    global $db;

    $product_query = "select p.manufacturers_id
                      from " . TABLE_PRODUCTS . " p
                      where p.products_id = '" . (int)$product_id . "'";

    $product =$db->Execute($product_query);

    return $product->fields['manufacturers_id'];
  }
24 Jul 2007, 2:35 AM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Manufacturer-link in the product_info

Pass the function the products_id ... :cool:

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

25 Jul 2007, 6:44 PM
#5
raimond avatar

raimond

Zen Follower

Join Date:
Jul 2004
Location:
The Netherlands, Wierden
Posts:
423
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

Ajeh:

Pass the function the products_id ... :cool:

What do you mean by "Pass the function the products_id"

25 Jul 2007, 8:11 PM
#6
raimond avatar

raimond

Zen Follower

Join Date:
Jul 2004
Location:
The Netherlands, Wierden
Posts:
423
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

:clap:solution:
add to "modules\pages\product_info\main_template_vars.php"

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

$manufacturers_name= zen_get_products_manufacturers_name((int)$_GET['products_id']);

in the tpl_product_info_display.php add the code where you want:
<?php if ($check_image = zen_get_products_manufacturers_image((int)$_GET['products_id'])) { echo '<a class="manufacturer" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_id) . '">' . zen_image(DIR_WS_IMAGES . $check_image) . '</a>' . "\n" ; } else { echo 'NO IMAGE'; } ?>
Is there a way to overide the "modules\pages\product_info\main_template_vars.php" te exclude this for futered updates
25 Jul 2007, 8:28 PM
#7
shirster avatar

shirster

Zen Follower

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

Re: Manufacturer-link in the product_info

Thank you ! I borrowed this code to add a link to my manufacturer names :)

Shirley

22 Sep 2008, 7:18 PM
#8
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

but I've this error:
Fatal error: Call to undefined function zen_get_products_manufacturers_id() in ..../includes/modules/pages/product_info/main_template_vars.php on line 70

22 Sep 2008, 10:14 PM
#9
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Manufacturer-link in the product_info

You could be missing the function ...

Use the Tools ... Developers Tool Kit ... and search with the bottom input box for:
function zen_get_products_manufacturers_id

See what you find ...

If nothing, up in a previous post on this thread is the content of that function:
zen_get_products_manufacturers_id

You could add it to a file and put that in your:
/includes/functions/extra_functions

directory for now ...

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Sep 2008, 6:49 AM
#10
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

I did as you suggested me. in the developer kit I have not found the function, then I created a file manufacturers.php into /includes/functions/extra_functions and I copied $manufacturers_id= zen_get_products_manufacturers_id((int)$_GET['products_id']);, but the manufactures image link still don't work

23 Sep 2008, 6:55 AM
#11
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Manufacturer-link in the product_info

What does your code look like to show the manufacturers_image and what file did you put it in?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

23 Sep 2008, 7:17 AM
#12
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

as you say I've created manufactures.php and add into it this code:
$manufacturers_id= zen_get_products_manufacturers_id((int)$_GET['products_id']);
but the manufacture image link don't work, instead the function appear on very top of my website (so I deleted this new file).
if I understand your question, in template_product_info_display I've:

<?php if ($check_image = zen_get_products_manufacturers_image((int)$_GET['products_id'])) { echo '<a class="manufacturer" href="' . zen_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $manufacturers_id) . '">' . zen_image(DIR_WS_IMAGES . $check_image) . '</a>' . "\n" ; } else { echo 'NO IMAGE'; } ?>

to show the manufacturer image

23 Sep 2008, 4:53 PM
#13
100asa avatar

100asa

Totally Zenned

Join Date:
Oct 2006
Location:
Italy
Posts:
636
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

I use 4277 version of functions_lookups, and I've add this:
*

  • Return a product's manufacturer's id, from Prod ID

  • TABLES: products

*/

function zen_get_products_manufacturers_id($product_id) {

global $db;



$product_query = "select p.manufacturers_id

                  from " . TABLE_PRODUCTS . " p

                  where p.products_id = '" . (int)$product_id . "'";



$product =$db->Execute($product_query);



return $product->fields['manufacturers_id'];

}

now all work fine. thanks
and instead to have the image linked to the homepage of manufacturer?

7 Sep 2009, 2:10 PM
#14
zarenya avatar

zarenya

New Zenner

Join Date:
Sep 2009
Location:
South Africa
Posts:
9
Plugin Contributions:
0

Re: Manufacturer-link in the product_info

I am relatively very new to this type of application and definately learning all the way.

I need to know how and where I can have the Manufacturers Logos displayed on my website. I have uploaded the Logos/Names through the Admin Panel but they are not showing on my site.

They only show when I click on a product I have added to the database.

An example of what I want to achieve is here:
http://www.sonicinformed.co.za

The logos are displayed on the bottom left.

Please Assist :smile: