示例#1
0
 /**
  * GetProductBrandURLs
  *
  */
 public function GetProductBrandURLs()
 {
     $filesize = 50000;
     $filePrefix = 'products';
     $dynamicPagesFiles = array();
     $query = "\n\t\t\t\tSELECT brandid, brandname\n\t\t\t\tFROM [|PREFIX|]brands\n\t\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     //alandy_2012-2-20 modify sitemap product url.
     while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         $prodQuery = sprintf("\n\t\t\t\t\t\tSELECT prodname, brandname, prodcode,prodvendorprefix\n\t\t\t\t\t\tFROM [|PREFIX|]brands b, [|PREFIX|]products p\n\t\t\t\t\t\tWHERE p.prodbrandid=b.brandid AND brandid=%d\n\t\t\t\t\t\t", $row['brandid']);
         //echo "Deep query:<br/><font color=red>$prodQuery</font><br/>";
         $prodResult = $GLOBALS['ISC_CLASS_DB']->Query($prodQuery);
         $total_results = $GLOBALS['ISC_CLASS_DB']->CountResult($prodResult);
         $num_files = ceil($total_results / $filesize);
         for ($fileIndex = 0; $fileIndex < $num_files; $fileIndex++) {
             $categoryURLs = array();
             $newQuery = $prodQuery;
             $newQuery .= $GLOBALS['ISC_CLASS_DB']->AddLimit($fileIndex * $filesize, $filesize);
             $resultLimit = $GLOBALS['ISC_CLASS_DB']->Query($newQuery);
             $firstRow = true;
             $SKU = '';
             $vendorprefix = '';
             while ($rowSub = $GLOBALS['ISC_CLASS_DB']->Fetch($resultLimit)) {
                 if ($firstRow) {
                     $SKU = $rowSub['prodcode'];
                     $firstRow = false;
                 }
                 $url = ProdLinkSKU($rowSub['prodvendorprefix'], encode_sku($rowSub['prodcode']));
                 //$url = htmlspecialchars($url, ENT_NOQUOTES, "UTF-8");
                 array_push($categoryURLs, $url);
             }
             if ($num_files < 2) {
                 $dynamicPagesFiles[$filePrefix . '-' . preg_replace("/\\s+/", '-', strtolower($row['brandname']))] = $categoryURLs;
             } else {
                 $dynamicPagesFiles[$filePrefix . '-' . preg_replace("/\\s+/", '-', strtolower($row['brandname'])) . '-' . $SKU] = $categoryURLs;
             }
         }
     }
     return $dynamicPagesFiles;
 }
