Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default 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:
    Code:
      <?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';
       }
       
     ?>

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Manufacturer-link in the product_info

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

    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: v1.5.5]
    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!

  3. #3
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Manufacturer-link in the product_info

    I found this, but how can i get that manufacterer_id

    Code:
     /*
     * 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'];
      }
    Last edited by raimond; 23 Jul 2007 at 10:35 PM.

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Manufacturer-link in the product_info

    Pass the function the products_id ...
    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: v1.5.5]
    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!

  5. #5
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Manufacturer-link in the product_info

    Quote Originally Posted by Ajeh View Post
    Pass the function the products_id ...
    What do you mean by "Pass the function the products_id"

  6. #6
    Join Date
    Jul 2004
    Location
    The Netherlands, Wierden
    Posts
    430
    Plugin Contributions
    0

    Default Re: Manufacturer-link in the product_info

    solution:
    add to "modules\pages\product_info\main_template_vars.php"
    Code:
    $manufacturers_id= zen_get_products_manufacturers_id((int)$_GET['products_id']);
    after
    Code:
    $manufacturers_name= zen_get_products_manufacturers_name((int)$_GET['products_id']);
    and
    in the tpl_product_info_display.php add the code where you want:
    Code:
      <?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';
       }
       
     ?>
    My final question about this subject:
    Is there a way to overide the "modules\pages\product_info\main_template_vars.php" te exclude this for futered updates

  7. #7
    Join Date
    Sep 2005
    Location
    Hong Kong
    Posts
    307
    Plugin Contributions
    0

    Default Re: Manufacturer-link in the product_info

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

    Shirley

  8. #8
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default 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

  9. #9
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default 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: v1.5.5]
    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!

  10. #10
    Join Date
    Oct 2006
    Location
    Italy
    Posts
    634
    Plugin Contributions
    0

    Default 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

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v150 Choose product_info pages based on manufacturer filter
    By lat9 in forum General Questions
    Replies: 2
    Last Post: 5 May 2012, 07:46 PM
  2. Link issue - main_page=product_info / main_page=_info
    By Chrome Orange in forum General Questions
    Replies: 5
    Last Post: 7 May 2010, 05:34 AM
  3. where to change the manufacturer link from...
    By DarkAngel in forum General Questions
    Replies: 6
    Last Post: 11 Jan 2010, 11:48 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR