******************************
/
/	Multi-SHop
/         v1.00
/    for OsCommerce MS2.2
/
******************************

Description :
-------------
Cette contribution permet de d'afficher la localisation des diffrents magasins de votre entreprise
dans votre boutique OsCommerce.
Vous pouvez dfinir le nom, l'addresse, le tlphone, le fax, un commentaire, une photo et un plan
pour chaque magasin. Une fois que vous avez crer vos magasins, chaque produit peut tre attribuer
 l'un deux. Ainsi le client peut voir dans quel magasins est localiser le produit et ainsi aller le
voir. Il peut galement rechercher tout les produits qui se trouve dans un magasins grace  une
infoBoxe et faire une recherche avanc.


Installation :
---------
Installez les fichiers incluts dans les repertoires appropri et suivez les instructions suivantes.
Puis installez le fichier multishop.sql dans votre base de donne SQL.




in : advanced_search_result.php -------------

<<-------------

after : l242
  if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
    $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
  }

insert : 

  if (isset($HTTP_GET_VARS['shop_id']) && tep_not_null($HTTP_GET_VARS['shop_id'])) {
    $where_str .= " and p.shop_id = '" . (int)$HTTP_GET_VARS['shop_id'] . "'";
  }

------------->>



in : advanced_search.php -------------

<<-------------

after : l 199
              <tr>
                <td class="fieldKey"><?php echo ENTRY_MANUFACTURERS; ?></td>
                <td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?></td>
              </tr>

insert : 
              <tr>
                <td class="fieldKey"><?php echo ENTRY_SHOPS; ?></td>
                <td class="fieldValue"><?php echo tep_draw_pull_down_menu('shop_id', tep_get_shops(array(array('id' => '', 'text' => TEXT_ALL_SHOPS)))); ?></td>
              </tr>

------------->>


nononono
in : advanced_search.php -------------

<<-------------

after :

  if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
    $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
  }

insert :

  if (isset($HTTP_GET_VARS['shops_id']) && tep_not_null($HTTP_GET_VARS['shops_id'])) {
    $where_str .= " and p.shops_id = '" . (int)$HTTP_GET_VARS['shops_id'] . "'";
  }

------------->>




in : index.php -------------

<<-------------

replace : l 127
  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']) ) {