示例#2
0
 function ShowProductList($mmy_links, $params, $catg_desc_arr, $ext_links, $vq_column_title)
 {
     // dada.wang 2012-04-13 for display script
     $GLOBALS['DisplayScript'] = '';
     $displayScript = array();
     $filter_var = array('vq', 'pq');
     $path = GetConfig('ShopPath');
     $GLOBALS['AlternateClass'] = '';
     $counter = 1;
     $CurCatId = 0;
     $map_names = array();
     $display_names = array();
     $qimg_arr = array();
     $qcmt_arr = array();
     $qimg_par_arr = array();
     $qcmt_par_arr = array();
     //$GLOBALS['SearchResults'] is an array for product data.
     //while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($GLOBALS['SearchResults'])) {
     foreach ($GLOBALS["SearProductsInfos"] as $row) {
         /* Added by Simha to check inf prodcucts comes from different categories*/
         //if(empty($params['srch_category']) || !isset($params['srch_category']))
         //{
         if ($CurCatId != $row['categoryid']) {
             $CurCatId = $row['categoryid'];
             $filter_names = "SELECT DISTINCT qn.qid, qn.column_name, qn.display_names, qa.hoverimage as qimg, qa.comments as qcmt from\n                                                [|PREFIX|]qualifier_names qn\n                                                LEFT JOIN [|PREFIX|]qualifier_associations qa ON qa.qualifierid = qn.qid\n                                                WHERE (qa.categoryid = '{$CurCatId}') \n                                                AND qn.column_name regexp '^(pq|vq)'";
             // || qa.categoryid IN (SELECT catparentid FROM isc_categories WHERE categoryid = '$CurCatId')
             $filter_result = $GLOBALS['ISC_CLASS_DB']->Query($filter_names);
             while ($filter_row = $GLOBALS['ISC_CLASS_DB']->Fetch($filter_result)) {
                 $map_names[$filter_row['qid']] = $filter_row['column_name'];
                 $display_names[$filter_row['qid']] = $filter_row['display_names'];
             }
             $this->GetAssocDetails($CurCatId, $OwnAssoc, $ParentAssoc, $OwnValue, $ParentValue);
             $new_filter = "SELECT qualifierid as qid, hoverimage as qimg, comments as qcmt \n\t\t\t\t\tFROM [|PREFIX|]qualifier_associations \n\t\t\t\t\tWHERE categoryid = '{$CurCatId}'";
             $new_result = $GLOBALS['ISC_CLASS_DB']->Query($new_filter);
             while ($new_row = $GLOBALS['ISC_CLASS_DB']->Fetch($new_result)) {
                 $qimg_arr[$new_row['qid']] = $new_row['qimg'];
                 $qcmt_arr[$new_row['qid']] = $new_row['qcmt'];
             }
             $prt_filter = "SELECT c.catparentid as cpc, qa.qualifierid as qid, qa.hoverimage as qimg, qa.comments as qcmt \n\t\t\t\t\tFROM [|PREFIX|]categories as c\n\t\t\t\t\tLEFT JOIN [|PREFIX|]qualifier_associations as qa ON c.catparentid = qa.categoryid\n\t\t\t\t\tWHERE c.categoryid = '{$CurCatId}'";
             $par_result = $GLOBALS['ISC_CLASS_DB']->Query($prt_filter);
             while ($prt_row = $GLOBALS['ISC_CLASS_DB']->Fetch($par_result)) {
                 $qimg_par_arr[$prt_row['qid']] = $prt_row['qimg'];
                 $qcmt_par_arr[$prt_row['qid']] = $prt_row['qcmt'];
             }
         }
         //}
         /* Added by Simha Ends */
         $GLOBALS['SearchTrackClass'] = "TrackLink";
         $imagefile = "";
         if ($GLOBALS['AlternateClass'] == 'Odd') {
             $GLOBALS['AlternateClass'] = 'Even';
         } else {
             $GLOBALS['AlternateClass'] = 'Odd';
         }
         $qry_string = $this->GetQueryString($params);
         if ($GLOBALS['results_page_flag'] == 0 && !isset($params['srch_category'])) {
             break;
         }
         //wirror_mark_condition1
         /*if( isset($params['srch_category']) )  {
         	 $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : ''; // description will be added here to show it at the top of product listing page.
         	 }*/
         if (isset($params['category']) || !isset($params['subcategory']) && isset($params['series'])) {
             $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription'];
             //$GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter'];
             $GLOBALS['CatgBrandSeriesFooter'] = "";
             if ((isset($params['category']) || isset($params['subcategory'])) && $GLOBALS['CatgDescandBrandImage'] == "") {
                 $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : '';
                 //$GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : '';
                 $GLOBALS['CatgBrandSeriesFooter'] = "";
             }
         } else {
             if (isset($params['srch_category'])) {
                 $GLOBALS['CatgDescandBrandImage'] = isset($catg_desc_arr['catdesc']) ? $catg_desc_arr['catdesc'] : '';
                 $GLOBALS['CatgBrandSeriesFooter'] = isset($catg_desc_arr['categoryfooter']) ? $catg_desc_arr['categoryfooter'] : '';
                 if (isset($params['series']) && $row['seriesdescription'] != "") {
                     $GLOBALS['CatgDescandBrandImage'] = $row['seriesdescription'];
                     //$GLOBALS['CatgBrandSeriesFooter'] = $row['seriesfooter'];
                     $GLOBALS['CatgBrandSeriesFooter'] = "";
                 }
                 if ($GLOBALS['CatgDescandBrandImage'] == '' && $GLOBALS['CatgBrandSeriesFooter'] == '' && isset($params['brand'])) {
                     $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : '';
                     //$GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : '';
                     $GLOBALS['CatgBrandSeriesFooter'] = "";
                 }
             } else {
                 if (isset($params['brand'])) {
                     $GLOBALS['CatgDescandBrandImage'] = isset($brand_desc_arr['branddescription']) ? $brand_desc_arr['branddescription'] : '';
                     $GLOBALS['CatgBrandSeriesFooter'] = isset($brand_desc_arr['brandfooter']) ? $brand_desc_arr['brandfooter'] : '';
                 }
             }
         }
         /* No need to show footer description when YMM are selected */
         if (isset($params['make']) || isset($params['model']) || isset($params['year'])) {
             $GLOBALS['CatgBrandSeriesFooter'] = "";
         }
         $GLOBALS['ProductCartQuantity'] = '';
         if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
             $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
         }
         if ($counter % 2 == 0) {
             $GLOBALS['RowColor'] = 'grayrow';
         } else {
             $GLOBALS['RowColor'] = 'whiterow';
         }
         $counter++;
         $GLOBALS['ProductId'] = (int) $row['productid'];
         $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
         //alandy_2012-2-20 modify product url = vendorprefix_sku
         //$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
         $prodcode = encode_sku($row['prodcode']);
         $GLOBALS['ProductLink'] = ProdLinkSKU($row['prodvendorprefix'], $prodcode);
         $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
         //$GLOBALS['BrandName'] = $row['brandname'];
         /* -- The below code is added to display the brand and series logo -- */
         $GLOBALS['BrandName'] = "";
         $brandlogo = realpath(ISC_BASE_PATH . '/product_images/' . $row['brandimagefile']);
         if ($row['brandimagefile'] != '' && file_exists($brandlogo)) {
             $GLOBALS['BrandName'] .= "<img src=\"" . $GLOBALS['ShopPath'] . "/product_images/" . $row['brandimagefile'] . "\" class=\"BrandSeriesLogo\" />";
         } else {
             $GLOBALS['BrandName'] .= $row['brandname'];
         }
         $serieslogo = realpath(ISC_BASE_PATH . '/series_images/' . $row['serieslogoimage']);
         if ($row['serieslogoimage'] != '' && file_exists($serieslogo)) {
             $GLOBALS['BrandName'] .= "<br><img src=\"" . $GLOBALS['ShopPath'] . "/series_images/" . $row['serieslogoimage'] . "\" />";
         } else {
             $GLOBALS['BrandName'] .= "<br>" . $row['seriesname'];
         }
         /* --- ends --- */
         $GLOBALS['ProdCode'] = $row['prodcode'];
         //$GLOBALS['ProdDesc'] = $this->strip_html_tags($row['proddesc']);
         $GLOBALS['icon_file'] = '';
         if (isset($row['icon_file'])) {
             if (stripos($row['icon_file'], 'http://') >= 0) {
                 $GLOBALS['icon_file'] = "<img src='" . $row['icon_file'] . "' border=0 class='icon_image_class' width='125' />";
             } else {
                 $GLOBALS['icon_file'] = "<img src='" . $GLOBALS["SHOP_PATH"] . "/" . $row['icon_file'] . "' border=0 class='icon_image_class' width='125'/>";
             }
         }
         //$GLOBALS['ProductId']
         //$GLOBALS['ProdOptions'] = $row['productoption'];
         $GLOBALS['VehicleOptions'] = "";
         $GLOBALS['ProdOptions'] = "";
         foreach ($row as $key => $val) {
             if ($val != "" && $val != "~") {
                 if (($qualifier_id = array_search($key, $map_names)) !== false) {
                     if (eregi('^vq', $key)) {
                         $val = trim($val, "~");
                         $val = preg_split('/[~;]+/', $val);
                         $val = array_unique($val);
                         $val = array_values($val);
                         $val = implode(",", $val);
                         /* -- Setting display name for qualifier name -- */
                         if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') {
                             $key = $OwnAssoc[$qualifier_id][0]['qname'];
                         } else {
                             if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') {
                                 $key = $ParentAssoc[$qualifier_id][0]['qname'];
                             } else {
                                 if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) {
                                     $key = $display_names[$qualifier_id];
                                 } else {
                                     $key = ucfirst(str_ireplace($filter_var, "", $key));
                                 }
                             }
                         }
                         /* -- Setting display name for qualifier name ends -- */
                         /* -- Setting display name for qualifier value -- */
                         if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != "") {
                             $val = $OwnAssoc[$qualifier_id][$m]['vname'];
                         } else {
                             if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentAssoc[$qualifier_id][$m]['vname'] != "") {
                                 $val = $ParentAssoc[$qualifier_id][$m]['vname'];
                             }
                         }
                         /* -- Setting display name for qualifier value ends-- */
                         $qimg = $qimg_arr[$qualifier_id];
                         $qcmt = $qcmt_arr[$qualifier_id];
                         if ($qimg == '' && $qcmt == '') {
                             $qimg = $qimg_par_arr[$qualifier_id];
                             $qcmt = $qcmt_par_arr[$qualifier_id];
                         }
                         $qcmt = nl2br($qcmt);
                         $qcmt = str_replace("\n", "", $qcmt);
                         $qcmt = str_replace("\r", "", $qcmt);
                         $qcmt = str_replace('"', "&quot;", $qcmt);
                         $qcmt = str_replace("'", "\\'", $qcmt);
                         $helpdiv = "<img id='" . $qualifier_id . "' onmouseover=\"showPqVqHelp(this,255, '" . $qimg . "', '" . $qcmt . "');\" onmouseout=\"hidePqVqHelp('" . $qualifier_id . "');\" src='/images/pqvq_help.gif'/></img> ";
                         if ($qimg != '' && $qcmt != '') {
                             $GLOBALS['VehicleOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $helpdiv . $val . "</div>";
                         } else {
                             //$GLOBALS['VehicleOptions'] .= "<b>".$key."</b> : ".$val."<br>";
                             $GLOBALS['VehicleOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $val . "</div>";
                         }
                     }
                     if (eregi('^pq', $key)) {
                         $val = trim($val, "~");
                         $val = preg_split('/[~;]+/', $val);
                         $val = array_unique($val);
                         $val = array_values($val);
                         $val = implode(",", $val);
                         /* -- Setting display name for qualifier name -- */
                         if (isset($OwnAssoc[$qualifier_id]) && $OwnAssoc[$qualifier_id][0]['qname'] != '') {
                             $key = $OwnAssoc[$qualifier_id][0]['qname'];
                         } else {
                             if (isset($ParentAssoc[$qualifier_id]) && $ParentAssoc[$qualifier_id][0]['qname'] != '') {
                                 $key = $ParentAssoc[$qualifier_id][0]['qname'];
                             } else {
                                 if (isset($display_names[$qualifier_id]) && !empty($display_names[$qualifier_id])) {
                                     $key = $display_names[$qualifier_id];
                                 } else {
                                     $key = ucfirst(str_ireplace($filter_var, "", $key));
                                 }
                             }
                         }
                         /* -- Setting display name for qualifier name ends -- */
                         /* -- Setting display name for qualifier value -- */
                         if (isset($OwnValue[$qualifier_id]) && ($m = array_search(strtolower($val), $OwnValue[$qualifier_id])) !== false && $OwnAssoc[$qualifier_id][$m]['vname'] != '') {
                             $val = $OwnAssoc[$qualifier_id][$m]['vname'];
                         } else {
                             if (isset($ParentValue[$qualifier_id]) && ($m = array_search(strtolower($val), $ParentValue[$qualifier_id])) !== false && $ParentValue[$qualifier_id][$m]['vname'] != '') {
                                 $val = $ParentAssoc[$qualifier_id][$m]['vname'];
                             }
                         }
                         /* -- Setting display name for qualifier value ends-- */
                         $qimg = $qimg_arr[$qualifier_id];
                         $qcmt = $qcmt_arr[$qualifier_id];
                         if ($qimg == '' && $qcmt == '') {
                             $qimg = $qimg_par_arr[$qualifier_id];
                             $qcmt = $qcmt_par_arr[$qualifier_id];
                         }
                         $qcmt = nl2br($qcmt);
                         $qcmt = str_replace("\n", "", $qcmt);
                         $qcmt = str_replace("\r", "", $qcmt);
                         $qcmt = str_replace('"', "&quot;", $qcmt);
                         $qcmt = str_replace("'", "\\'", $qcmt);
                         $helpdiv = "<img id='" . $qualifier_id . "' onmouseover=\"showPqVqHelp(this,255, '" . $qimg . "', '" . $qcmt . "');\" onmouseout=\"hidePqVqHelp('" . $qualifier_id . "');\" src='/images/pqvq_help.gif'/></img> ";
                         if ($qimg != '' && $qcmt != '') {
                             $GLOBALS['ProdOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $helpdiv . $val . "</div>";
                         } else {
                             //$GLOBALS['ProdOptions'] .= "<b>".$key."</b> : ".$val."<br>";
                             $GLOBALS['ProdOptions'] .= "<div class='qualifierwrap'><div class='qualifiertitle'>" . $key . " :</div> " . $val . "</div>";
                         }
                     }
                 }
             }
         }
         if (isset($row['vehicleoption'])) {
             $GLOBALS['VehicleOptions'] = $row['vehicleoption'];
         }
         if (isset($row['productoption'])) {
             $GLOBALS['ProdOptions'] = $row['productoption'];
         }
         if (isset($row['catuniversal']) && $row['catuniversal'] == 1) {
             $GLOBALS['VehicleOptions'] = $GLOBALS['ProductName'];
             if ($vq_column_title == "") {
                 $vq_column_title = "Product Name";
             } else {
                 if ($vq_column_title != "Product Name") {
                     $vq_column_title = "Product Name / Vehicle";
                 }
             }
         } else {
             if ($vq_column_title == "") {
                 $vq_column_title = "Vehicle Options";
             } else {
                 if ($vq_column_title != "Vehicle Options") {
                     $vq_column_title = "Product Name / Vehicle";
                 }
             }
         }
         if (empty($GLOBALS['ProdOptions']) && empty($GLOBALS['VehicleOptions'])) {
             $GLOBALS['ProdOptions'] = "&nbsp;";
         }
         if (empty($GLOBALS['VehicleOptions'])) {
             $GLOBALS['VehicleOptions'] = "&nbsp;";
         }
         /*--- the below lines are added for back 2 search link in the product detail page. Also modified line no 56 & 60 --- */
         if ($GLOBALS['EnableSEOUrls'] == 1) {
             //alandy-2012-1-12 modify.
             //$GLOBALS['ProductLink'] .= "/refer=true".$ext_links;
             if (isset($GLOBALS['SearchId'])) {
                 //$GLOBALS['ProductLink'] .= '/SearchLogId/'.$GLOBALS['SearchId'];
                 $_SESSION['SearchLogId'] = $GLOBALS['SearchId'];
             }
         } else {
             //alandy-2012-1-12 modify.
             //$GLOBALS['ProductLink'] .= "&refer=true".$ext_links;
             if (isset($GLOBALS['SearchId'])) {
                 //$GLOBALS['ProductLink'] .= '&SearchLogId='.$GLOBALS['SearchId'];
                 $_SESSION['SearchLogId'] = $GLOBALS['SearchId'];
             }
         }
         ### Added by Simha for onsale addition
         // Determine the price of this product
         //$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
         $GLOBALS['ProductPrice'] = CalculateProductPriceRetail($row);
         $FinalPrice = $GLOBALS['ProductPrice'];
         $SalePrice = $row['prodsaleprice'];
         //$DiscountAmount = $FinalPrice;
         $discounttype = 0;
         $discountname = '';
         if ((double) $SalePrice > 0 && $SalePrice < $FinalPrice) {
             $DiscountPrice = $SalePrice;
         } else {
             $DiscountPrice = $FinalPrice;
             $DiscountPrice = CalculateDiscountPrice($FinalPrice, $DiscountPrice, $row['categoryid'], $row['brandseriesid'], $discounttype, $discountname);
             /*if($discounttype == 0)    {
             	 $DiscountPrice = $FinalPrice;
             	 }*/
         }
         /*
         foreach($DiscountInfo as $DiscountInfoSub)   {
         if(isset($DiscountInfoSub['catids']))    {
         $catids = explode(",", $DiscountInfoSub['catids']);
         foreach($catids as $catid) {
         if($catid == $row['categoryid']) {
         $DiscountAmount = $FinalPrice * ((int)$DiscountInfoSub['amount']/100);
         if ($DiscountAmount < 0) {
         $DiscountAmount = 0;
         }
         $DiscountPrice  = $FinalPrice - $DiscountAmount;
         }
         }
         }
         }
         */
         if (isset($DiscountPrice) && $DiscountPrice < $FinalPrice && $discounttype == 0) {
             //&& GetConfig('ShowOnSale')
             $GLOBALS['ProductPrice'] = '<strike>' . CurrencyConvertFormatPrice($FinalPrice) . '</strike>';
             $GLOBALS['ProductPrice'] .= '<br><div class="finalprice">' . CurrencyConvertFormatPrice($DiscountPrice) . '</div> ';
             if (strtolower($discountname) == "clearance") {
                 $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/clearance.gif" alt="">';
             } else {
                 $GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">';
             }
             if (GetConfig('ShowOnSale')) {
                 $GLOBALS['ProductPrice'] .= '' . $GLOBALS['ShowOnSaleImage'] . '';
             }
         } else {
             $GLOBALS['ProductPrice'] = '<div class="finalprice">' . CurrencyConvertFormatPrice($FinalPrice) . '</div>';
         }
         ### Added by Simha Ends
         // commented the below line by vikas
         //$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
         $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], $GLOBALS['ProductLink']);
         if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) {
             //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas
             $GLOBALS['ProductURL'] = $GLOBALS['ProductLink'];
             $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
         } else {
             //$GLOBALS['ProductURL'] = CartLink($row['productid']);
             //$GLOBALS['ProductURL'] = ProdLink($row['prodname']); // commented by vikas
             $GLOBALS['ProductURL'] = $GLOBALS['ProductLink'];
             //blessen
             if (intval($row['prodretailprice']) <= 0) {
                 //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink'); // commented by vikas on 15-7-09
                 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>";
             } else {
                 //$GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1'); // commented by vikas on 15-7-09
                 $GLOBALS['ProductAddText'] = "<img src='{$path}/templates/default/images/view.gif' border=0>";
             }
             //blessen
             // original $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
         }
         if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) {
             $GLOBALS['HideActionAdd'] = '';
         } else {
             $GLOBALS['HideActionAdd'] = 'none';
         }
         $GLOBALS['HideProductVendorName'] = 'display: none';
         $GLOBALS['ProductVendor'] = '';
         if (GetConfig('ShowProductVendorNames') && $row['prodvendorid'] > 0) {
             $vendorCache = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('Vendors');
             if (isset($vendorCache[$row['prodvendorid']])) {
                 $GLOBALS['ProductVendor'] = '<a href="' . VendorLink($vendorCache[$row['prodvendorid']]) . '">' . isc_html_escape($vendorCache[$row['prodvendorid']]['vendorname']) . '</a>';
                 $GLOBALS['HideProductVendorName'] = '';
             }
         }
         $qpvq_search = $_SESSION['searchterms']['dynfilters'];
         if (empty($qpvq_search)) {
             $GLOBALS['pqvqSearch'] = 0;
         } else {
             $GLOBALS['pqvqSearch'] = 1;
         }
         //alandy_2011-6-15 modify. add prodallowpurchase check!
         //$GLOBALS['CartURL'] = CartLink($row['productid']);
         $GLOBALS['CartURL'] = NewCartLink($row['productid'], $row['prodallowpurchases']);
         //$GLOBALS['ClickCartButton']=ClickCartButton($row['prodallowpurchases'],$row['productid']);
         //alandy_2011-12-21 modify.continue to check product attribute.
         //if(empty($GLOBALS['ClickCartButton'])){
         //$GLOBALS['ClickCartButton'] = CheckProductAttribute($row['productid']);
         //}
         if (isset($GLOBALS['SearchId'])) {
             $GLOBALS['CartURL'] .= '&SearchLogId=' . $GLOBALS['SearchId'];
         }
         $offer = $this->IsProductMakeanOffer($row['brandseriesid'], $row['brandname'], $row['categoryid']);
         if ($offer == 'yes') {
             $GLOBALS['HideOfferButton'] = 'block';
             $GLOBALS['OfferButtonLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("OfferButtonLink");
             //zcs=
         } else {
             $GLOBALS['HideOfferButton'] = 'none';
             $GLOBALS['OfferButtonLink'] = '';
             //zcs=
         }
         // dada.wang 2012.04.12 call for best price
         $callForBestPrice = GetClass('ISC_PRODUCT_HELPER')->GetProductCallForBestPrice($row);
         $GLOBALS['BestPrice'] = '';
         if ($callForBestPrice) {
             $displayScript[] = $callForBestPrice['displayScript'];
             $GLOBALS['BestPrice'] = '<div data="' . htmlspecialchars($callForBestPrice['popupMessage']) . '" onmouseover="showcallbestprice(this,385);" onmouseout="hidecallbestprice(this)"><img src="/images/call-in-trans.gif"/></div>';
         }
         $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItem");
     }
     if (!empty($displayScript) && count(array_unique($displayScript)) == 1) {
         $GLOBALS['DisplayScript'] = $displayScript[0];
     }
 }