当前位置: 首页>>代码示例>>PHP>>正文


PHP VendorLink函数代码示例

本文整理汇总了PHP中VendorLink函数的典型用法代码示例。如果您正苦于以下问题:PHP VendorLink函数的具体用法?PHP VendorLink怎么用?PHP VendorLink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了VendorLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: SetPanelSettings

 public function SetPanelSettings()
 {
     if (!gzte11(ISC_HUGEPRINT)) {
         $this->DontDisplay = true;
         return false;
     }
     $output = "";
     // Get the link to the 'all vendors' page
     $GLOBALS['AllVendorsLink'] = VendorLink();
     // Get the 10 most popular vendors
     $query = "\n\t\t\tSELECT vendorid, vendorname, vendorfriendlyname\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tORDER BY vendornumsales DESC, vendorname ASC\n\t\t";
     $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 11);
     // Fetch 10 + 1 - so that way we can determine if we need the all vendors link
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     $x = 1;
     while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         if ($x <= 10) {
             $GLOBALS['VendorLink'] = VendorLink($row);
             $GLOBALS['VendorName'] = isc_html_escape($row['vendorname']);
             $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PopularVendorsItem");
         }
         ++$x;
     }
     if ($x == 11) {
         $GLOBALS['SNIPPETS']['ShopByVendorAllItem'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("PopularVendorsAllItem");
     }
     if (!$output) {
         $this->DontDisplay = true;
     }
     $GLOBALS['SNIPPETS']['PopularVendorsList'] = $output;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:31,代码来源:SidePopularVendors.php

示例2: getTree

	/**
	* Generates a sitemap tree for the vendors model based on the vendors table
	*
	* @param int $limit
	* @param int $offset
	* @return ISC_SITEMAP_NODE
	*/
	public function getTree($limit = null, $offset = null)
	{
		$root = new ISC_SITEMAP_ROOT();

		if (!gzte11(ISC_HUGEPRINT)) {
			return $root;
		}

		$sql = "SELECT vendorid, vendorname, vendorfriendlyname FROM `[|PREFIX|]vendors` ORDER BY vendorname ASC";

		if ($limit && $offset) {
			$sql .= " LIMIT " . $offset . "," . $limit;
		} else if ($limit) {
			$sql .= " LIMIT " . $limit;
		}

		$result = $GLOBALS['ISC_CLASS_DB']->Query($sql);

		while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
			$label = $row['vendorname'];
			$url = VendorLink($row);

			$node = new ISC_SITEMAP_NODE($url, $label);
			$root->appendChild($node);
		}

		return $root;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:35,代码来源:class.sitemap.model.vendors.php

示例3: SetPanelSettings

 function SetPanelSettings()
 {
     // Build the breadcrumb trail to this page
     $parentlist = $GLOBALS['ISC_CLASS_PAGE']->GetPageParentList();
     $pageid = $GLOBALS['ISC_CLASS_PAGE']->GetPageId();
     if (isset($GLOBALS['ISC_CLASS_VENDORS'])) {
         $vendor = $GLOBALS['ISC_CLASS_VENDORS']->GetVendor();
     } else {
         $vendor = array();
     }
     $GLOBALS['SNIPPETS']['PageBreadcrumb'] = '';
     if ($parentlist != '') {
         $query = sprintf("SELECT pageid, pagetitle, pagelink, pagetype, pageparentid FROM [|PREFIX|]pages WHERE pageid IN (%s) OR pageid='%d'", $parentlist, $pageid);
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $parentPages[$row['pageid']] = $row;
         }
         // Now we have the list we can generate the breadcrumb trail
         $parentid = $pageid;
         do {
             if (!isset($parentPages[$parentid])) {
                 break;
             }
             $page = $parentPages[$parentid];
             $GLOBALS['CatTrailName'] = isc_html_escape($page['pagetitle']);
             // Is it a normal page, external page or RSS feed?
             switch ($page['pagetype']) {
                 case 0:
                 case 2:
                 case 3:
                     // Normal Page or RSS feed
                     $GLOBALS['CatTrailLink'] = PageLink($page['pageid'], $page['pagetitle'], $vendor);
                     break;
                 case 1:
                     // External Link
                     $GLOBALS['CatTrailLink'] = $page['pagelink'];
                     break;
             }
             if ($parentid == $pageid) {
                 $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItemCurrent");
             } else {
                 $item = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem");
             }
             $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $item . $GLOBALS['SNIPPETS']['PageBreadcrumb'];
             $parentid = $page['pageparentid'];
         } while ($parentid != 0);
     }
     if (!empty($vendor)) {
         $GLOBALS['CatTrailName'] = isc_html_escape($vendor['vendorname']);
         $GLOBALS['CatTrailLink'] = VendorLink($vendor);
         $GLOBALS['SNIPPETS']['PageBreadcrumb'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BreadcrumbItem") . $GLOBALS['SNIPPETS']['PageBreadcrumb'];
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:53,代码来源:PageBreadcrumb.php

示例4: SetPanelSettings

 /**
  * Set the panel settings.
  */
 public function SetPanelSettings()
 {
     $GLOBALS['SNIPPETS']['VendorList'] = '';
     $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]vendors\n\t\t\tORDER BY vendorname ASC\n\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     while ($vendor = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         $GLOBALS['VendorId'] = $vendor['vendorid'];
         $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']);
         $GLOBALS['VendorLink'] = VendorLink($vendor);
         $GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor);
         $GLOBALS['SNIPPETS']['VendorList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('VendorListItem');
     }
     if (!$GLOBALS['SNIPPETS']['VendorList']) {
         $this->DontDisplay = true;
         return false;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:20,代码来源:VendorList.php

示例5: SetPanelSettings

 public function SetPanelSettings()
 {
     if (isset($GLOBALS['ISC_CLASS_PRODUCT'])) {
         $vendor = GetClass('ISC_PRODUCT')->GetProductVendor();
     } else {
         $cVendor = GetClass('ISC_VENDORS');
         $vendor = $cVendor->GetVendor();
     }
     $GLOBALS['VendorName'] = isc_html_escape($vendor['vendorname']);
     $GLOBALS['VendorHomeLink'] = VendorLink($vendor);
     $GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor);
     // Does this vendor have any products?
     $query = "\n\t\t\tSELECT productid\n\t\t\tFROM [|PREFIX|]products\n\t\t\tWHERE prodvendorid='" . (int) $vendor['vendorid'] . "'\n\t\t\tLIMIT 1\n\t\t";
     $hasProducts = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
     if (!$hasProducts) {
         $GLOBALS['HideVendorProductsLink'] = 'display: none';
     }
     // Fetch out any pages belonging to this vendor to show in the menu
     $GLOBALS['PageLinks'] = '';
     // If the customer is not logged in then they can only see pages that aren't restricted to 'customers only'
     $customersOnly = '';
     $GLOBALS['ISC_CLASS_CUSTOMER'] = GetClass('ISC_CUSTOMER');
     if (!$GLOBALS['ISC_CLASS_CUSTOMER']->GetCustomerId()) {
         $customersOnly = ' AND pagecustomersonly=0';
     }
     // Fetch any pages that this page is a parent of
     $query = "\n\t\t\tSELECT *\n\t\t\tFROM [|PREFIX|]pages\n\t\t\tWHERE pagestatus='1' AND pageparentid='0' AND pagevendorid='" . (int) $vendor['vendorid'] . "' " . $customersOnly . "\n\t\t\tORDER BY pagesort ASC, pagetitle ASC\n\t\t";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     while ($page = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         $GLOBALS['PageName'] = isc_html_escape($page['pagetitle']);
         // Is it a normal page, external page or RSS feed?
         switch ($page['pagetype']) {
             case 0:
             case 2:
             case 3:
                 // Normal Page or RSS feed
                 $GLOBALS['PageLink'] = PageLink($page['pageid'], $page['pagetitle'], $vendor);
                 break;
             case 1:
                 // External Link
                 $GLOBALS['PageLink'] = $page['pagelink'];
                 break;
         }
         $GLOBALS['PageLinks'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SidePageLink');
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:46,代码来源:SideVendorPageList.php

示例6: SetPanelSettings


//.........这里部分代码省略.........
                 ### 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'] = '';
                     }
                 }
                 $GLOBALS['CartURL'] = CartLink($row['productid']);
                 $offer = $this->IsProductMakeanOffer($row['brandseriesid'], $row['brandname'], $row['categoryid']);
                 if ($offer == 'yes') {
                     $GLOBALS['HideOfferButton'] = 'block';
                 } else {
                     $GLOBALS['HideOfferButton'] = 'none';
                 }
                 $GLOBALS['SearchResultList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubCategoryProductsItem");
             } else {
                 if ($GLOBALS['results_page_flag'] == 0) {
                     $mmy_links_modified = $mmy_links;
                     if (!isset($GLOBALS['ISC_SRCH_CATG_ID'])) {
                         $parentid = $GLOBALS['categories_all'][$row['categoryid']]['catparentid'];
                         if ($parentid != 0) {
                             if (isset($GLOBALS['categories_all'][$parentid])) {
                                 // if parent catg is not visible
                                 $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$parentid]['catname'])) . $mmy_links;
                             } else {
                                 $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links;
                             }
                         } else {
                             $mmy_links_modified = "/" . MakeURLSafe(strtolower($GLOBALS['categories_all'][$row['categoryid']]['catname'])) . $mmy_links;
                         }
                     }
                     $subcatg_link = $this->LeftCatLink($mmy_links_modified, 'subcategory', $row['catname']);
                     $link = "<a href='" . $subcatg_link . "'>";
                     $tiplink = "<a class='thickbox1' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "'  title=''><img src='{$path}/templates/default/images/fastlook_red.gif' border=0></a>";
                     $imagelink = "<a class='thickbox' href='" . $GLOBALS['ShopPath'] . "/catgbrand.php?categoryid=" . $row['categoryid'] . "&url=" . urlencode($subcatg_link) . "' title='' onmouseover='createtip(" . $row['categoryid'] . ")' onmouseout='UnTip()'>";
                     //$imagelink = "<a href='".$GLOBALS['ShopPath']."/catgbrand.php?categoryid=".$row['categoryid']."&url=$subcatg_link' class='thickbox' title=''>";
开发者ID:nirvana-info,项目名称:old_bak,代码行数:67,代码来源:SearchPage_bakup.php

示例7: SetPanelSettings

 public function SetPanelSettings()
 {
     $GLOBALS['HideProductErrorMessage'] = 'display:none';
     if (isset($_SESSION['ProductErrorMessage']) && $_SESSION['ProductErrorMessage'] != '') {
         $GLOBALS['HideProductErrorMessage'] = '';
         $GLOBALS['ProductErrorMessage'] = $_SESSION['ProductErrorMessage'];
         unset($_SESSION['ProductErrorMessage']);
     }
     $GLOBALS['ProductCartQuantity'] = '';
     if (isset($GLOBALS['CartQuantity' . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId()])) {
         $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId()];
     }
     //temp script to shortern the product name
     $pid = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId();
     $querytemp = "SELECT prodbrandid FROM  [|PREFIX|]products where productid = " . $pid . "  ";
     $resulttemp = $GLOBALS['ISC_CLASS_DB']->Query($querytemp);
     $brand = $GLOBALS['ISC_CLASS_DB']->Fetch($resulttemp);
     if ($brand['prodbrandid'] == 37) {
         $querytemp1 = "SELECT c.catname, c.catcombine FROM [|PREFIX|]categories \tc left join [|PREFIX|]categoryassociations ca on c.categoryid = ca.categoryid  left join [|PREFIX|]products p on ca.productid = p.productid where p.productid =  '" . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "' ";
         $resulttemp1 = $GLOBALS['ISC_CLASS_DB']->Query($querytemp1);
         $cat = $GLOBALS['ISC_CLASS_DB']->Fetch($resulttemp1);
         if ($cat['catcombine'] != "") {
             $GLOBALS['ProductName'] = $cat['catcombine'] . " Part Number " . isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetSKU());
         } else {
             $GLOBALS['ProductName'] = $cat['catname'] . " Part Number " . isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetSKU());
         }
     } else {
         $GLOBALS['ProductName'] = isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName());
     }
     //temp script to shortern the product name
     //$GLOBALS['ProductName'] = isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName());
     $GLOBALS['ProductId'] = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId();
     $GLOBALS['ProductPrice'] = '';
     // Get the vendor information
     $vendorInfo = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductVendor();
     $GLOBALS['HideVendorDetails'] = 'display: none';
     $GLOBALS['VendorName'] = '';
     if (is_array($vendorInfo)) {
         //$GLOBALS['HideVendorDetails'] = '';
         $GLOBALS['VendorName'] = '<a href="' . VendorLink($vendorInfo) . '">' . isc_html_escape($vendorInfo['vendorname']) . '</a>';
     }
     // Can this product be gift wrapped? And do we have any gift wrapping options set up?
     if ($GLOBALS['ISC_CLASS_PRODUCT']->CanBeGiftWrapped() && $GLOBALS['ISC_CLASS_PRODUCT']->GetProductType() == PT_PHYSICAL) {
         $GLOBALS['HideGiftWrapMessage'] = '';
         $GLOBALS['GiftWrappingAvailable'] = GetLang('GiftWrappingOptionsAvailable');
     } else {
         $GLOBALS['HideGiftWrapMessage'] = 'display: none';
     }
     $thumb = '';
     $GLOBALS['ImagePopupJavascript'] = "showProductImageNew('" . $this->ProdImageLink($GLOBALS['ProductId']) . "', 0, 0);";
     //$GLOBALS['VideoPopupJavascript'] =  "showProductVideoNew('".GetConfig('ShopPath')."/productvideo.php', ".$GLOBALS['ProductId'].");";
     $GLOBALS['VideoPopupJavascript'] = "showProductVideoNew('" . $this->ProdVideoLink($GLOBALS['ProductId']) . "');";
     //$GLOBALS['AudioPopupJavascript'] =  "showProductVideoNew('".GetConfig('ShopPath')."/productaudio.php', ".$GLOBALS['ProductId'].");";
     $GLOBALS['AudioPopupJavascript'] = "showProductVideoNew('" . $this->ProdAudioLink($GLOBALS['ProductId']) . "');";
     // If we're showing images as a lightbox, we need to load up the URLs for the other images for this product
     if (GetConfig('ProductImageMode') == 'lightbox') {
         $GLOBALS['AdditionalStylesheets'] = array(GetConfig('ShopPath') . '/javascript/jquery/plugins/lightbox/lightbox.css');
         $GLOBALS['LightBoxImageList'] = '';
         $query = "\n\t\t\t\t\tSELECT imagefile\n\t\t\t\t\tFROM [|PREFIX|]product_images\n\t\t\t\t\tWHERE imageprodid='" . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "' AND imageisthumb=0\n\t\t\t\t\tORDER BY imagesort ASC\n\t\t\t\t";
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         while ($image = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $GLOBALS['LightBoxImageList'] .= '<a ';
             $GLOBALS['LightBoxImageList'] .= 'href="' . $GLOBALS['ShopPath'] . '/' . GetConfig('ImageDirectory') . '/' . $image['imagefile'] . '" ';
             $GLOBALS['LightBoxImageList'] .= 'title="' . isc_html_escape($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName()) . '"';
             $GLOBALS['LightBoxImageList'] .= '>&nbsp;</a>';
         }
         $GLOBALS['ImagePopupJavascript'] = "showProductImageLightBox(); return false;";
         $GLOBALS['LightBoxImageJavascript'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ProductImagesLightBox');
     }
     // Is there a thumbnail image we can show?
     $thumb = $GLOBALS['ISC_CLASS_PRODUCT']->GetThumb();
     $thumbImage = '';
     if ($thumb == '' && GetConfig('DefaultProductImage') != '') {
         if (GetConfig('DefaultProductImage') == 'template') {
             $thumb = GetConfig('ShopPath') . '/templates/' . GetConfig('template') . '/images/ProductDefault.gif';
         } else {
             $thumb = GetConfig('ShopPath') . '/' . GetConfig('DefaultProductImage');
         }
         $thumbImage = '<img src="' . $thumb . '" alt="" />';
     } else {
         if ($thumb != '') {
             $thumbImage = '<img src="' . GetConfig('ShopPath') . '/' . GetConfig('ImageDirectory') . '/' . $thumb . '" alt="" />';
         }
     }
     // Is there more than one image? If not, hide the "See more pictures" link
     if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumImages() == 0) {
         $GLOBALS['HideMorePicturesLink'] = "none";
         $GLOBALS['ThumbImage'] = $thumbImage;
     } else {
         $GLOBALS['ThumbImage'] = '<a href="#" onclick="' . $GLOBALS['ImagePopupJavascript'] . '">' . $thumbImage . '</a>';
         if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumImages() == 2) {
             $var = "MorePictures1";
         } else {
             if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumImages() == 1) {
                 $var = "SeeLargerImage";
             } else {
                 $var = "MorePictures2";
             }
         }
         $GLOBALS['SeeMorePictures'] = sprintf(GetLang($var), $GLOBALS['ISC_CLASS_PRODUCT']->GetNumImages() - 1);
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:ProductDetails_9_2.php

