本文整理汇总了PHP中GetProdCustomerGroupPriceSQL函数的典型用法代码示例。如果您正苦于以下问题:PHP GetProdCustomerGroupPriceSQL函数的具体用法?PHP GetProdCustomerGroupPriceSQL怎么用?PHP GetProdCustomerGroupPriceSQL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetProdCustomerGroupPriceSQL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
}
}
示例2: 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;
}
}
示例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: LoadProductsForTag
/**
* Load a list of products in the current tag that we're viewing.
*/
private function LoadProductsForTag()
{
if (!is_array($this->tag)) {
return false;
}
$query = "\n\t\t\tSELECT COUNT(p.productid) AS numproducts\n\t\t\tFROM [|PREFIX|]products p\n\t\t\tINNER JOIN [|PREFIX|]product_tagassociations ta ON (ta.productid=p.productid AND ta.tagid='" . (int) $this->tag['tagid'] . "')\n\t\t\tWHERE prodvisible='1'\n\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t";
$this->numProducts = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
$this->pageCount = ceil($this->numProducts / GetConfig('CategoryProductsPerPage'));
// For some reason the tag could has become out of sync for this tag, we need to reset it
if ($this->numProducts != $this->tag['tagcount']) {
$updatedTag = array('tagcount' => $this->numProducts);
$GLOBALS['ISC_CLASS_DB']->UpdateQuery('product_tags', $updatedTag, "tagid='" . (int) $this->tag['tagid'] . "'");
}
// Now load the actual products for this tag
$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 imageisthumb=1)\n\t\t\t\tINNER JOIN [|PREFIX|]product_tagassociations ta ON (ta.productid=p.productid AND ta.tagid='" . (int) $this->tag['tagid'] . "')\n\t\t\t\tWHERE prodvisible='1'\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY " . $this->sortField . ", prodname ASC\n\t\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->productStart, GetConfig('CategoryProductsPerPage'));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$row['prodavgrating'] = (int) $row['prodavgrating'];
$this->products[] = $row;
}
}
示例6: SearchProducts
private function SearchProducts()
{
if (!isset($_REQUEST['searchQuery']) || $_REQUEST['searchQuery'] == '') {
exit;
}
$groupId = 0;
if (isset($_REQUEST['ordcustid']) && $_REQUEST['ordcustid'] != 0) {
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo($_REQUEST['ordcustid']);
if (isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
} else {
if (isset($_REQUEST['custgroupid']) && $_REQUEST['custgroupid'] != 0) {
$groupId = (int) $_REQUEST['custgroupid'];
}
}
$numProducts = 0;
$products = GetClass('ISC_ADMIN_PRODUCT');
$result = $products->_GetProductList(0, 'p.prodname', 'asc', $numProducts, 'DISTINCT p.*, ' . GetProdCustomerGroupPriceSQL($groupId), true);
if ($numProducts == 0) {
$searchQuery = isc_html_escape($_REQUEST['searchQuery']);
$GLOBALS['OrderProductSearchNone'] = sprintf(GetLang('OrderProductSearchNone'), $searchQuery);
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchNoResults');
exit;
}
while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ProductId'] = $product['productid'];
$GLOBALS['ProductName'] = isc_html_escape($product['prodname']);
$GLOBALS['ProductLink'] = ProdLink($product['prodname']);
$actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
$actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice, $groupId);
$GLOBALS['ProductPrice'] = FormatPrice($actualPrice);
$GLOBALS['RawProductPrice'] = FormatPrice($actualPrice, false, false, true);
$GLOBALS['ProductCode'] = isc_html_escape($product['prodcode']);
$isConfigurable = false;
if ($product['prodvariationid'] != 0 || $product['prodconfigfields'] != 0) {
$isConfigurable = true;
}
$GLOBALS['ProductConfigurable'] = (int) $isConfigurable;
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchResult');
}
}
示例7: _SetProductData
public function _SetProductData($productid = 0)
{
//alandy_2012-2-29 add.
$this->_search_prefix = $GLOBALS['ShopPathNormal'] . '/';
$GLOBALS['ISC_CLASS_REMOTE'] = GetClass('ISC_REMOTE');
if ($productid == 0) {
// Retrieve the query string variables. Can't use the $_GET array
// because of SEO friendly links in the URL
SetPGQVariablesManually();
if (isset($_REQUEST['product'])) {
$product = $_REQUEST['product'];
//alandy_2012-2-20 modify.add vendorprefix#sku
if (stristr($product, '_')) {
list($productVendorprefix, $productSKU) = explode('_', $product);
$productSKU = decode_sku($productSKU);
$productSQL = sprintf("p.prodvendorprefix='%s' and p.prodcode = '%s'", $productVendorprefix, $productSKU);
} else {
$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($product));
$productSQL = sprintf("p.prodname='%s'", $product);
}
} else {
if (isset($GLOBALS['PathInfo'][1])) {
//alandy_2012-2-20 modify.add vendorprefix#sku
$htmlUrl = preg_replace('#\\.html$#i', '', $GLOBALS['PathInfo'][1]);
if (stristr($htmlUrl, '_')) {
$product = $htmlUrl;
list($productVendorprefix, $productSKU) = explode('_', $product);
$productSKU = decode_sku($productSKU);
$productSQL = sprintf("p.prodvendorprefix='%s' and p.prodcode = '%s'", $productVendorprefix, $productSKU);
} else {
$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($htmlUrl));
$productSQL = sprintf("p.prodname='%s'", $product);
}
} else {
$product = '';
$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($product));
$productSQL = sprintf("p.prodname='%s'", $product);
}
}
//$product = $GLOBALS['ISC_CLASS_DB']->Quote(MakeURLNormal($product));
//$productSQL = sprintf("p.prodname='%s'", $product);
} else {
$productSQL = sprintf("p.productid='%s'", (int) $productid);
}
$query = "\n\t\t\t\tSELECT p.*, prodratingtotal/prodnumratings AS prodavgrating, imageisthumb, imagefile, " . GetProdCustomerGroupPriceSQL() . ", infl.instructionfile, infl.systeminstructionfile, artfl.articlefile, artfl.systemarticlefile,\n\t\t\t\t(SELECT COUNT(fieldid) FROM [|PREFIX|]product_customfields WHERE fieldprodid=p.productid) AS numcustomfields,\n\t\t\t\t(SELECT COUNT(reviewid) FROM [|PREFIX|]reviews WHERE revstatus='1' AND revproductid=p.productid AND revstatus='1') AS numreviews,\n\t\t\t\t(SELECT brandname FROM [|PREFIX|]brands WHERE brandid=p.prodbrandid) AS prodbrandname,\n (SELECT brandimagefile FROM [|PREFIX|]brands WHERE brandid=p.prodbrandid) AS prodbrandimagefile,\n (SELECT proddesc FROM [|PREFIX|]brand_series where seriesid = p.brandseriesid and brandid = p.prodbrandid) AS prodseriesdesc,\n\t\t\t\t(SELECT COUNT(imageid) FROM [|PREFIX|]product_images pi WHERE pi.imageprodid=p.productid AND imageisthumb=0) AS numimages, \n (SELECT COUNT(imageid) FROM [|PREFIX|]install_images ti WHERE ti.imageprodid=p.productid AND imageisthumb=0) AS numinsimages, \n (SELECT COUNT(videoid) FROM [|PREFIX|]product_videos pv WHERE pv.videoprodid=p.productid AND (pv.videofile LIKE '%.flv' || pv.systemvideofile LIKE '%.flv' || pv.videofile LIKE '%.swf' || pv.systemvideofile LIKE '%.swf')) AS numvideos, \n (SELECT COUNT(videoid) FROM [|PREFIX|]install_videos iv WHERE iv.videoprodid=p.productid AND (iv.videofile LIKE '%.flv' || iv.systemvideofile LIKE '%.flv' || iv.videofile LIKE '%.swf' || iv.systemvideofile LIKE '%.swf')) AS numinsvideos, \n (SELECT COUNT(audioid) FROM [|PREFIX|]audio_clips ac WHERE ac.audioprodid=p.productid AND (ac.audiofile LIKE '%.flv' || ac.systemaudiofile LIKE '%.flv' || ac.audiofile LIKE '%.swf' || ac.systemaudiofile LIKE '%.swf')) AS numaudios,\n\t\t\t\t(SELECT COUNT(discountid) FROM [|PREFIX|]product_discounts WHERE discountprodid=p.productid) AS numbulkdiscounts\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb=1 AND p.productid=pi.imageprodid)\n LEFT JOIN [|PREFIX|]instruction_files infl ON p.productid = infl.instructionprodid\n LEFT JOIN [|PREFIX|]article_files artfl ON p.productid = artfl.articleprodid \n\t\t\t\tWHERE " . $productSQL . " AND p.prodvisible='1'\n\t\t\t";
// Query for ins images, videos, ins videos added by Simha
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
if ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$this->_product = $row;
$this->_prodid = $row['productid'];
$this->_prodname = $row['prodname'];
$this->_prodsku = $row['prodcode'];
$this->_prodthumb = $row['imagefile'];
$proddescription = '';
/*if($row['prodseriesdesc'] != '' and !empty($row['prodseriesdesc'])) { # Baskaran
$proddescription = $row['prodseriesdesc'];
}
else {
$proddescription = $row['proddesc'];
} */
$proddescription = $row['prodseriesdesc'] . " " . $row['proddesc'];
$this->_proddesc = $proddescription;
$this->_proddescfeature = $row['proddescfeature'];
//Added by Simha
$this->_prodinsimages = $row['numinsimages'];
//Added by Simha
$this->_prodmfg = $row['prodmfg'];
/*--- added by vikas-clarion-- */
$this->_prodimages = $row['numimages'];
//Added by Simha
$this->_prodvideos = $row['numvideos'];
//Added by Simha
$this->_prodaudios = $row['numaudios'];
//Added by Simha
$this->_prodtestdata = $row['testdata'];
//Added by Simha
$this->_prodinsvideos = $row['numinsvideos'];
$this->_prodbrandimagefile = $row['prodbrandimagefile'];
# Baskaran
$this->_prodcompitem = $row['complementaryitems'];
# Baskaran
$this->_comptype = $row['comp_type'];
$this->_prodprice = $row['prodprice'];
$this->_prodretailprice = $row['prodretailprice'];
$this->_prodsaleprice = $row['prodsaleprice'];
$this->_prodfixedshippingcost = $row['prodfixedshippingcost'];
$this->_prodbrandname = $row['prodbrandname'];
$this->_prodweight = $row['prodweight'];
$this->_prodavgrating = $this->getRoundValue((double) $row['prodavgrating']);
$this->_prodcalculatedprice = $row['prodcalculatedprice'];
$this->_prodoptionsrequired = $row['prodoptionsrequired'];
$this->_prodnumreviews = $row['numreviews'];
$this->_prodavailability = $row['prodavailability'];
$this->_prodnumcustomfields = $row['numcustomfields'];
$this->_prodnumbulkdiscounts = $row['numbulkdiscounts'];
$this->_prodeventdatelimited = $row['prodeventdatelimited'];
$this->_prodeventdaterequired = $row['prodeventdaterequired'];
$this->_prodeventdatefieldname = $row['prodeventdatefieldname'];
$this->_prodeventdatelimitedtype = $row['prodeventdatelimitedtype'];
$this->_prodeventdatelimitedstartdate = $row['prodeventdatelimitedstartdate'];
//.........这里部分代码省略.........
示例8: SearchProducts
private function SearchProducts()
{
if (!isset($_REQUEST['searchQuery']) || $_REQUEST['searchQuery'] == '') {
exit;
}
$groupId = 0;
if (isset($_REQUEST['ordcustid']) && $_REQUEST['ordcustid'] != 0) {
$customerClass = GetClass('ISC_CUSTOMER');
$customer = $customerClass->GetCustomerInfo($_REQUEST['ordcustid']);
if (isset($customer['custgroupid'])) {
$groupId = $customer['custgroupid'];
}
} else {
if (isset($_REQUEST['custgroupid']) && $_REQUEST['custgroupid'] != 0) {
$groupId = (int) $_REQUEST['custgroupid'];
}
}
$numProducts = 0;
$products = GetClass('ISC_ADMIN_PRODUCT');
/***********************************************************************
Altered By Mayank Jaitly 12 July 2010
Original Code is in the else
/***********************************************************************/
if (isset($_REQUEST['w']) && $_REQUEST['w'] == 'orderSearchProducts') {
$result = $products->_GetProductList(0, 'ct.catuniversal,p.prodname', 'asc', $numProducts, 'DISTINCT p.*, ' . GetProdCustomerGroupPriceSQL($groupId), true);
} else {
$result = $products->_GetProductList(0, 'p.prodname', 'asc', $numProducts, 'DISTINCT p.*, ' . GetProdCustomerGroupPriceSQL($groupId), true);
}
if ($numProducts == 0) {
$searchQuery = isc_html_escape($_REQUEST['searchQuery']);
$GLOBALS['OrderProductSearchNone'] = sprintf(GetLang('OrderProductSearchNone'), $searchQuery);
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchNoResults');
exit;
}
while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$GLOBALS['ProductId'] = $product['productid'];
$GLOBALS['ProductName'] = isc_html_escape($product['prodname']);
$GLOBALS['ProductLink'] = ProdLink($product['prodname']);
$actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
$actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice, $groupId);
$GLOBALS['ProductPrice'] = FormatPrice($actualPrice);
$GLOBALS['RawProductPrice'] = FormatPrice($actualPrice, false, false, true);
$GLOBALS['ProductCode'] = isc_html_escape($product['prodcode']);
$isConfigurable = false;
if ($product['prodvariationid'] != 0 || $product['prodconfigfields'] != 0) {
$isConfigurable = true;
}
$GLOBALS['ProductConfigurable'] = (int) $isConfigurable;
/************************************************************************
Code Altered by Mayank Jaitly on 01 July 2010
Original code is with comment area
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchResult');
/***************************************************************************/
/// Start of alteration
if (isset($_REQUEST['ajaxsearchtype']) && $_REQUEST['ajaxsearchtype'] == '2') {
$GLOBALS['SKU'] = isc_html_escape($product['prodvendorprefix']);
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchResultSKU');
} else {
echo $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet('OrdersProductSearchResult');
}
//// End of alteration
}
}
示例9: SetPanelSettings
public function SetPanelSettings()
{
$count = 0;
$output = "";
$GLOBALS['SNIPPETS']['HomeNewProducts'] = '';
if (GetConfig('HomeNewProducts') > 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.prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\t\tORDER BY proddateadded DESC\n\t\t\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit(0, GetConfig('HomeNewProducts'));
$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['ProductRating'] = (int) $row['prodavgrating'];
// Determine the price of this product
$GLOBALS['ProductPrice'] = CalculateProductPrice_retail($row);
// Workout the product description
$desc = strip_tags($row['proddesc']);
if (strlen($desc) < 120) {
$GLOBALS['ProductSummary'] = $desc;
} else {
$GLOBALS['ProductSummary'] = substr($desc, 0, 120) . "...";
}
$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
// 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['SNIPPETS']['HomeNewProducts'] .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeNewProductsItem");
}
// Showing the syndication option?
if (GetConfig('RSSNewProducts') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
$GLOBALS['SNIPPETS']['HomeNewProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("HomeNewProductsFeed");
}
} else {
$this->DontDisplay = true;
$GLOBALS['HideHomeNewProductsPanel'] = "none";
}
} else {
$this->DontDisplay = true;
$GLOBALS['HideHomeNewProductsPanel'] = "none";
}
}
示例10: LoadProductsForBrand
public function LoadProductsForBrand()
{
$taxJoin = $this->getTaxPricingJoin();
$query = "
SELECT p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL()."
FROM [|PREFIX|]products p
LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1)
".$taxJoin."
WHERE prodbrandid='".(int)$this->GetId()."' AND prodvisible='1'
".GetProdCustomerGroupPermissionsSQL()."
ORDER BY ".$this->GetSortField().", prodname ASC
";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$row['prodavgrating'] = (int)$row['prodavgrating'];
$this->_brandproducts[] = $row;
}
}
示例11: LoadProductsForPage
public function LoadProductsForPage()
{
$query = "\n\t\t\t\tSELECT\n\t\t\t\t\tp.*,\n\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating,\n\t\t\t\t\timageisthumb,\n\t\t\t\t\timagefile,\n\t\t\t\t\t" . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM\n\t\t\t\t\t(\n\t\t\t\t\t\tSELECT\n\t\t\t\t\t\t\tDISTINCT ca.productid,\n\t\t\t\t\t\t\tFLOOR(prodratingtotal / prodnumratings) AS prodavgrating\n\t\t\t\t\t\tFROM\n\t\t\t\t\t\t\t[|PREFIX|]categoryassociations ca\n\t\t\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\t\tWHERE\n\t\t\t\t\t\t\tp.prodvisible = 1 AND\n\t\t\t\t\t\t\tca.categoryid IN (" . $this->GetProductCategoryIds() . ")\n\t\t\t\t\t\tORDER BY\n\t\t\t\t\t\t\t" . $this->GetSortField() . ", p.prodname ASC\n\t\t\t\t\t\t" . $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage')) . "\n\t\t\t\t\t) AS ca\n\t\t\t\t\tINNER JOIN [|PREFIX|]products p ON p.productid = ca.productid\n\t\t\t\t\tLEFT JOIN [|PREFIX|]product_images pi ON (pi.imageisthumb = 1 AND p.productid = pi.imageprodid)\n\t\t\t";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$row['prodavgrating'] = (int) $row['prodavgrating'];
$this->_catproducts[] = $row;
}
}
示例12: 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;
}
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, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tWHERE p.prodvisible='1' AND prodratingtotal > '0' " . $categorySql . "\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['ProductRating'] = (int) $row['prodavgrating'];
// 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'] = '';
}
}
$output .= $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProducts");
}
// Showing the syndication option?
if (GetConfig('RSSPopularProducts') != 0 && GetConfig('RSSCategories') != 0 && GetConfig('RSSSyndicationIcons') != 0) {
$GLOBALS['ISC_LANG']['CategoryPopularProductsFeed'] = sprintf(GetLang('CategoryPopularProductsFeed'), isc_html_escape($GLOBALS['CatName']));
$GLOBALS['SNIPPETS']['SideCategoryPopularProductsFeed'] = $GLOBALS['ISC_CLASS_TEMPLATE']->GetSnippet("SideCategoryPopularProductsFeed");
}
} else {
$GLOBALS['HideSideCategoryPopularProductsPanel'] = "none";
$this->DontDisplay = true;
}
$GLOBALS['SNIPPETS']['SideCategoryPopularProducts'] = $output;
}
示例13: _GetWishListItemsByToken
/**
* Get a list of items in this customer's wishlist by wish list token
*/
private function _GetWishListItemsByToken($wishlisttoken="")
{
$items = array();
$query = "
SELECT wi.wishlistitemid, p.*, FLOOR(prodratingtotal/prodnumratings) AS prodavgrating, pi.*, ".GetProdCustomerGroupPriceSQL()."
FROM [|PREFIX|]wishlists w
LEFT JOIN [|PREFIX|]wishlist_items wi ON (w.wishlistid=wi.wishlistid)
INNER JOIN [|PREFIX|]products p ON (wi.productid=p.productid)
LEFT JOIN [|PREFIX|]product_images pi ON (p.productid=pi.imageprodid AND pi.imageisthumb=1)
WHERE w.wishlisttoken='".$GLOBALS['ISC_CLASS_DB']->Quote($wishlisttoken)."'
".GetProdCustomerGroupPermissionsSQL()."
";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
array_push($items, $row);
}
return $items;
}
示例14: AddToCart
private function AddToCart()
{
if (!isset($_REQUEST['product_id'])) {
ob_end_clean();
header(sprintf("Location: %s/makeaoffer.php", GetConfig('ShopPath')));
die;
}
// First get the list of existing products in the cart
$product_id = (int) $_REQUEST['product_id'];
$GLOBALS['ProductJustAdded'] = $product_id;
$query = "\n\t\t\t\tSELECT p.*, " . GetProdCustomerGroupPriceSQL() . "\n\t\t\t\tFROM [|PREFIX|]products p\n\t\t\t\tWHERE p.productid='" . (int) $product_id . "'\n\t\t\t";
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
$product = $GLOBALS['ISC_CLASS_DB']->Fetch($result);
$GLOBALS['Product'] =& $product;
// Check that the customer has permisison to view this product
$canView = false;
$productCategories = explode(',', $product['prodcatids']);
foreach ($productCategories as $categoryId) {
// Do we have permission to access this category?
if (CustomerGroupHasAccessToCategory($categoryId)) {
$canView = true;
}
}
if ($canView == false) {
$noPermissionsPage = GetClass('ISC_403');
$noPermissionsPage->HandlePage();
exit;
}
$variation = 0;
if (isset($_REQUEST['variation_id']) && $_REQUEST['variation_id'] != 0) {
$variation = (int) $_REQUEST['variation_id'];
} else {
if (isset($_REQUEST['variation']) && is_array($_REQUEST['variation']) && $_REQUEST['variation'][1] != 0) {
$variation = $_REQUEST['variation'];
}
}
$qty = 1;
if (isset($_REQUEST['qty'])) {
if (is_array($_REQUEST['qty'])) {
$qty = (int) array_pop($_REQUEST['qty']);
} else {
if ($_REQUEST['qty'] > 0) {
$qty = (int) $_REQUEST['qty'];
}
}
}
$configurableFields = null;
if (isset($_REQUEST['ProductFields']) || isset($_FILES['ProductFields'])) {
$configurableFields = $this->BuildProductConfigurableFieldData();
}
$options = array();
if (isset($_REQUEST['EventDate']['Day'])) {
$result = true;
$eventDate = isc_gmmktime(0, 0, 0, $_REQUEST['EventDate']['Mth'], $_REQUEST['EventDate']['Day'], $_REQUEST['EventDate']['Yr']);
$eventName = $product['prodeventdatefieldname'];
if ($product['prodeventdatelimitedtype'] == 1) {
if ($eventDate < $product['prodeventdatelimitedstartdate'] || $eventDate > $product['prodeventdatelimitedenddate']) {
$result = false;
}
} else {
if ($product['prodeventdatelimitedtype'] == 2) {
if ($eventDate < $product['prodeventdatelimitedstartdate']) {
$result = false;
}
} else {
if ($product['prodeventdatelimitedtype'] == 3) {
if ($eventDate > $product['prodeventdatelimitedenddate']) {
$result = false;
}
}
}
}
if ($result == false) {
$this->ShowRegularCart();
return;
}
$options['EventDate'] = $eventDate;
$options['EventName'] = $eventName;
}
// Actually add the product to the cart
$cartItemId = $this->api->AddItem($product_id, $qty, $variation, $configurableFields, null, $options);
$this->newCartItem = $cartItemId;
if ($cartItemId === false) {
$this->cartErrorMessage = implode('<br />', $this->api->GetErrors());
if (!$this->cartErrorMessage) {
$this->cartErrorMessage = GetLang('ProductUnavailableForPruchase');
}
if ($this->api->productLevelError == true) {
$query = "\n\t\t\t\t\t\tSELECT prodname\n\t\t\t\t\t\tFROM [|PREFIX|]products\n\t\t\t\t\t\tWHERE productid='" . (int) $product_id . "'\n\t\t\t\t\t";
$productName = $GLOBALS['ISC_CLASS_DB']->FetchOne($query);
$_SESSION['ProductErrorMessage'] = $this->cartErrorMessage;
ob_end_clean();
header("Location: " . ProdLink($productName));
exit;
}
$this->ShowRegularCart();
return;
}
$this->api->ReapplyCouponsFromCart();
//Added by Simha temp fix to avoid having multiple times coupon for same item
//.........这里部分代码省略.........
示例15: LoadProductsForBrand
public function LoadProductsForBrand()
{
$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 prodbrandid='" . (int) $this->GetId() . "' AND prodvisible='1' AND (imageisthumb=1 OR ISNULL(imageisthumb))\n\t\t\t\t" . GetProdCustomerGroupPermissionsSQL() . "\n\t\t\t\tORDER BY " . $this->GetSortField() . ", prodname ASC\n\t\t\t";
$query .= $GLOBALS['ISC_CLASS_DB']->AddLimit($this->GetStart(), GetConfig('CategoryProductsPerPage'));
$result = $GLOBALS['ISC_CLASS_DB']->Query($query);
while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
$row['prodavgrating'] = (int) $row['prodavgrating'];
$this->_brandproducts[] = $row;
}
}