Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2013
    Location
    france
    Posts
    2
    Plugin Contributions
    0

    Default Bring Manufacturer URL to the top of Product Listing for a specific Manufacturer

    I am desperately trying to bring up Manufacturer URL from Manufacturers_Info file to Product Listing when listing for a specific Manufacturer. The URL should show at the top of the listing. If anyone has an idea to solve this problem or if done earlier by anybody ?

  2. #2
    Join Date
    Jul 2012
    Posts
    16,732
    Plugin Contributions
    17

    Default Re: Bring Manufacturer URL to the top of Product Listing for a specific Manufacturer

    New file:

    includes/modules/pages/product_info/main_template_vars_manufacturers.php
    Code:
    <?php
    /**
     * This file provides the URI of the manufacturer that is associated with this product
     *  permitting display to be based on a specific manufacturer or group of manufacturers.
     *  mc12345678 3/21/2017
     **/
    
      $man_array = array(1,2); // values correspond to manufacturers_id and are those that are to be displayed.
    
      $man_url = '';
    
      if (in_array(zen_get_products_manufacturers_id((int)$_GET['products_id']), $man_array) {
    
         $man_sql = 'SELECT manufacturers_url FROM ' . TABLE_MANUFACTURERS_INFO .  ' WHERE manufacturers_id = :manufacturers_id: AND languages_id =  :languages_id: LIMIT 1';
        $man_sql = $db->bindVars($man_sql,  ':manufacturers_id:',  zen_get_products_manufacturers_id((int)$_GET['products_id']),  'integer');
        $man_sql = $db->bindVars($man_sql, ':languages_id:', (isset($_SESSION['languages_id']) ? $_SESSION['languages_id'] : 1),  'integer');
    
        $man = $db->Execute($man_sql);
    
        foreach ($man as $manurl) {
           $man_url = $manurl['manufacturers_url']; // if this is used in pre  ZC 1.5.5, then need to modify this to be a loop on while(!$man->EOF)  and that $man_url = $man->fields['manufacturers_url']
        }
      }
    Then inside of your includes/templates/YOUR_TEMPLATE/templates/tpl_product_info_default.php

    Locate where you would like to have this URL presented and can then add within the "HTML space":
    Code:
    <!-- BOF Manufacturer's URL -->
    <?php if (zen_not_null($man_url)) {
    ?><a href="<?php echo $man_url; ?>"><?php echo $man_url; ?></a><?php
     }
    ?><!-- EOF Manufacturer's URL -->
    Which will only create a clickable link of the url with the url presented. Change the second echo to whatever is desired to be displayed to the user and add any class, span, div, etc other tags around or within the link as applicable.

    If you use other product types (document, music, etc...) then the same file above and similar modification would need to be applied to the applicable file type folder and template file.
    Last edited by mc12345678; 21 Mar 2017 at 07:43 PM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  3. #3
    Join Date
    Nov 2013
    Location
    france
    Posts
    2
    Plugin Contributions
    0

    Default Re: Bring Manufacturer URL to the top of Product Listing for a specific Manufacturer

    Thanks but what I am looking for is the equivalent for tpl_modules_product_listing which list products by category or manufacturer. And for manufacturer products list
    I have done the following but it does not work ...

    PHP Code:
    <?php
    // FRCO 2016-11-19 manufacturer description from manufacturer url
     
    if (isset($_GET['manufacturers_id']) && $_GET['manufacturers_id'] > 0) { 
        
    $manufacturer_description $db->Execute("select m.manufacturer_url from " TABLE_MANUFACTURER " m where m.manufacturer_id='" GET['manufacturers_id'] . "'");
       if (
    $manufacturer_description->RecordCount() > 0) {
      
    $current_manufacturer_description $manufacturer_description->fields['manufacturer_url'];
        }
    ?>
    <div id="indexProductListCatDescription" class="content"><?php echo $current_manufacturer_description;  ?></div><br/>
    <?php // manufacturer_description ?>

 

 

Similar Threads

  1. Display manufacturer image on top of product index listing page
    By Thannaree in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 4 Oct 2012, 12:49 PM
  2. Add Manufacturer image to Manufacturer product page
    By vito in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 23 Jul 2010, 05:05 PM
  3. Add manufacturer to the product listing in admin
    By lismith in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 16 Nov 2008, 01:34 PM
  4. Adding Manufacturer Logo on top of a product listing
    By EC Junior in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 23 Feb 2008, 10:43 AM
  5. Manufacturer URL on the Product Display page
    By PaulineNMU in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 27 Dec 2006, 05:44 PM

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