示例8: setProductGlobals

	public function setProductGlobals($row)
	{
		if($GLOBALS['AlternateClass'] == 'Odd') {
			$GLOBALS['AlternateClass'] = 'Even';
		}
		else {
			$GLOBALS['AlternateClass'] = 'Odd';
		}

		$GLOBALS['ProductCartQuantity'] = '';
		if(isset($GLOBALS['CartQuantity'.$row['productid']])) {
			$GLOBALS['ProductCartQuantity'] = (int)$GLOBALS['CartQuantity'.$row['productid']];
		}

		$GLOBALS['ProductId'] = (int)$row['productid'];
		$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
		$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
		$GLOBALS['ProductRating'] = (int)$row['prodavgrating'];

		// Determine the price of this product
		$GLOBALS['ProductPrice'] = '';
		if (GetConfig('ShowProductPrice') && !$row['prodhideprice']) {
			$GLOBALS['ProductPrice'] = formatProductCatalogPrice($row);
		}

		// Workout the product description
		$desc = strip_tags($row['proddesc']);

		if (isc_strlen($desc) < 120) {
			$GLOBALS['ProductSummary'] = $desc;
		} else {
			$GLOBALS['ProductSummary'] = isc_substr($desc, 0, 120) . "...";
		}

		$GLOBALS['ProductThumb'] = ImageThumb($row, ProdLink($row['prodname']));
		$GLOBALS['ProductDate'] = isc_date(GetConfig('DisplayDateFormat'), $row['proddateadded']);

		$GLOBALS['ProductPreOrder'] = false;
		$GLOBALS['ProductReleaseDate'] = '';
		$GLOBALS['HideProductReleaseDate'] = 'display:none';

		if ($row['prodpreorder']) {
			$GLOBALS['ProductPreOrder'] = true;
			if ($row['prodreleasedate'] && $row['prodreleasedateremove'] && time() >= (int)$row['prodreleasedate']) {
				$GLOBALS['ProductPreOrder'] = false;
			} else if ($row['prodreleasedate']) {
				$GLOBALS['ProductReleaseDate'] = GetLang('ProductListReleaseDate', array('releasedate' => isc_date(GetConfig('DisplayDateFormat'), (int)$row['prodreleasedate'])));
				$GLOBALS['HideProductReleaseDate'] = '';
			}
		}

		if (isId($row['prodvariationid']) || trim($row['prodconfigfields'])!='' || $row['prodeventdaterequired'] == 1) {
			$GLOBALS['ProductURL'] = ProdLink($row['prodname']);
			$GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
		} else {
			$GLOBALS['ProductURL'] = CartLink($row['productid']);
			if ($GLOBALS['ProductPreOrder']) {
				$GLOBALS['ProductAddText'] = GetLang('ProductPreOrderCartLink');
			} else {
				$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'] = '';
			}
		}
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:80,代码来源:products_panel.php

示例9: ShowProductList


//.........这里部分代码省略.........
         $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];
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:NewSearchPage.php

