本文整理汇总了PHP中ImageThumb函数的典型用法代码示例。如果您正苦于以下问题:PHP ImageThumb函数的具体用法?PHP ImageThumb怎么用?PHP ImageThumb使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ImageThumb函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetPanelSettings
function SetPanelSettings()
{
$count = 0;
$output = "";
$GLOBALS['SNIPPETS']['WishListItems'] = "";
$GLOBALS['HideCompareItems'] = "none";
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
if (!isset($GLOBALS['WishListItems'])) {
return false;
}
$GLOBALS['AlternateClass'] = '';
foreach ($GLOBALS['WishListItems'] 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['ItemId'] = (int) $row['wishlistitemid'];
$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($row);
$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
$GLOBALS['SNIPPETS']['WishListItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("WishListItem");
}
}
示例2: SetPanelSettings
public function SetPanelSettings()
{
$count = 0;
$GLOBALS['SNIPPETS']['HomeSaleProducts'] = '';
if (GetConfig('HomeNewProducts') == 0) {
$this->DontDisplay = true;
return;
}
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$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.prodsaleprice != 0 AND p.prodsaleprice < p.prodprice AND p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY RAND()\n\t\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeNewProducts'));
$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'] = $row['productid'];
$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
// Determine the price of this product
$originalPrice = CalcRealPrice(CalcProdCustomerGroupPrice($row, $row['prodprice']), 0, 0, $row['prodistaxable']);
$GLOBALS['OriginalProductPrice'] = CurrencyConvertFormatPrice($originalPrice);
$GLOBALS['ProductPrice'] = CalculateProductPrice($row);
$GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
// 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['imagefile'], ProdLink($row['prodname']));
$GLOBALS['SNIPPETS']['HomeSaleProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeSaleProductsItem");
if (!$GLOBALS['SNIPPETS']['HomeSaleProducts']) {
$this->DontDisplay = true;
return;
}
}
}
示例3: SetPanelSettings
public function SetPanelSettings()
{
$GLOBALS['AlsoBoughtProductListing'] = '';
$query = "\n\t\t\tSELECT ordprodid\n\t\t\tFROM [|PREFIX|]order_products\n\t\t\tWHERE orderorderid IN (SELECT orderorderid FROM [|PREFIX|]order_products WHERE ordprodid='" . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "') AND ordprodid != " . $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "\n\t\t\tGROUP BY ordprodid\n\t\t\tORDER BY COUNT(ordprodid) DESC\n\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 10);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$productIds = array();
while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$productIds[] = $product['ordprodid'];
}
if (empty($productIds)) {
$this->DontDisplay = true;
return;
}
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$query = "\n\t\t\tSELECT p.*, FLOOR(p.prodratingtotal/p.prodnumratings) AS prodavgrating, i.imagefile, i.imageisthumb, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\tFROM [|PREFIX|]products p\n\t\t\tLEFT JOIN [|PREFIX|]product_images i ON (p.productid = i.imageprodid AND i.imageisthumb=1)\n\t\t\tWHERE p.prodvisible='1' AND p.productid IN (" . implode(',', $productIds) . ")\n\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\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($row);
$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
$GLOBALS['AlsoBoughtProductListing'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideProductAlsoBoughtItem");
}
if (!$GLOBALS['AlsoBoughtProductListing']) {
$this->DontDisplay = true;
}
}
示例4: SetPanelSettings
public function SetPanelSettings()
{
$output = "";
// If product ratings aren't enabled then we don't even need to load anything here
if (GetConfig('EnableProductReviews') == 0) {
$this->DontDisplay = true;
return;
}
$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 AND pi.imageisthumb=1)\n\t\t\t\tWHERE prodvisible='1' AND prodratingtotal > 0\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY prodavgrating 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']];
}
$GLOBALS['ProductId'] = $row['productid'];
$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
$GLOBALS['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
// Determine the price of this product
$GLOBALS['ProductPrice'] = CalculateProductPrice($row);
$GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SidePopularProducts");
}
// Showing the syndication option?
if (GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
$GLOBALS['SNIPPETS']['SidePopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SidePopularProductsFeed");
}
} else {
$GLOBALS['HideSidePopularProductsPanel'] = "none";
$this->DontDisplay = true;
}
$GLOBALS['SNIPPETS']['SidePopularProducts'] = $output;
}
示例5: SetPanelSettings
public function SetPanelSettings()
{
// Setup the cart values
$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');
$GLOBALS['ISC_CLASS_CART']->SetCartValues();
$GLOBALS['SNIPPETS']['MiniCartProductAdded'] = "";
$GLOBALS['SNIPPETS']['MiniCartOtherProduct'] = "";
foreach (GetAvailableModules('checkout', true, true) as $module) {
if ($module['object']->disableNonCartCheckoutButtons) {
$GLOBALS['HideCheckoutButton'] = 'none';
break;
}
}
$GLOBALS['AdditionalCheckoutButtons'] = '';
$HideCheckout = false;
foreach (GetAvailableModules('checkout', true, true) as $module) {
if (method_exists($module['object'], 'GetSidePanelCheckoutButton')) {
$GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetSidePanelCheckoutButton();
}
if ($module['object']->disableNonCartCheckoutButtons) {
$HideCheckout = true;
}
}
$count = 0;
$subtotal = 0;
// Get a list of all products in the cart
$product_array = $GLOBALS['ISC_CLASS_CART']->api->GetProductsInCart();
foreach ($product_array as $itemId => $product) {
$GLOBALS['ProductName'] = isc_html_escape($product['product_name']);
// Is this product a variation?
$GLOBALS['ProductOptions'] = '';
if (isset($product['options']) && !empty($product['options'])) {
$GLOBALS['ProductOptions'] .= "<small class='CartProductOptionList'>(";
$comma = '';
foreach ($product['options'] as $name => $value) {
if (!trim($name) || !trim($value)) {
continue;
}
$GLOBALS['ProductOptions'] .= $comma . isc_html_escape($name) . ": " . isc_html_escape($value);
$comma = ', ';
}
$GLOBALS['ProductOptions'] .= ")</small>";
}
$GLOBALS['ProductLink'] = '';
if (!isset($product['type']) || $product['type'] != "giftcertificate") {
$GLOBALS['ProductImage'] = ImageThumb($product['data']['imagefile'], ProdLink($product['data']['prodname']));
}
$GLOBALS['ProductLink'] = ProdLink($product['data']['prodname']);
$GLOBALS['ProductQuantity'] = $product['quantity'];
if (isset($product['discount_price'])) {
$GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($product['discount_price']);
$price = $product['discount_price'];
} else {
if (isset($product['type']) && $product['type'] == "giftcertificate") {
$GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($product['giftamount']);
$price = $product['giftamount'];
} else {
$GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($product['product_price']);
$price = $product['product_price'];
}
}
// Update the subtotal
$subtotal += (int) $product['quantity'] * $price;
if ($GLOBALS['ISC_CLASS_CART']->newCartItem == $itemId) {
$GLOBALS['SNIPPETS']['MiniCartProductAdded'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("MiniCartProductAdded");
} else {
$GLOBALS['SNIPPETS']['MiniCartOtherProduct'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("MiniCartOtherProduct");
}
}
$GLOBALS['CartSubTotal'] = CurrencyConvertFormatPrice($GLOBALS['CartSubTotal']);
// Should we hide extra info on the mini cart panel?
if ($GLOBALS['ISC_CLASS_CART']->api->GetNumProductsInCart() < 2) {
$GLOBALS['HideExtraMiniCartInfo'] = "none";
}
}
示例6: SetPanelSettings
public function SetPanelSettings()
{
if (!gzte11(ISC_HUGEPRINT) || $GLOBALS['ISC_CLASS_PRODUCT']->GetProductVendor() === false) {
$this->DontDisplay = true;
return false;
}
$vendor = $GLOBALS['ISC_CLASS_PRODUCT']->GetProductVendor();
$GLOBALS['SNIPPETS']['VendorsOtherProducts'] = '';
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$query = "\n\t\t\tSELECT p.*, FLOOR(p.prodratingtotal/p.prodnumratings) AS prodavgrating, i.imagefile, i.imageisthumb, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\tFROM [|PREFIX|]products p\n\t\t\tLEFT JOIN [|PREFIX|]product_images i ON (p.productid = i.imageprodid AND i.imageisthumb=1)\n\t\t\tWHERE p.prodvisible='1' AND p.prodvendorid='" . (int) $vendor['vendorid'] . "' AND p.productid!='" . (int) $GLOBALS['ISC_CLASS_PRODUCT']->GetProductId() . "'\n\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\tORDER BY p.prodvendorfeatured DESC, RAND() DESC\n\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 9);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$productsDone = 0;
$hasMore = false;
$GLOBALS['AlternateClass'] = '';
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
++$productsDone;
if ($productsDone == 9) {
$hasMore = true;
break;
}
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['SNIPPETS']['VendorsOtherProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductVendorsOtherProductsItem");
}
if (!$GLOBALS['SNIPPETS']['VendorsOtherProducts']) {
$this->DontDisplay = true;
}
$GLOBALS['VendorProductsLink'] = VendorProductsLink($vendor);
if ($hasMore == true) {
$GLOBALS['HideViewAllLink'] = '';
} else {
$GLOBALS['HideViewAllLink'] = 'display: none';
}
}
示例7: ShowRecentItems
/**
* Show a list of items that the customer has recently viewed by browsing our site
*/
private function ShowRecentItems()
{
$viewed = "";
if (isset($_COOKIE['RECENTLY_VIEWED_PRODUCTS'])) {
$viewed = $_COOKIE['RECENTLY_VIEWED_PRODUCTS'];
} else if (isset($_SESSION['RECENTLY_VIEWED_PRODUCTS'])) {
$viewed = $_SESSION['RECENTLY_VIEWED_PRODUCTS'];
}
if ($viewed != "") {
$GLOBALS['HideNoRecentItemsMessage'] = "none";
$GLOBALS['SNIPPETS']['AccountRecentItems'] = "";
$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['HideCompareItems'] = "none";
}
if (!empty($viewed_products)) {
if(!getProductReviewsEnabled()) {
$GLOBALS['HideProductRating'] = "display: none";
}
$query = "
SELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL()."
FROM [|PREFIX|]products p
LEFT JOIN [|PREFIX|]product_images pi ON (productid=pi.imageprodid AND imageisthumb=1)
WHERE prodvisible='1' AND productid in ('".implode("','", $viewed_products)."')
".GetProdCustomerGroupPermissionsSQL()."
";
$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['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);
}
$GLOBALS['ProductThumb'] = ImageThumb($row, ProdLink($row['prodname']));
$GLOBALS['SNIPPETS']['AccountRecentItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("AccountRecentlyViewedProducts");
}
}
}
else {
$GLOBALS['HideRecentItemList'] = "none";
}
}
else {
$GLOBALS['HideRecentItemList'] = "none";
}
$GLOBALS['CompareLink'] = CompareLink();
// Show the list of available shipping addresses
$GLOBALS['ISC_CLASS_TEMPLATE']->SetPageTitle(GetConfig('StoreName') . " - " . GetLang('RecentlyViewedItems'));
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("account_recentitems");
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
}
示例8: SetPanelSettings
//.........这里部分代码省略.........
$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>' . CurrencyConvertFormatPrice($DiscountPrice) . '';
$GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">';
if (GetConfig('ShowOnSale')) {
$GLOBALS['ProductPrice'] .= '<br>' . $GLOBALS['ShowOnSaleImage'] . '';
}
} else {
$GLOBALS['ProductPrice'] = '' . CurrencyConvertFormatPrice($FinalPrice) . '';
}
### 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'] = '';
}
示例9: SetPanelSettings
public function SetPanelSettings()
{
$GLOBALS['ISC_CLASS_CATEGORY'] = GetClass('ISC_CATEGORY');
// Should we hide the comparison button?
if (GetConfig('EnableProductComparisons') == 0 || $GLOBALS['ISC_CLASS_CATEGORY']->GetNumProducts() < 2) {
$GLOBALS['HideCompareItems'] = "none";
}
// Load the products into the reference array
$GLOBALS['ISC_CLASS_CATEGORY']->GetProducts($products);
$GLOBALS['CategoryProductListing'] = "";
if (GetConfig('ShowProductRating') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$display_mode = ucfirst(GetConfig("CategoryDisplayMode"));
if ($display_mode == "Grid") {
$display_mode = "";
}
$GLOBALS['DisplayMode'] = $display_mode;
if ($display_mode == "List") {
if (GetConfig('ShowAddToCartLink') && $GLOBALS['ISC_CLASS_CATEGORY']->GetNumProducts() > 0) {
$GLOBALS['HideAddButton'] = '';
} else {
$GLOBALS['HideAddButton'] = 'none';
}
$GLOBALS['ListJS'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ListCheckForm");
}
$GLOBALS['CompareButton'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CompareButton" . $display_mode);
if ($display_mode == "List" && $GLOBALS['ISC_CLASS_CATEGORY']->GetNumPages() > 1) {
$GLOBALS['CompareButtonTop'] = $GLOBALS['CompareButton'];
}
$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 1734.06
//$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'] = '';
}
}
// for list style
if ($display_mode == "List") {
// get a small chunk of the product description
$desc = isc_substr(strip_tags($row['proddesc']), 0, 250);
if (isc_strlen($row['proddesc']) > 250) {
// trim the description back to the last period or space so words aren't cut off
$period_pos = isc_strrpos($desc, ".");
$space_pos = isc_strrpos($desc, " ");
// find the character that we should trim back to. -1 on space pos for a space that follows a period, so we dont end up with 4 periods
if ($space_pos - 1 > $period_pos) {
$pos = $space_pos;
} else {
$pos = $period_pos;
}
$desc = isc_substr($desc, 0, $pos);
$desc .= "...";
}
$GLOBALS['ProductDescription'] = $desc;
$GLOBALS['AddToCartQty'] = "";
if (CanAddToCart($row) && GetConfig('ShowAddToCartLink')) {
if (isId($row['prodvariationid']) || trim($row['prodconfigfields']) != '' || $row['prodeventdaterequired']) {
$GLOBALS['AddToCartQty'] = '<a href="' . $GLOBALS["ProductURL"] . '">' . $GLOBALS['ProductAddText'] . "</a>";
} else {
//.........这里部分代码省略.........
示例10: SetPanelSettings
public function SetPanelSettings()
{
$_SESSION['you_save'] = 0;
//blessen
$GLOBALS['SNIPPETS']['CartItems'] = "";
$count = 0;
$subtotal = 0;
$_SESSION['CHECKOUT'] = array();
// Get a list of all products in the cart
$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');
$product_array = $GLOBALS['ISC_CLASS_CART']->api->GetProductsInCart();
/* $cprint = print_r($product_array, true);
$q = "INSERT INTO isc_orderlogs (`ordervalue`) VALUES ('$cprint')";
$r = $GLOBALS["ISC_CLASS_DB"]->Query($q); */
$GLOBALS['AdditionalCheckoutButtons'] = '';
// Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined
$ShowCheckoutButton = false;
if (!empty($product_array)) {
foreach (GetAvailableModules('checkout', true, true) as $module) {
if (isset($module['object']->_showBothButtons) && $module['object']->_showBothButtons) {
$ShowCheckoutButton = true;
$GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetCheckoutButton();
} elseif (method_exists($module['object'], 'GetCheckoutButton')) {
$GLOBALS['AdditionalCheckoutButtons'] .= $module['object']->GetCheckoutButton();
} else {
$ShowCheckoutButton = true;
}
}
}
$GLOBALS['HideMultipleAddressShipping'] = 'display: none';
if (gzte11(ISC_MEDIUMPRINT) && $GLOBALS['ISC_CLASS_CART']->api->GetNumPhysicalProducts() > 1 && $ShowCheckoutButton && GetConfig("MultipleShippingAddresses")) {
$GLOBALS['HideMultipleAddressShipping'] = '';
}
$GLOBALS['HideCheckoutButton'] = '';
if (!$ShowCheckoutButton) {
$GLOBALS['HideCheckoutButton'] = 'display: none';
$GLOBALS['HideMultipleAddressShippingOr'] = 'display: none';
}
$wrappingOptions = $GLOBALS['ISC_CLASS_DATA_STORE']->Read('GiftWrapping');
if (empty($wrappingOptions)) {
$publicWrappingOptions = false;
} else {
$publicWrappingOptions = true;
}
if (!GetConfig('ShowThumbsInCart')) {
$GLOBALS['HideThumbColumn'] = 'display: none';
$GLOBALS['ProductNameSpan'] = 2;
} else {
$GLOBALS['HideThumbColumn'] = '';
$GLOBALS['ProductNameSpan'] = 1;
}
$wrappingAdjustment = 0;
$itemTotal = 0;
$comptotal = 0;
# To get all the complementary product total -- Baskaran
$compprice = 0;
foreach ($product_array as $k => $product) {
$GLOBALS['CartItemId'] = (int) $product['cartitemid'];
// If the item in the cart is a gift certificate, we need to show a special type of row
if (isset($product['type']) && $product['type'] == "giftcertificate") {
$GLOBALS['GiftCertificateName'] = isc_html_escape($product['data']['prodname']);
$GLOBALS['GiftCertificateAmount'] = CurrencyConvertFormatPrice($product['giftamount']);
$GLOBALS['GiftCertificateTo'] = isc_html_escape($product['certificate']['to_name']);
$GLOBALS["Quantity" . $product['quantity']] = 'selected="selected"';
$GLOBALS['ProductPrice'] = CurrencyConvertFormatPrice($product['giftamount']);
$GLOBALS['ProductTotal'] = CurrencyConvertFormatPrice($product['giftamount'] * $product['quantity']);
$itemTotal += $product['giftamount'] * $product['quantity'];
$GLOBALS['SNIPPETS']['CartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("CartItemGiftCertificate");
} else {
$GLOBALS['ProductLink'] = ProdLink($product['data']['prodname']);
$GLOBALS['ProductAvailability'] = isc_html_escape($product['data']['prodavailability']);
$GLOBALS['ItemId'] = (int) $product['data']['productid'];
$GLOBALS['VariationId'] = (int) $product['variation_id'];
$GLOBALS['ProductQuantity'] = (int) $product['quantity'];
//blessen
$GLOBALS['prodretailprice'] = CurrencyConvertFormatPrice($product['data']['prodretailprice']);
if ($product['data']['prodretailprice'] > $product['data']['prodcalculatedprice']) {
$_SESSION['you_save'] += ($product['data']['prodretailprice'] - $product['data']['prodcalculatedprice']) * $product['quantity'];
}
//$GLOBALS['saveprice'] = CurrencyConvertFormatPrice($product['data']['prodretailprice'] - $product['data']['prodcalculatedprice']);
//blessen
// Should we show thumbnails in the cart?
if (GetConfig('ShowThumbsInCart')) {
$GLOBALS['ProductImage'] = ImageThumb($product['data']['imagefile'], ProdLink($product['data']['prodname']));
}
$GLOBALS['UpdateCartQtyJs'] = "Cart.UpdateQuantity(this.options[this.selectedIndex].value);";
$GLOBALS['HideCartProductFields'] = 'display:none;';
$GLOBALS['CartProductFields'] = '';
$this->GetProductFieldDetails($product['product_fields'], $k);
$GLOBALS['EventDate'] = '';
if (isset($product['event_date'])) {
$GLOBALS['EventDate'] = '<div style="font-style: italic; font-size:10px; color:gray">(' . $product['event_name'] . ': ' . isc_date('M jS Y', $product['event_date']) . ')</div>';
}
// Can this product be wrapped?
$GLOBALS['GiftWrappingName'] = '';
$GLOBALS['HideGiftWrappingAdd'] = '';
$GLOBALS['HideGiftWrappingEdit'] = 'display: none';
$GLOBALS['HideGiftWrappingPrice'] = 'display: none';
$GLOBALS['GiftWrappingPrice'] = '';
$GLOBALS['GiftMessagePreview'] = '';
//.........这里部分代码省略.........
示例11: ShowProductList
//.........这里部分代码省略.........
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'] = '';
}
示例12: SetPanelSettings
//.........这里部分代码省略.........
$DiscountPrice = $FinalPrice;
$DiscountPrice = CalculateDiscountPrice($FinalPrice, $DiscountPrice, $row['categoryid'], $row['brandseriesid']);
}
/*
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) {
//&& GetConfig('ShowOnSale')
$GLOBALS['ProductPrice'] = '<strike>' . CurrencyConvertFormatPrice($FinalPrice) . '</strike>';
$GLOBALS['ProductPrice'] .= '<br>' . CurrencyConvertFormatPrice($DiscountPrice) . '';
$GLOBALS['ShowOnSaleImage'] = '<img id="OnSale" src="' . GetConfig('ShopPath') . '/templates/default/images/onsale.gif" alt="">';
if (GetConfig('ShowOnSale')) {
$GLOBALS['ProductPrice'] .= '<br>' . $GLOBALS['ShowOnSaleImage'] . '';
}
} else {
$GLOBALS['ProductPrice'] = '' . CurrencyConvertFormatPrice($FinalPrice) . '';
}
### 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'] = '';
}
示例13: GenerateExpressCheckoutAddonProducts
/**
* Generate the add-on products for the express checkout.
*/
public function GenerateExpressCheckoutAddonProducts($onlyList = false)
{
$addon_products_str = '';
$addon_products = array();
$related_ymm = $this->GetYmmsInCart();
if (!empty($related_ymm)) {
$ymmCond = array();
if (!empty($related_ymm['year'])) {
foreach ($related_ymm['year'] as $year) {
$ymmCond[] = " ( {$year} between v.prodstartyear and v.prodendyear OR v.prodstartyear = 'ALL') ";
}
}
if (!empty($related_ymm['make'])) {
$ymmCond[] = sprintf(" (v.prodmake in ('%s')) ", implode("','", $related_ymm['make']));
}
if (!empty($related_ymm['model'])) {
$ymmCond[] = sprintf(" (v.prodmodel in ('%s')) ", implode("','", $related_ymm['model']));
}
$ymmConds = sprintf(" ((v.prodmake='NON-SPEC VEHICLE') OR (v.prodmake<>'NON-SPEC VEHICLE' AND %s )) ", implode(' OR ', $ymmCond));
} else {
$ymmConds = " 1=1 ";
}
$query = sprintf("SELECT ap.id, ap.price, ap.description,\n\t\t\t\t p.productid, p.prodname, p.proddesc,\n\t\t\t\t\t pi.imagefile\n\t\t\t\t FROM [|PREFIX|]addon_products ap\n\t\t\t\t LEFT JOIN [|PREFIX|]products p ON p.productid=ap.productid\n\t\t\t\t LEFT JOIN [|PREFIX|]import_variations v ON v.productid=p.productid\n\t\t\t\t LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1)\n\t\t\t\t WHERE ap.status=1 AND \n\t\t\t\t {$ymmConds}\n\t\t\t\t GROUP BY p.productid\n\t\t\t\t ORDER BY ap.sequence DESC, ap.createtime DESC ");
$configedNum = (int) GetConfig('AddonProductShownNum');
if ($configedNum > 0) {
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, $configedNum);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$addonProductsInCart = $this->GetAddonProductsInCart();
$GLOBALS['AddonProductList'] = '';
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['AddonProductTitle'] = isc_html_escape($row['prodname']);
$GLOBALS['AddonProductPrice'] = FormatPrice($row['price']);
$GLOBALS['AddonProductHidePrice'] = $row['price'];
$thumbnail = realpath(ISC_BASE_PATH . '/product_images/' . $row['imagefile']);
if ($row['imagefile'] != '' && file_exists($thumbnail)) {
$thumbnail_path = $row['imagefile'];
} else {
$thumbnail_path = '';
}
$GLOBALS['AddonProductThumbnail'] = ImageThumb($thumbnail_path, 'javascript:void(0)', '', array('onmouseover' => 'ExpressCheckout.ShowAddonProductImg(this)', 'onmouseout' => 'ExpressCheckout.HideAddonProductImg(this)'));
$GLOBALS['AddonProductId'] = $row['id'];
$GLOBALS['ProductId'] = $row['productid'];
if (in_array($row['productid'], array_keys($addonProductsInCart))) {
$GLOBALS['AddonProductChecked'] = 'checked';
$GLOBALS['AddonProductDisplay'] = 'inline';
$GLOBALS['AddonProductOptions'] = $this->GenerateAddonProductOptions(10, $addonProductsInCart[$row['productid']]['quantity']);
} else {
$GLOBALS['AddonProductChecked'] = '';
$GLOBALS['AddonProductDisplay'] = 'none';
$GLOBALS['AddonProductOptions'] = $this->GenerateAddonProductOptions(10);
}
$GLOBALS['ProductDescription'] = $row['proddesc'];
$GLOBALS['AddonProductDescription'] = empty($row['description']) ? '' : trim($row['description']);
$GLOBALS['AddonProductList'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(true, $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ExpressCheckoutAddonProduct'));
}
if ($onlyList) {
$addon_products_str = $GLOBALS['AddonProductList'];
} else {
if ('' != $GLOBALS['AddonProductList']) {
$addon_products_str = $GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate(true, $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('ExpressCheckoutAddonProducts'));
}
}
}
return $addon_products_str;
}
示例14: SetPanelSettings
public function SetPanelSettings()
{
$output = "";
$categorySql = '';
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 USE INDEX (PRIMARY)\n\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid)\n\t\t\t\tWHERE p.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb)) " . $categorySql . "\n\t\t\t\tORDER BY p.productid 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) {
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$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'] = $row['productid'];
$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
// Determine the price of this product
$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
$GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
$GLOBALS['ProductDate'] = isc_date(GetConfig('DisplayDateFormat'), $row['proddateadded']);
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['ProductThumb'] = ImageThumb($row['imagefile'], ProdLink($row['prodname']));
$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'] = '';
}
}
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProducts");
}
// Showing the syndication option?
if (GetConfig('RSSNewProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
$GLOBALS['ISC_LANG']['CategoryNewProductsFeed'] = sprintf(GetLang('CategoryNewProductsFeed'), $GLOBALS['CatName']);
$GLOBALS['SNIPPETS']['SideCategoryNewProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryNewProductsFeed");
}
} else {
$GLOBALS['HideSideCategoryNewProductsPanel'] = "none";
$this->DontDisplay = true;
}
$GLOBALS['SNIPPETS']['SideNewProducts'] = $output;
}
示例15: SetPanelSettings
public function SetPanelSettings()
{
$count = 0;
$prod_ids = array();
$output = "";
$GLOBALS['SuggestedProductListing'] = "";
// Hide the "compare" checkbox for each product
$GLOBALS['HideCompareItems'] = "none";
// Make sure the query doesn't return the product we're adding to
// the cart or any other products in the cart for that matter
$GLOBALS['ISC_CLASS_CART'] = GetClass('ISC_CART');
$ignore_prod_list = $GLOBALS['ISC_CLASS_CART']->api->GetProductsInCartCSV();
if ($ignore_prod_list == "") {
$ignore_prod_list = 0;
}
$query = "\n\t\t\t\tSELECT ordprodid\n\t\t\t\tFROM [|PREFIX|]order_products\n\t\t\t\tWHERE orderorderid IN (\n\t\t\t\t\tSELECT orderorderid FROM [|PREFIX|]order_products WHERE ordprodid='" . (int) $GLOBALS['ProductJustAdded'] . "'\n\t\t\t\t) AND ordprodid NOT IN (" . $ignore_prod_list . ")\n\t\t\t\tGROUP BY ordprodid\n\t\t\t\tORDER BY COUNT(ordprodid) DESC\n\t\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, 9);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
// Get the list of suggested product id's
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$prod_ids[] = $row['ordprodid'];
}
$suggest_prod_ids = implode(",", $prod_ids);
$remaining_places = 9 - count($prod_ids);
// If there aren't enough products to suggest, we will get
// the popular products (based on reviews) instead
// If there aren't enough suggested products, fetch related products for this item
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');
//.........这里部分代码省略.........