to :
  } elseif ($category_depth == 'products' || isset($HTTP_GET_VARS['manufacturers_id']) || isset($HTTP_GET_VARS['shops_id']) ) {

=======================

after : l 172
    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
      if (isset($HTTP_GET_VARS['filter_id']) && tep_not_null($HTTP_GET_VARS['filter_id'])) {
// We are asked to show only a specific category
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' and p.products_id = p2c.products_id and pd.products_id = p2c.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['filter_id'] . "'";
      } else {
// We show them all
        $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_MANUFACTURERS . " m left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = m.manufacturers_id and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
      }
insert :
     } elseif (isset($HTTP_GET_VARS['shops_id'])) {
	  $listing_sql = "select " . $select_column_list . " p.products_id, p.manufacturers_id, p.products_price, p.products_tax_class_id, IF(s.status, s.specials_new_products_price, NULL) as specials_new_products_price, IF(s.status, s.specials_new_products_price, p.products_price) as final_price from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m on p.manufacturers_id = m.manufacturers_id, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SHOPS . " sh left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id where p.products_status = '1' and pd.products_id = p.products_id and pd.language_id = '" . (int)$languages_id . "' and p.shops_id = sh.shops_id and sh.shops_id = '" . (int)$HTTP_GET_VARS['shops_id'] . "'";

=======================

after: l 246
      if (isset($HTTP_GET_VARS['manufacturers_id'])) {
        $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";

insert:
} elseif (isset($HTTP_GET_VARS['shops_id'])) {
        $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.shops_id = '" . (int)$HTTP_GET_VARS['shops_id'] . "' order by cd.categories_name";			
      

=======================

after: l 256
        if (isset($HTTP_GET_VARS['manufacturers_id'])) {
          echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
          $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
        
insert:
} elseif (isset($HTTP_GET_VARS['shops_id'])) {
          echo tep_draw_hidden_field('shops_id', $HTTP_GET_VARS['shops_id']);
          $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
        

=======================

after: l 277
    if (isset($HTTP_GET_VARS['manufacturers_id'])) {
      $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
      $image = tep_db_fetch_array($image);
      $image = $image['manufacturers_image'];

insert :
 } elseif (isset($HTTP_GET_VARS['shops_id'])) {
      $head_temp = tep_db_query("select si.shops_image, s.shops_name from " . TABLE_SHOPS . " s, " . TABLE_SHOPS_INFO . " si where s.shops_id = '" . (int)$HTTP_GET_VARS['shops_id'] . "' and si.shops_id = s.shops_id");
      $head_temp = tep_db_fetch_array($head_temp);
      $image = $head_temp['shops_image'];
	$image_type = 'shops';
	$heading_title = $head_temp['shops_name'];
	
------------->>


in : admin\categories.php -------------

<<-------------

after: l214
$sql_data_array = array('products_quantity' => tep_db_prepare_input($HTTP_POST_VARS['products_quantity']),
                                  'products_model' => tep_db_prepare_input($HTTP_POST_VARS['products_model']),
                                  'products_price' => tep_db_prepare_input($HTTP_POST_VARS['products_price']),
                                  'products_date_available' => $products_date_available,
                                  'products_weight' => tep_db_prepare_input($HTTP_POST_VARS['products_weight']),
                                  'products_status' => tep_db_prepare_input($HTTP_POST_VARS['products_status']),
                                  'products_tax_class_id' => tep_db_prepare_input($HTTP_POST_VARS['products_tax_class_id']),
                                  'manufacturers_id' => tep_db_prepare_input($HTTP_POST_VARS['manufacturers_id'])
insert:
                                  ,
                                  'shops_id' => tep_db_prepare_input($HTTP_POST_VARS['shops_id'])

=======================

after: l359
    $parameters = array('products_name' => '',
                       'products_description' => '',
                       'products_url' => '',
                       'products_id' => '',
                       'products_quantity' => '',
                       'products_model' => '',
                       'products_image' => '',
                       'products_sound' => '',
                       'products_movie' => '',
                       'products_price' => '',
                       'products_weight' => '',
                       'products_date_added' => '',
                       'products_last_modified' => '',
                       'products_date_available' => '',
                       'products_status' => '',
                           'products_tax_class_id' => '',
                       'manufacturers_id' => ''
insert:
                       ,
                       'shops_id'=>''

=======================

after:l378
      $product_query = tep_db_query("select pd.products_name, pd.products_description, pd.products_url, p.products_id, p.products_quantity, p.products_model, p.products_image, p.products_sound,  p.products_movie, p.products_price, p.products_weight, p.products_date_added, p.products_last_modified, date_format(p.products_date_available, '%Y-%m-%d') as products_date_available, p.products_status, p.products_tax_class_id, p.manufacturers_id
insert:
, p.shops_id

=======================

after:l390
    $manufacturers_array = array(array('id' => '', 'text' => TEXT_NONE));
    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
      $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'],
                                     'text' => $manufacturers['manufacturers_name']);
    }

insert:
    $shops_array = array(array('id' => '', 'text' => TEXT_NONE));
    $shops_query = tep_db_query("select shops_id, shops_name from " . TABLE_SHOPS . " order by shops_name");
    while ($shops = tep_db_fetch_array($shops_query)) {
      $shops_array[] = array('id' => $shops['shops_id'],
                                     'text' => $shops['shops_name']);
    }

=======================

after:l511
          <tr>
            <td class="main"><?php if ($i == 0) echo TEXT_PRODUCTS_NAME; ?></td>
            <td class="main"><?php echo tep_image(DIR_WS_CATALOG_LANGUAGES . $languages[$i]['directory'] . '/images/' . $languages[$i]['image'], $languages[$i]['name']) . '&nbsp;' . tep_draw_input_field('products_name[' . $languages[$i]['id'] . ']', (isset($products_name[$languages[$i]['id']]) ? $products_name[$languages[$i]['id']] : tep_get_products_name($pInfo->products_id, $languages[$i]['id']))); ?></td>
          </tr>
<?php
    }
?>
insert:
          <tr>
            <td class="main"><?php echo TEXT_PRODUCT_SHOP; ?></td>
            <td class="main"><?php echo tep_draw_separator('pixel_trans.gif', '24', '15') . '&nbsp;' . tep_draw_pull_down_menu('shops_id', $shops_array, $pInfo->shops_id); ?></td>
          </tr>
------------->>



in : admin\includes\database_tables.php -------------

<<-------------

after : l 29
  define('TABLE_MANUFACTURERS', 'manufacturers');
  define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
insert :
  define('TABLE_SHOPS','shops');
  define('TABLE_SHOPS_INFO','shops_info');

------------->>



in : admin\includes\filenames.php --------------------

<<-------------

after :
  define('FILENAME_PRODUCTS_EXPECTED', 'products_expected.php');
  define('FILENAME_REVIEWS', 'reviews.php');
  define('FILENAME_SERVER_INFO', 'server_info.php');
  define('FILENAME_SHIPPING_MODULES', 'shipping_modules.php');
  define('FILENAME_SPECIALS', 'specials.php');
insert :
  define('FILENAME_SHOPS','shops.php');
  define('FILENAME_SHOP_INFOS','shop_infos.php');

------------->>



in : includes\database_tables.php -------------

<<-------------

after :
  define('TABLE_MANUFACTURERS', 'manufacturers');
  define('TABLE_MANUFACTURERS_INFO', 'manufacturers_info');
insert :
  define('TABLE_SHOPS','shops');
  define('TABLE_SHOPS_INFO','shops_info');

------------->>



in : includes\filenames.php ------------------------

<<-------------

after :
  define('FILENAME_REDIRECT', 'redirect.php');
  define('FILENAME_REVIEWS', 'reviews.php');
  define('FILENAME_SHIPPING', 'shipping.php');
  define('FILENAME_SHOPPING_CART', 'shopping_cart.php');
  define('FILENAME_SPECIALS', 'specials.php');
insert :
  define('FILENAME_SHOPS','shops.php');
  define('FILENAME_SHOP_INFOS','shop_infos.php');

------------->>



in : admin/includes/boxes/catalog.php -------------

<<-------------

after: l 26
                                   '<a href="' . tep_href_link(FILENAME_MANUFACTURERS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_MANUFACTURERS . '</a><br>' .
insert:
                                   '<a href="' . tep_href_link(FILENAME_SHOPS, '', 'NONSSL') . '" class="menuBoxContentLink">' . BOX_CATALOG_SHOPS . '</a><br>' .

------------->>



in : admin/includes/language/french.php -------------

<<-------------

after: l 74
define('BOX_CATALOG_MANUFACTURERS', 'Fabricants');
insert:
define('BOX_CATALOG_SHOPS', 'Magasins');

=======================

after:l 270
define('TEXT_DISPLAY_NUMBER_OF_MANUFACTURERS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> fabricants)');
insert:
define('TEXT_DISPLAY_NUMBER_OF_SHOPS', 'Affiche <b>%d</b> &agrave; <b>%d</b> (sur <b>%d</b> magasins)');

=======================

after:l 289
define('TEXT_CACHE_MANUFACTURERS', 'Bo&icirc;te fabricants');
insert:
define('TEXT_CACHE_SHOPS', 'Bo&icirc;te magasins');

------------->>



in : admin/include/language/french/categories.php -------------

<<-------------

after : l 74
define('TEXT_PRODUCT_NOT_AVAILABLE', 'Hors stock');
define('TEXT_PRODUCTS_MANUFACTURER', 'Fabricant du produit :');
define('TEXT_PRODUCTS_NAME', 'Nom du produit :');
}
insert :
define('TEXT_PRODUCT_SHOP', 'Magasin o est le produit');


------------->>



in : includes/application_top.php-------------

<<-------------

after: l 480
  } elseif (isset($HTTP_GET_VARS['manufacturers_id'])) {
    $manufacturers_query = tep_db_query("select manufacturers_name from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
    if (tep_db_num_rows($manufacturers_query)) {
      $manufacturers = tep_db_fetch_array($manufacturers_query);
      $breadcrumb->add($manufacturers['manufacturers_name'], tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id']));
    }
insert:
  } elseif (isset($HTTP_GET_VARS['shops_id'])) {
    $shops_query = tep_db_query("select shops_name from " . TABLE_SHOPS . " where shops_id = '" . (int)$HTTP_GET_VARS['shops_id'] . "'");
    if (tep_db_num_rows($shops_query)) {
      $shops = tep_db_fetch_array($shops_query);
      $breadcrumb->add(sprintf(HEADER_TITLE_SHOPS,$shops['shops_name']), tep_href_link(FILENAME_DEFAULT, 'shops_id=' . $HTTP_GET_VARS['shops_id']));
    }

------------->>



in : includes/column_left.php -------------

<<-------------

after: l14
  if ((USE_CACHE == 'true') && empty($SID)) {
    echo tep_cache_categories_box();
  } else {
    include(DIR_WS_BOXES . 'categories.php');
  }
  
insert:
  if ((USE_CACHE == 'true') && empty($SID)) {
    echo tep_cache_shops_box();
  } else {
    include(DIR_WS_BOXES . 'shops.php');
  }

------------->>



in : includes/column_right.php -------------

<<-------------

after: l 16
  if (isset($HTTP_GET_VARS['products_id'])) include(DIR_WS_BOXES . 'manufacturer_info.php');
insert:
  if (isset($HTTP_GET_VARS['products_id']) || isset($HTTP_GET_VARS['shops_id']) ) include(DIR_WS_BOXES . 'shop_info.php');

------------->>



in : includes\functions\cache.php -------------

<<-------------

after : l 117
//! Cache the manufacturers box
// Cache the manufacturers box
  function tep_cache_manufacturers_box($auto_expire = false, $refresh = false) {
    global $HTTP_GET_VARS, $language;

    $manufacturers_id = '';
    if (isset($HTTP_GET_VARS['manufactuers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
      $manufacturers_id = $HTTP_GET_VARS['manufacturers_id'];
    }

    if (($refresh == true) || !read_cache($cache_output, 'manufacturers_box-' . $language . '.cache' . $manufacturers_id, $auto_expire)) {
      ob_start();
      include(DIR_WS_BOXES . 'manufacturers.php');
      $cache_output = ob_get_contents();
      ob_end_clean();
      write_cache($cache_output, 'manufacturers_box-' . $language . '.cache' . $manufacturers_id);
    }

    return $cache_output;
  }
insert :
////
//! Cache the shops box
// Cache the shops box
  function tep_cache_shops_box($auto_expire = false, $refresh = false) {
    global $HTTP_GET_VARS, $language;

    $shops_id = '';
    if (isset($HTTP_GET_VARS['manufactuers_id']) && tep_not_null($HTTP_GET_VARS['shop_id'])) {
      $shops_id = $HTTP_GET_VARS['shop_id'];
    }

    if (($refresh == true) || !read_cache($cache_output, 'shops_box-' . $language . '.cache' . $shops_id, $auto_expire)) {
      ob_start();
      include(DIR_WS_BOXES . 'shops.php');
      $cache_output = ob_get_contents();
      ob_end_clean();
      write_cache($cache_output, 'shops_box-' . $language . '.cache' . $shops_id);
    }

    return $cache_output;
  }

------------->>



in : includes\functions\general.php -------------

<<-------------

after : l 528
  function tep_get_manufacturers($manufacturers_array = '') {
    if (!is_array($manufacturers_array)) $manufacturers_array = array();

    $manufacturers_query = tep_db_query("select manufacturers_id, manufacturers_name from " . TABLE_MANUFACTURERS . " order by manufacturers_name");
    while ($manufacturers = tep_db_fetch_array($manufacturers_query)) {
      $manufacturers_array[] = array('id' => $manufacturers['manufacturers_id'], 'text' => $manufacturers['manufacturers_name']);
    }

    return $manufacturers_array;
  }
insert :
  function tep_get_shops($shops_array = '') {
    if (!is_array($shops_array)) $shops_array = array();

    $shops_query = tep_db_query("select shop_id, shop_name from " . TABLE_SHOPS . " order by shop_name");
    while ($shops = tep_db_fetch_array($shops_query)) {
      $shops_array[] = array('id' => $shops['shop_id'], 'text' => $shops['shop_name']);
    }

    return $shops_array;
  }

------------->>



in : includes\languages\french.php -------------

<<-------------

after : l 72
// categories box text in includes/boxes/categories.php
define('BOX_HEADING_CATEGORIES', 'Cat&eacute;gories');

// manufacturers box text in includes/boxes/manufacturers.php
define('BOX_HEADING_MANUFACTURERS', 'Fabricants');

insert : 
//shops box text in includes/boxes/shops.php
define('BOX_HEADING_SHOPS','Nos Magasins');
define('BOX_TEXT_CONTENT_UP','Produits disponibles au magasin :');

=======================

after : l 115
// manufacturer box text
define('BOX_HEADING_MANUFACTURER_INFO', 'Information fabricant');
define('BOX_MANUFACTURER_INFO_HOMEPAGE', 'Page d\'accueil de %s');
define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Autres articles');

insert :
// shop box text
define('BOX_HEADING_SHOP_INFO', 'Information magasin');
define('BOX_SHOP_INFO_ADDRESSE', 'adresse :');
define('BOX_SHOP_INFO_TEL', 'tel :');
define('BOX_SHOP_INFO_OTHER_PRODUCTS', 'Autres articles de ce magasin');

------------->>



in : includes\languages\english.php -------------

<<-------------

after :
// categories box text in includes/boxes/categories.php
define('BOX_HEADING_CATEGORIES', 'Categories');

// manufacturers box text in includes/boxes/manufacturers.php
define('BOX_HEADING_MANUFACTURERS', 'Manufacturers');

insert :
//shops box text in includes/boxes/shops.php
define('BOX_HEADING_SHOPS','Shops');
define('BOX_TEXT_CONTENT_UP','Products availables at shop :');

=======================

after :
// manufacturer box text
define('BOX_HEADING_MANUFACTURER_INFO', 'Manufacturer Info');
define('BOX_MANUFACTURER_INFO_HOMEPAGE', '%s Homepage');
define('BOX_MANUFACTURER_INFO_OTHER_PRODUCTS', 'Other products');

insert :
// shop box text
define('BOX_HEADDING_SHOP_INFO', 'Shop Info');
define('BOX_SHOP_INFO_ADDRESSE', 'addresse :');
define('BOX_SHOP_INFO_OTHER_PRODUCTS', 'Other products of this shop');

------------->>



in : includes/languages/french/advanced_search.php -------------

<<-------------

after: l 24
define('ENTRY_MANUFACTURERS', 'Fabricants :');

insert:
define('ENTRY_SHOPS','Magasins : ');

=======================

after: l 34
define('TEXT_ALL_MANUFACTURERS', 'Tous fabricants');

insert:
define('TEXT_ALL_SHOPS','Tous les magasins');

------------->>



in : includes/languages/french/index.php -------------

<<-------------

after: l 18
if ( ($category_depth == 'products') || (isset($HTTP_GET_VARS['manufacturers_id']))

insert:
 || (isset($HTTP_GET_VARS['shops_id']))


=======================

after: l 35
  define('TEXT_ALL_MANUFACTURERS', 'Tous fabricants');

insert:
  define('TEXT_ALL_SHOPS','Tous les magasins');

------------->>



in : includes/modules/pruduct_listing.php -------------

<<-------------

after: l 97
            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

insert:
            } elseif (isset($HTTP_GET_VARS['shops_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'shops_id=' . $HTTP_GET_VARS['shops_id'] . '&products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a>';

=======================

after: l 127
            if (isset($HTTP_GET_VARS['manufacturers_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

insert:
            } elseif (isset($HTTP_GET_VARS['shops_id'])) {
              $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'shops_id=' . $HTTP_GET_VARS['shops_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>';

------------->>