示例10: ShowVendorProfile

 /**
  * Show the profile page belonging to the current vendor.
  */
 public function ShowVendorProfile()
 {
     $GLOBALS['BreadCrumbs'] = array(array('name' => GetLang('Vendors'), 'link' => VendorLink()), array('name' => $this->vendor['vendorname']));
     $title = isc_html_escape($this->vendor['vendorname']);
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . ' - ' . $title);
     $GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate('vendor_profile');
     $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:11,代码来源:class.vendors.php

示例11: buildSearchResultsHTML

		/**
		 * Build the searched item results HTML
		 *
		 * Method will build the searched item results HMTL. Method will work with the ISC_SEARCH class to get the results
		 * so make sure that the object is initialised and the DoSearch executed.
		 *
		 * @access public
		 * @return string The search item result HTML on success, empty string on error
		 */
		static public function buildSearchResultsHTML()
		{
			if (!isset($GLOBALS["ISC_CLASS_SEARCH"]) || !is_object($GLOBALS["ISC_CLASS_SEARCH"])) {
				return "";
			}

			$totalRecords = $GLOBALS["ISC_CLASS_SEARCH"]->GetNumResults("product");

			if ($totalRecords == 0) {
				return "";
			}

			$altCount = -1;
			$results = $GLOBALS["ISC_CLASS_SEARCH"]->GetResults("product");
			$resultHTML = "";

			if (!array_key_exists("results", $results) || !is_array($results["results"])) {
				return "";
			}

			if (GetConfig("SearchProductDisplayMode") == "list") {
				$displayMode = "List";
				$GLOBALS["AlternateClass"] = "ListView ";
			} else {
				$displayMode = "Grid";
				$GLOBALS["AlternateClass"] = "";
			}

			// Should we hide the comparison button?
			if(GetConfig('EnableProductComparisons') == 0 || $totalRecords < 2) {
				$GLOBALS['HideCompareItems'] = "none";
			}

			foreach ($results["results"] as $product) {
				if (!is_array($product) || !array_key_exists("productid", $product)) {
					continue;
				}

				if (++$altCount%2 > 0) {
					$GLOBALS["AlternateClass"] .= "Odd";
				} else {
					$GLOBALS["AlternateClass"] .= "Even";
				}

				if (GetConfig("SearchProductDisplayMode") == "list") {
					$GLOBALS["AlternateClass"] .= " ListView";
				}

				$GLOBALS["ProductCartQuantity"] = "";
				if (isset($GLOBALS["CartQuantity" . $product["productid"]])) {
					$GLOBALS["ProductCartQuantity"] = (int)$GLOBALS["CartQuantity" . $product["productid"]];
				}

				$GLOBALS["ProductId"] = (int)$product["productid"];
				$GLOBALS["ProductName"] = isc_html_escape($product["prodname"]);
				$GLOBALS["ProductLink"] = ProdLink($product["prodname"]);
				$GLOBALS["ProductRating"] = (int)$product["prodavgrating"];

				// Determine the price of this product
				$GLOBALS['ProductPrice'] = '';
				if (GetConfig('ShowProductPrice') && !$product['prodhideprice']) {
					$GLOBALS['ProductPrice'] = formatProductCatalogPrice($product);
				}

				$GLOBALS["ProductThumb"] = ImageThumb($product, ProdLink($product["prodname"]), "", "TrackLink");

				if (isId($product["prodvariationid"]) || trim($product["prodconfigfields"]) !== "" || $product["prodeventdaterequired"] == 1) {
					$GLOBALS["ProductURL"] = ProdLink($product["prodname"]);
					$GLOBALS["ProductAddText"] = GetLang("ProductChooseOptionLink");
				} else {
					$GLOBALS["ProductURL"] = CartLink($product["productid"]);
					$GLOBALS["ProductAddText"] = GetLang("ProductAddToCartLink");
				}

				if (CanAddToCart($product) && GetConfig("ShowAddToCartLink")) {
					$GLOBALS["HideActionAdd"] = "";
				} else {
					$GLOBALS["HideActionAdd"] = "none";
				}

				$GLOBALS["HideProductVendorName"] = "display: none";
				$GLOBALS["ProductVendor"] = "";

				if (GetConfig("ShowProductVendorNames") && $product["prodvendorid"] > 0) {
					$vendorCache = $GLOBALS["ISC_CLASS_DATA_STORE"]->Read("Vendors");
					if (isset($vendorCache[$product["prodvendorid"]])) {
						$GLOBALS["ProductVendor"] = "<a href=\"" . VendorLink($vendorCache[$product["prodvendorid"]]) . "\">" . isc_html_escape($vendorCache[$product["prodvendorid"]]["vendorname"]) . "</a>";
						$GLOBALS["HideProductVendorName"] = "";
					}
				}

//.........这里部分代码省略.........
开发者ID:hungnv0789,项目名称:vhtm,代码行数:101,代码来源:class.product.php

示例12: SetPanelSettings


//.........这里部分代码省略.........
             for ($i = 1; $row = $GLOBALS['ISC_CLASS_DB']->Fetch($result); $i++) {
                 $GLOBALS['SubBrandName'] = isc_html_escape($row['brandname']);
                 $GLOBALS['SubBrandLink'] = BrandLink($row['brandname']);
                 if ($useImages) {
                     if ($row['brandimagefile'] !== '') {
                         $GLOBALS['SubBrandImage'] = GetConfig('ShopPath') . '/' . GetConfig('ImageDirectory') . '/' . $row['brandimagefile'];
                     } else {
                         $GLOBALS['SubBrandImage'] = $defaultImage;
                     }
                     $GLOBALS['SNIPPETS']['SubBrands'] .= '<li style="width: ' . GetConfig('BrandImageWidth') . 'px; height: ' . (GetConfig('BrandImageHeight') + 50) . 'px">' . $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubBrandItemImage") . '</li>';
                     if ($i % GetConfig('BrandPerRow') === 0) {
                         $GLOBALS['SNIPPETS']['SubBrands'] .= '<li style="float:none; clear:both;"></li>';
                     }
                 } else {
                     $GLOBALS['SNIPPETS']['SubBrands'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubBrandItem");
                 }
             }
             if ($useImages) {
                 $output = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubBrandsGrid");
             } else {
                 $output = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SubBrands");
             }
             $output = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseSnippets($output, $GLOBALS['SNIPPETS']);
             $GLOBALS['BrandsMessage'] = $output;
         } else {
             $GLOBALS['BrandsMessage'] = GetLang('ViewAllBrandsInstructions');
         }
         $GLOBALS['BrandProductListing'] = "<li>&nbsp;</li>";
         $GLOBALS['HideBrandProductListing'] = "none";
         return;
     }
     // Load the products into the reference array
     $GLOBALS['ISC_CLASS_BRANDS']->GetProducts($products);
     $GLOBALS['BrandProductListing'] = "";
     if ($GLOBALS['BrandName'] == "") {
         // We're on the 'All Brands' page and the brands list is on the right
         $GLOBALS['ChooseBrandFromList'] = sprintf(GetLang('ChooseBrandFromList'), GetLang('Right'));
         $GLOBALS['BrandProductListing'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BrandMainPageMessage");
     } else {
         // Show products for a specific brand
         if (GetConfig('EnableProductReviews') == 0) {
             $GLOBALS['HideProductRating'] = "display: none";
         }
         $GLOBALS['AlternateClass'] = '';
         foreach ($products as $row) {
             if ($GLOBALS['AlternateClass'] == 'Odd') {
                 $GLOBALS['AlternateClass'] = 'Even';
             } else {
                 $GLOBALS['AlternateClass'] = 'Odd';
             }
             $GLOBALS['ProductCartQuantity'] = '';
             if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
                 $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
             }
             $GLOBALS['ProductId'] = (int) $row['productid'];
             $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
             $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
             $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
             // Determine the price of this product
             $GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
             $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
             if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) {
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
             } else {
                 //$GLOBALS['ProductURL'] = CartLink($row['productid']);
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 //blessen
                 if (intval($row['prodretailprice']) <= 0) {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
                 } else {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1');
                 }
                 //blessen
                 //$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'] = '';
                 }
             }
             $GLOBALS['BrandProductListing'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("BrandProductsItem");
         }
         if ($GLOBALS['ISC_CLASS_BRANDS']->GetNumProducts() == 0) {
             // There are no products in this category
             $GLOBALS['BrandsMessage'] = GetLang('NoProductsInBrand');
             $GLOBALS['BrandProductListing'] = "<li>&nbsp;</li>";
             $GLOBALS['HideBrandProductListing'] = "none";
         }
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:BrandProductListing.php

示例13: SetPanelSettings

 public function SetPanelSettings()
 {
     $viewed = "";
     if (isset($_COOKIE['RECENTLY_VIEWED_PRODUCTS'])) {
         $viewed = $_COOKIE['RECENTLY_VIEWED_PRODUCTS'];
     } else {
         if (isset($_SESSION['RECENTLY_VIEWED_PRODUCTS'])) {
             $viewed = $_SESSION['RECENTLY_VIEWED_PRODUCTS'];
         }
     }
     $GLOBALS['CompareLink'] = CompareLink();
     if ($viewed != "") {
         // Hide the top selling products panel from the cart page
         $GLOBALS['HideSideTopSellersPanel'] = "none";
         $output = "";
         $viewed_products = array();
         $viewed_products = explode(",", $viewed);
         foreach ($viewed_products as $k => $p) {
             $viewed_products[$k] = (int) $p;
         }
         // Reverse the array so recently viewed products appear up top
         $viewed_products = array_reverse($viewed_products);
         // Hide the compare button if there's less than 2 products
         if (GetConfig('EnableProductComparisons') == 0 || count($viewed_products) < 2) {
             $GLOBALS['HideSideProductRecentlyViewedCompare'] = "none";
         }
         if (!empty($viewed_products)) {
             if (GetConfig('EnableProductReviews') == 0) {
                 $GLOBALS['HideProductRating'] = "display: none";
             }
             $query = "\n\t\t\t\t\t\tSELECT p.*, prodratingtotal/prodnumratings AS prodavgrating, i.imagefile, i.imageisthumb, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images i ON (p.productid = i.imageprodid AND i.imageisthumb=1)\n\t\t\t\t\t\tWHERE prodvisible='1' AND productid IN ('" . implode("','", $viewed_products) . "')\n\t\t\t\t\t";
             $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
             if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
                 while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
                     $recently_viewed_products[] = $row;
                 }
                 $GLOBALS['AlternateClass'] = '';
                 foreach ($viewed_products as $product_id) {
                     foreach ($recently_viewed_products as $row) {
                         if ($product_id == $row['productid']) {
                             if ($GLOBALS['AlternateClass'] == 'Odd') {
                                 $GLOBALS['AlternateClass'] = 'Even';
                             } else {
                                 $GLOBALS['AlternateClass'] = 'Odd';
                             }
                             $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
                             $GLOBALS['ProductCartQuantity'] = '';
                             if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
                                 $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
                             }
                             $GLOBALS['ProductId'] = (int) $row['productid'];
                             //temp script to shortern the product name
                             if ($row['prodbrandid'] == 37) {
                                 $query = "SELECT c.catname, c.catcombine FROM [|PREFIX|]categories \tc left join [|PREFIX|]categoryassociations ca on c.categoryid = ca.categoryid  left join [|PREFIX|]products p on ca.productid = p.productid where p.productid =  '" . $row['productid'] . "' ";
                                 $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
                                 $cat = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
                                 if ($cat['catcombine'] != "") {
                                     $GLOBALS['ProductName'] = $cat['catcombine'] . " Part Number " . isc_html_escape($row['prodcode']);
                                 } else {
                                     $GLOBALS['ProductName'] = $cat['catname'] . " Part Number " . isc_html_escape($row['prodcode']);
                                 }
                             } else {
                                 $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
                             }
                             //temp script to shortern the product name
                             //$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
                             $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
                             // Determine the price of this product
                             $GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
                             if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) {
                                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                                 $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
                             } else {
                                 //$GLOBALS['ProductURL'] = CartLink($row['productid']);
                                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                                 //blessen
                                 if (intval($row['prodretailprice']) <= 0) {
                                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
                                 } else {
                                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1');
                                 }
                                 //blessen
                                 //$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'] = '';
                                 }
                             }
                             $GLOBALS['ProductRating'] = $this->getRoundValue((double) $row['prodavgrating']);
                             $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideRecentlyViewedProducts");
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:SideProductRecentlyViewed.php

示例14: SetPanelSettings


//.........这里部分代码省略.........
     if ($remaining_places > 0) {
         require_once APP_ROOT . "/includes/classes/class.product.php";
         $related = GetRelatedProducts($GLOBALS['Product']['productid'], $GLOBALS['Product']['prodname'], $GLOBALS['Product']['prodrelatedproducts']);
         // Any returned products? add them to the list
         $relatedProducts = explode(",", $related);
         // Limit the number of products to the # of empty spaces we have
         for ($i = 0; $i <= $remaining_places; ++$i) {
             if (!isset($relatedProducts[$i]) || $relatedProducts[$i] == "") {
                 break;
             }
             if (!in_array($relatedProducts[$i], $prod_ids) && !@in_array($relatedProducts[$i], $ignore_prod_list)) {
                 $prod_ids[] = $relatedProducts[$i];
             }
         }
         $remaining_places = 9 - count($prod_ids);
         $suggest_prod_ids = implode(",", $prod_ids);
     }
     // Still don't have enough? Fetch popular products
     if ($remaining_places > 0) {
         if (!$suggest_prod_ids) {
             $suggest_prod_ids = 0;
         }
         $query = sprintf("select productid, floor(prodratingtotal/prodnumratings) as prodavgrating from [|PREFIX|]products where productid not in (%s) and productid not in (%s) and prodvisible='1' order by prodavgrating desc", $suggest_prod_ids, $ignore_prod_list);
         $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, $remaining_places);
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         // Is there at least one product to suggest?
         while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $prod_ids[] = $row['productid'];
         }
         $suggest_prod_ids = implode(",", $prod_ids);
     }
     // If there are *still* no products to suggest, just show them
     // the normal shopping cart view instead
     if (!empty($prod_ids)) {
         // Get a list of products that were ordered at the
         // same time as the product that was just added to the cart
         if (!$suggest_prod_ids) {
             $suggest_prod_ids = 0;
         }
         if (GetConfig('EnableProductReviews') == 0) {
             $GLOBALS['HideProductRating'] = "display: none";
         }
         $query = "\n\t\t\t\t\tSELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, imageisthumb, imagefile, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid)\n\t\t\t\t\tWHERE p.productid IN (" . $suggest_prod_ids . ") AND p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\t\tORDER BY prodnumsold DESC, prodratingtotal DESC\n\t\t\t\t";
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         $GLOBALS['AlternateClass'] = '';
         while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             if ($GLOBALS['AlternateClass'] == 'Odd') {
                 $GLOBALS['AlternateClass'] = 'Even';
             } else {
                 $GLOBALS['AlternateClass'] = 'Odd';
             }
             $GLOBALS['ProductCartQuantity'] = '';
             if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
                 $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
             }
             $GLOBALS['ProductId'] = (int) $row['productid'];
             $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
             $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
             $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
             // Determine the price of this product
             $GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
             $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
             if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) {
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
             } else {
                 //$GLOBALS['ProductURL'] = CartLink($row['productid']);
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 //blessen
                 if (intval($row['prodretailprice']) <= 0) {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
                 } else {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1');
                 }
                 //blessen
                 //$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'] = '';
                 }
             }
             $GLOBALS['SuggestedProductListing'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CategoryProductsItem");
         }
     }
     if (!$GLOBALS['SuggestedProductListing']) {
         ob_end_clean();
         header("Location:cart.php");
         die;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:SuggestiveCartContent.php

示例15: SetPanelSettings

 public function SetPanelSettings()
 {
     $count = 1;
     $output = "";
     if (GetConfig('EnableProductReviews') == 0) {
         $GLOBALS['HideProductRating'] = "display: none";
     }
     if (isset($GLOBALS['ISC_CLASS_CATEGORY'])) {
         $categorySql = $GLOBALS['ISC_CLASS_CATEGORY']->GetCategoryAssociationSQL();
     } else {
         if (isset($GLOBALS['ISC_CLASS_PRICE'])) {
             $categorySql = $GLOBALS['ISC_CLASS_PRICE']->GetCategoryAssociationSQL();
         }
     }
     $query = "\n\t\t\t\tSELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, imageisthumb, imagefile, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid)\n\t\t\t\tWHERE p.prodnumsold > '0' AND p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb)) " . $categorySql . "\n\t\t\t\tORDER BY p.prodnumsold DESC\n\t\t\t";
     $query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 5);
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
         $GLOBALS['AlternateClass'] = '';
         while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             if ($GLOBALS['AlternateClass'] == 'Odd') {
                 $GLOBALS['AlternateClass'] = 'Even';
             } else {
                 $GLOBALS['AlternateClass'] = 'Odd';
             }
             $GLOBALS['ProductCartQuantity'] = '';
             if (isset($GLOBALS['CartQuantity' . $row['productid']])) {
                 $GLOBALS['ProductCartQuantity'] = (int) $GLOBALS['CartQuantity' . $row['productid']];
             }
             if ($count == 1) {
                 $snippet = "SideTopSellersFirst";
             } else {
                 $snippet = "SideTopSellers";
             }
             $GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
             $GLOBALS['ProductId'] = $row['productid'];
             $GLOBALS['ProductNumber'] = $count++;
             $GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
             $GLOBALS['ProductLink'] = ProdLink($row['prodname']);
             // Determine the price of this product
             $GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
             if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired'] == 1) {
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 $GLOBALS['ProductAddText'] = GetLang('ProductChooseOptionLink');
             } else {
                 //$GLOBALS['ProductURL'] = CartLink($row['productid']);
                 $GLOBALS['ProductURL'] = ProdLink($row['prodname']);
                 //blessen
                 if (intval($row['prodretailprice']) <= 0) {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink');
                 } else {
                     $GLOBALS['ProductAddText'] = GetLang('ProductAddToCartLink1');
                 }
                 //blessen
                 //$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'] = '';
                 }
             }
             $GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
             $output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet($snippet);
         }
     } else {
         $GLOBALS['HideSideCategoryTopSellersPanel'] = "none";
         $this->DontDisplay = true;
     }
     $GLOBALS['SNIPPETS']['SideTopSellers'] = $output;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:79,代码来源:SideCategoryTopSellers.php


注:本文中的VendorLink函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。