本文整理汇总了PHP中ProdLink函数的典型用法代码示例。如果您正苦于以下问题:PHP ProdLink函数的具体用法?PHP ProdLink怎么用?PHP ProdLink使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ProdLink函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SetPanelSettings
public function SetPanelSettings()
{
// Setup the cart values
$total = $count = 0;
$GLOBALS['SNIPPETS']['SideCartItems'] = '';
if (!isset($_SESSION['CART']['ITEMS']) || empty($_SESSION['CART']['ITEMS'])) {
$this->DontDisplay = true;
return;
}
if (isset($_SESSION['CART']['ITEMS'])) {
foreach ($_SESSION['CART']['ITEMS'] as $item) {
$total += $item['product_price'] * $item['quantity'];
$count += $item['quantity'];
if (!isset($item['type']) || $item['type'] != "giftcertificate") {
$GLOBALS['ProductName'] = "<a href=\"" . ProdLink($item['product_name']) . "\">" . isc_html_escape($item['product_name']) . "</a>";
} else {
$GLOBALS['ProductName'] = isc_html_escape($item['product_name']);
}
// Is this product a variation?
$GLOBALS['ProductOptions'] = '';
if (isset($item['options']) && !empty($item['options'])) {
$GLOBALS['ProductOptions'] .= "<br /><small>(";
$comma = '';
foreach ($item['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['ProductPrice'] = CurrencyConvertFormatPrice($item['product_price'] * $item['quantity']);
$GLOBALS['ProductQuantity'] = $item['quantity'];
$GLOBALS['SNIPPETS']['SideCartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCartItem");
}
}
if ($count == 1) {
$GLOBALS['SideCartItemCount'] = GetLang('SideCartYouHave1Item');
} else {
$GLOBALS['SideCartItemCount'] = sprintf(GetLang('SideCartYouHaveXItems'), $count);
}
$GLOBALS['ISC_LANG']['SideCartTotalCost'] = sprintf(GetLang('SideCartTotalCost'), CurrencyConvertFormatPrice($total));
// Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined
$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;
}
}
if ($HideCheckout) {
$GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = '';
} else {
$GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SideCartContentsCheckoutLink');
}
}
示例2: 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");
}
}
示例3: 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;
}
}
}
示例4: SetPanelSettings
public function SetPanelSettings()
{
if ($GLOBALS['ISC_CLASS_PRODUCT']->GetRelatedProducts() != "") {
$output = "";
if (GetConfig('EnableProductReviews') == 0) {
$GLOBALS['HideProductRating'] = "display: none";
}
$query = "\n\t\t\t\t\tSELECT p.*, FLOOR(p.prodratingtotal/p.prodnumratings) AS prodavgrating, i.imagefile, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images i ON (p.productid = i.imageprodid)\n\t\t\t\t\tWHERE p.prodvisible='1' AND p.productid IN (" . $GLOBALS['ISC_CLASS_PRODUCT']->GetRelatedProducts() . ") AND i.imageisthumb=1\n\t\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\t\tORDER BY prodsortorder ASC\n\t\t\t\t";
$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'] = (int) $row['productid'];
$GLOBALS['ProductName'] = isc_html_escape($row['prodname']);
$GLOBALS['ProductLink'] = ProdLink($row['prodname']);
// Determine the price of this product
$GLOBALS['ProductPrice'] = CalculateProductPrice($row);
$GLOBALS['ProductRating'] = (int) $row['prodavgrating'];
$thumb = $GLOBALS['ShopPath'] . "/" . GetConfig('ImageDirectory') . "/" . isc_html_escape($row['imagefile']);
$GLOBALS['ProductThumb'] = '<img src="' . $thumb . '" alt="" />';
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideRelatedProducts");
}
$GLOBALS['SNIPPETS']['SideProductsRelated'] = $output;
} else {
// No related products, hide the panel
$GLOBALS['HideRelatedProductsPanel'] = "none";
$this->DontDisplay = true;
}
} else {
// No related products, hide the panel
$GLOBALS['HideRelatedProductsPanel'] = "none";
$this->DontDisplay = true;
}
}
示例5: getProductUrl
/**
* Returns the URL for a product based on it's productid
*
* @param integer $productId The ID number of the product to generate the URL for
*/
public static function getProductUrl($productId, $returnTitle=false)
{
$productId = (int)$productId;
if($productId < 1) {
return false;
}
$productName = $GLOBALS['ISC_CLASS_DB']->FetchOne('select prodname from `[|PREFIX|]products` where productid=' . $productId, 'prodname');
if(empty($productName)) {
return false;
}
if($returnTitle) {
return array('title'=>$productName, 'url'=> ProdLink($productName));
}
return ProdLink($productName);
}
示例6: 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;
}
}
示例7: 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;
}
示例8: 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();
$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;
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'] = '';
$GLOBALS['HideGiftMessagePreview'] = 'display: none';
$GLOBALS['HideWrappingOptions'] = 'display: none';
if ($product['data']['prodtype'] == PT_PHYSICAL && $product['data']['prodwrapoptions'] != -1 && $publicWrappingOptions == true) {
$GLOBALS['HideWrappingOptions'] = '';
if (isset($product['wrapping'])) {
$GLOBALS['GiftWrappingName'] = isc_html_escape($product['wrapping']['wrapname']);
//.........这里部分代码省略.........
示例9: loadProductComments
private function loadProductComments($productId)
{
$GLOBALS['ProductId'] = $productId;
// Are there any reviews for this product? If so, load them
if ($GLOBALS['ISC_CLASS_PRODUCT']->GetNumReviews() == 0) {
$GLOBALS['NoReviews'] = GetLang('NoReviews');
}
else {
// Setup paging data
$reviewsTotal = $GLOBALS['ISC_CLASS_PRODUCT']->GetNumReviews();
$reviewsPerPage = GetConfig('ProductReviewsPerPage');
$pages = ceil($reviewsTotal / $reviewsPerPage);
$revpage = 1;
$start = 0;
if (isset($_GET['revpage'])) {
$revpage = (int)$_GET['revpage'];
}
if ($revpage < 1) {
$revpage = 1;
}
elseif ($revpage > $pages) {
$revpage = $pages;
}
$start = ($revpage - 1) * $reviewsPerPage;
$GLOBALS['ProductNumReviews'] = $reviewsTotal;
$GLOBALS['ReviewStart'] = $start + 1;
$GLOBALS['ReviewEnd'] = $start + $reviewsPerPage;
// do we need to show paging?
if ($pages > 1) {
// Form the previous and next links
$reviewLink = ProdLink($GLOBALS['ISC_CLASS_PRODUCT']->GetProductName());
if($GLOBALS['EnableSEOUrls'] == 1) {
$reviewLink .= '?revpage=';
}
else {
$reviewLink .= '&revpage=';
}
if ($GLOBALS['ReviewEnd'] > $reviewsTotal) {
$GLOBALS['ReviewEnd'] = $reviewsTotal;
}
// show a previous link
if ($revpage > 1) {
$GLOBALS["ReviewLink"] = $reviewLink . ($revpage - 1);
$GLOBALS["PrevRevLink"] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewPreviousLink");
}
// show a next link
if ($revpage < $pages) {
$GLOBALS["ReviewLink"] = $reviewLink . ($revpage + 1);
$GLOBALS["NextRevLink"] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewNextLink");
}
$GLOBALS['ProductReviewPaging'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewPaging");
}
// Load all reviews for this product
$query = "
SELECT *
FROM [|PREFIX|]reviews
WHERE revproductid='".(int)$GLOBALS['ISC_CLASS_PRODUCT']->GetProductId()."' AND revstatus='1'
ORDER BY revdate DESC
";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($start, $reviewsPerPage);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$GLOBALS['ProductReviews'] = "";
$GLOBALS['AlternateReviewClass'] = '';
$GLOBALS['ReviewNumber'] = $GLOBALS['ReviewStart'];
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ReviewRating'] = (int) $row['revrating'];
$GLOBALS['ReviewTitle'] = isc_html_escape($row['revtitle']);
$GLOBALS['ReviewDate'] = isc_date(GetConfig('DisplayDateFormat'), $row['revdate']);
if ($row['revfromname'] != "") {
$GLOBALS['ReviewName'] = isc_html_escape($row['revfromname']);
} else {
$GLOBALS['ReviewName'] = GetLang('Unknown');
}
$GLOBALS['ReviewText'] = nl2br(isc_html_escape($row['revtext']));
$GLOBALS['ProductReviews'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("ProductReviewItem");
++$GLOBALS['ReviewNumber'];
if($GLOBALS['AlternateReviewClass']) {
$GLOBALS['AlternateReviewClass'] = '';
}
else {
$GLOBALS['AlternateReviewClass'] = 'Alt';
}
}
//.........这里部分代码省略.........
示例10: 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();
}
示例11: SetPanelSettings
public function SetPanelSettings()
{
$GLOBALS['SNIPPETS']['SideCartItems'] = '';
// We check $_SESSION['QUOTE'] directly here as to not
// instantiate the quote if it doesn't already exist.
if(!isset($_SESSION['QUOTE']) && getCustomerQuote()->getNumItems() == 0) {
$this->DontDisplay = true;
return;
}
$incTax = false;
if(getConfig('taxDefaultTaxDisplayCart') != TAX_PRICES_DISPLAY_EXCLUSIVE) {
$incTax = true;
}
$quote = getCustomerQuote();
$items = $quote->getItems();
foreach($items as $item) {
if($item->getProductId()) {
$GLOBALS['ProductName'] = "<a href=\"".ProdLink($item->getName())."\">".isc_html_escape($item->getName())."</a>";
}
else {
$GLOBALS['ProductName'] = isc_html_escape($item->getName());
}
// Is this product a variation?
$GLOBALS['ProductOptions'] = '';
$options = $item->getVariationOptions();
if(!empty($options)) {
$GLOBALS['ProductOptions'] .= "<br /><small>(";
$comma = '';
foreach($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['ProductPrice'] = currencyConvertFormatPrice($item->getTotal($incTax));
$GLOBALS['ProductQuantity'] = $item->getQuantity();
$GLOBALS['SNIPPETS']['SideCartItems'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCartItem");
}
$numItems = $quote->getNumItems();
if($numItems == 1) {
$GLOBALS['SideCartItemCount'] = GetLang('SideCartYouHave1Item');
} else {
$GLOBALS['SideCartItemCount'] = sprintf(GetLang('SideCartYouHaveXItems'), $numItems);
}
$total = $quote->getSubTotal($incTax);
$GLOBALS['ISC_LANG']['SideCartTotalCost'] = sprintf(GetLang('SideCartTotalCost'), CurrencyConvertFormatPrice($total));
// Go through all the checkout modules looking for one with a GetSidePanelCheckoutButton function defined
$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;
}
}
if ($HideCheckout) {
$GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = '';
} else {
require_once ISC_BASE_PATH.'/includes/display/CartHeader.php';
$cartPanel = getClass('ISC_CARTHEADER_PANEL');
$cartPanel -> insertOptimizerLinkScript();
$GLOBALS['SNIPPETS']['SideCartContentsCheckoutLink'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('SideCartContentsCheckoutLink');
}
}
示例12: ProductStatsByInventoryGrid
//.........这里部分代码省略.........
$num_pages = ceil($total_products / $per_page);
$paging = sprintf(GetLang('PageXOfX'), $page, $num_pages);
$paging .= " ";
// Is there more than one page? If so show the « to jump back to page 1
if ($num_pages > 1) {
$paging .= "<a href='javascript:void(0)' onclick='ChangeProductsByInventoryPage(1)'>«</a> | ";
} else {
$paging .= "« | ";
}
// Are we on page 2 or above?
if ($page > 1) {
$paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeProductsByInventoryPage(%d)'>%s</a> | ", $page - 1, GetLang('Prev'));
} else {
$paging .= sprintf("%s | ", GetLang('Prev'));
}
for ($i = 1; $i <= $num_pages; $i++) {
// Only output paging -5 and +5 pages from the page we're on
if ($i >= $page - 6 && $i <= $page + 5) {
if ($page == $i) {
$paging .= sprintf("<strong>%d</strong> | ", $i);
} else {
$paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeProductsByInventoryPage(%d)'>%d</a> | ", $i, $i);
}
}
}
// Are we on page 2 or above?
if ($page < $num_pages) {
$paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeProductsByInventoryPage(%d)'>%s</a> | ", $page + 1, GetLang('Next'));
} else {
$paging .= sprintf("%s | ", GetLang('Next'));
}
// Is there more than one page? If so show the » to go to the last page
if ($num_pages > 1) {
$paging .= sprintf("<a href='javascript:void(0)' onclick='ChangeProductsByInventoryPage(%d)'>»</a> | ", $num_pages);
} else {
$paging .= "» | ";
}
$paging = rtrim($paging, ' |');
$GLOBALS['Paging'] = $paging;
if (isset($_GET['SortOrder']) && $_GET['SortOrder'] == "desc") {
$sortOrder = 'desc';
} else {
$sortOrder = 'asc';
}
$sortFields = array('productid', 'prodcode', 'prodname', 'prodnumviews', 'instock');
if (isset($_GET['SortBy']) && in_array($_GET['SortBy'], $sortFields)) {
$sortField = $_GET['SortBy'];
SaveDefaultSortField("ProductStatsByInventory", $_REQUEST['SortBy'], $sortOrder);
} else {
list($sortField, $sortOrder) = GetDefaultSortField("ProductStatsByInventory", "instock", $sortOrder);
}
$sortLinks = array("ProductId" => "productid", "Code" => "prodcode", "Name" => "prodname", "Views" => "prodnumviews", "Stock" => "instock");
BuildAdminSortingLinks($sortLinks, "javascript:SortProductsByInventory('%%SORTFIELD%%', '%%SORTORDER%%');", $sortField, $sortOrder);
// Fetch the products and inventory levels for this page
$query = "\n\t\t\t\tSELECT productid, prodcode, prodname, prodnumviews, prodinvtrack,\n\t\t\t\t\tCASE prodinvtrack\n\t\t\t\t\t\tWHEN '0' THEN\n\t\t\t\t\t\t\t-1\n\t\t\t\t\t\tWHEN '1' THEN\n\t\t\t\t\t\t\tprodcurrentinv\n\t\t\t\t\t\tWHEN '2' THEN\n\t\t\t\t\t\t\t\t(SELECT SUM(vcstock) FROM [|PREFIX|]product_variation_combinations WHERE vcproductid=productid)\n\t\t\t\t\t\tEND\n\t\t\t\t\t\tAS instock\n\t\t\t\tFROM [|PREFIX|]products\n\t\t\t\t " . $vendorSql . "\n\t\t\t\tORDER BY " . $sortField . " " . $sortOrder;
// Add the Limit
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($start, $per_page);
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($GLOBALS['ISC_CLASS_DB']->CountResult($result) > 0) {
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
switch ($row['prodinvtrack']) {
case 0:
// Not tracking
$tracking_method = GetLang('NA');
break;
case 1:
// By product
$tracking_method = GetLang('StatsByProduct');
break;
case 2:
// By option
$tracking_method = GetLang('StatsByProductOption');
break;
}
switch ($row['instock']) {
case -1:
$stock_level = GetLang('NA');
$edit_link = sprintf("<span class='disabled'>%s</span>", GetLang('UpdateStockLevels'));
break;
default:
$stock_level = number_format($row['instock']);
$edit_link = sprintf("<a href='index.php?ToDo=viewProducts&productId=%d' target='_blank'>%s</span>", $row['productid'], GetLang('UpdateStockLevels'));
if ($stock_level == 0) {
// Flag if zero
$stock_level = sprintf("<b style='color:red'>%s</strong>", $stock_level);
}
}
$sku = GetLang('NA');
if ($row['prodcode'] != '') {
$sku = isc_html_escape($row['prodcode']);
}
$GLOBALS['OrderGrid'] .= sprintf("\n\t\t\t\t\t\t<tr class=\"GridRow\" onmouseover=\"this.className='GridRowOver';\" onmouseout=\"this.className='GridRow';\"> \n\t\t\t\t\t\t\t<td nowrap height=\"22\" class=\"" . $GLOBALS['SortedFieldProductIdClass'] . "\">\n\t\t\t\t\t\t\t\t%d\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"" . $GLOBALS['SortedFieldCodeClass'] . "\">\n\t\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"" . $GLOBALS['SortedFieldNameClass'] . "\">\n\t\t\t\t\t\t\t\t<a href='%s' target='_blank'>%s</a>\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td class=\"" . $GLOBALS['SortedFieldStockClass'] . "\">\n\t\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\t%s\n\t\t\t\t\t\t\t</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t", $row['productid'], $sku, ProdLink($row['prodname']), isc_html_escape($row['prodname']), $tracking_method, $stock_level, $edit_link);
}
}
} else {
$GLOBALS['OrderGrid'] .= sprintf("\n\t\t\t\t<tr class=\"GridRow\" onmouseover=\"this.className='GridRowOver';\" onmouseout=\"this.className='GridRow';\">\n\t\t\t\t\t<td nowrap height=\"22\" colspan=\"6\">\n\t\t\t\t\t\t<em>%s</em>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t", GetLang('StatsNoProducts'));
}
$GLOBALS['ISC_CLASS_TEMPLATE']->SetTemplate("stats.products.byinventorygrid");
$GLOBALS['ISC_CLASS_TEMPLATE']->ParseTemplate();
}
示例13: 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'] = '';
//.........这里部分代码省略.........
示例14: 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'] = '';
}
}
}
示例15: GetProducts
private function GetProducts()
{
header('Content-type: text/xml');
echo '<?xml version="1.0"?>';
echo '<results>';
if(!isset($_REQUEST['searchQuery']) && !isset($_REQUEST['category']) || (isset($_REQUEST['searchQuery']) && isc_strlen($_REQUEST['searchQuery']) <= 3)) {
echo "<error>".GetLang('DevEditLinkerEnterSearchTerms')."</error>";
}
else {
$_REQUEST['category'] = array($_REQUEST['category']);
$ResultCount = 0;
$GLOBALS['ISC_CLASS_ADMIN_ENGINE'] = GetClass('ISC_ADMIN_ENGINE');
$GLOBALS['ISC_CLASS_ADMIN_AUTH'] = GetClass('ISC_ADMIN_AUTH');
$GLOBALS['ISC_CLASS_ADMIN_PRODUCT'] = GetClass('ISC_ADMIN_PRODUCT');
$products = $GLOBALS['ISC_CLASS_ADMIN_PRODUCT']->_GetProductList(0, 'prodname', 'asc', $ResultCount, 'p.productid,p.prodname', false);
if($ResultCount == 0) {
if(isset($_REQUEST['searchQuery'])) {
echo "<error>".GetLang('DevEditLinkerNoProducts')."</error>";
}
else {
echo "<error>".GetLang('DevEditLinkerNoCategoryProducts')."</error>";
}
}
else {
while($product = $GLOBALS['ISC_CLASS_DB']->Fetch($products)) {
echo sprintf('<result title="%s" icon="images/product.gif" id="%s"><![CDATA[%s]]></result>', isc_html_escape(isc_html_escape($product['prodname'])), $product['productid'], ProdLink($product['prodname']));
}
}
}
echo '</results>';
}