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


PHP CalcRealPrice函数代码示例

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


在下文中一共展示了CalcRealPrice函数的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
         }
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:48,代码来源:HomeSaleProducts.php

示例2: BulkEditProductsStep2

 /**
  * BulkEditProductsStep2
  * Save the changes made on the bulk editing page
  *
  * @return Void
  */
 public function BulkEditProductsStep2()
 {
     if (isset($_POST["product_ids"])) {
         $product_ids = explode(",", $_POST["product_ids"]);
         // Only fetch products this user can actually edit
         $vendorRestriction = '';
         if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId()) {
             $vendorRestriction = " AND prodvendorid='" . (int) $GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() . "'";
         }
         // Load the existing products
         $existingProducts = array();
         $query = "SELECT * FROM [|PREFIX|]products WHERE productid IN (" . implode(",", $GLOBALS['ISC_CLASS_DB']->Quote($product_ids)) . ") " . $vendorRestriction;
         $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
         while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
             $existingProducts[$product['productid']] = $product;
         }
         foreach ($product_ids as $product_id) {
             $prodname = $_POST["prodname_" . $product_id];
             $prodprice = DefaultPriceFormat($_POST["prodprice_" . $product_id]);
             $prodbrand = $_POST["prodbrand_" . $product_id];
             $prodbrandold = $_POST["existing_brand_" . $product_id];
             $prodbrandid = $_POST["existing_brand_id_" . $product_id];
             $prodcats = $_POST["category_" . $product_id];
             $prodcatsold = $_POST["existing_categories_" . $product_id];
             $prodfeatured = 0;
             if (isset($_POST['prodfeatured_' . $product_id])) {
                 $prodfeatured = 1;
             }
             $prodvisible = 0;
             if (isset($_POST['prodvisible_' . $product_id])) {
                 $prodvisible = 1;
             }
             $prodfreeshipping = 0;
             if (isset($_POST['prodfreeshipping_' . $product_id])) {
                 $prodfreeshipping = 1;
             }
             $prodCatsCSV = implode(",", $prodcats);
             // Calculate the new price of the product
             $existingProduct = $existingProducts[$product_id];
             $prodcalculatedprice = CalcRealPrice($prodprice, $existingProduct['prodretailprice'], $existingProduct['prodsaleprice'], $existingProduct['prodistaxable']);
             // Do we need to update the categories?
             if ($prodCatsCSV != $prodcatsold) {
                 $GLOBALS["ISC_CLASS_DB"]->DeleteQuery("categoryassociations", sprintf("WHERE productid='%d'", $product_id));
                 // Add the new category associations
                 foreach ($prodcats as $cat_id) {
                     $ca = array("productid" => $product_id, "categoryid" => $cat_id);
                     $GLOBALS['ISC_CLASS_DB']->InsertQuery("categoryassociations", $ca);
                 }
             }
             // Do we need to update the brand?
             if ($prodbrand != $prodbrandold) {
                 if ($prodbrand != "") {
                     // Is it an existing brand?
                     $bquery = sprintf("SELECT brandid FROM [|PREFIX|]brands WHERE lower(brandname)='%s'", strtolower($prodbrand));
                     $bresult = $GLOBALS["ISC_CLASS_DB"]->Query($bquery);
                     if ($brow = $GLOBALS["ISC_CLASS_DB"]->Fetch($bresult)) {
                         // It's an existing brand
                         $brand_id = $brow['brandid'];
                     } else {
                         // It's a new brand, let's add it
                         $ba = array("brandname" => $prodbrand);
                         $GLOBALS['ISC_CLASS_DB']->InsertQuery("brands", $ba);
                         $brand_id = $GLOBALS["ISC_CLASS_DB"]->LastId();
                     }
                 } else {
                     // Delete the brand
                     $brand_id = 0;
                 }
             } else {
                 // The brand hasn't been changed
                 $brand_id = $prodbrandid;
             }
             if ($GLOBALS['ISC_CLASS_ADMIN_AUTH']->GetVendorId() > 0) {
                 $featuredColumn = 'prodvendorfeatured';
             } else {
                 $featuredColumn = 'prodfeatured';
             }
             // Update the product details
             $pa = array("productid" => $product_id, "prodname" => $prodname, "prodprice" => $prodprice, "prodcalculatedprice" => $prodcalculatedprice, $featuredColumn => $prodfeatured, "prodvisible" => $prodvisible, "prodfreeshipping" => $prodfreeshipping, "prodbrandid" => $brand_id, "prodcatids" => $prodCatsCSV);
             $entity = new ISC_ENTITY_PRODUCT();
             $entity->bulkEdit($pa);
             // Save the words to the product_words table for search spelling suggestions
             $this->SaveProductWords($prodname, $product_id, "editing");
         }
         // Update product pricing
         $GLOBALS['ISC_CLASS_ADMIN_SETTINGS'] = GetClass('ISC_ADMIN_SETTINGS');
         $GLOBALS['ISC_CLASS_ADMIN_SETTINGS']->_UpdateProductPrices();
         // Do we want to keep editing or return to the products list?
         if (isset($_POST['keepediting'])) {
             $_POST['products'] = $product_ids;
             $this->BulkEditProductsStep1(GetLang("BulkEditUpdatedSuccessfully"), MSG_SUCCESS);
         } else {
             $this->ManageProducts(GetLang("BulkEditUpdatedSuccessfully"), MSG_SUCCESS);
         }
//.........这里部分代码省略.........
开发者ID:nirvana-info,项目名称:old_bak,代码行数:101,代码来源:class.product_18_12.php

示例3: _UpdateProductPrices

 public function _UpdateProductPrices()
 {
     // Update the price of each and every product in the database
     $query = "select productid, prodprice, prodretailprice, prodsaleprice, prodistaxable from [|PREFIX|]products";
     $result = $GLOBALS['ISC_CLASS_DB']->Query($query);
     while ($row = $GLOBALS['ISC_CLASS_DB']->Fetch($result)) {
         // Workout the calculated price for this product as it will be displayed
         $calcprice = CalcRealPrice($row['prodprice'], $row['prodretailprice'], $row['prodsaleprice'], $row['prodistaxable']);
         // Run an update query
         $updatedProduct = array("prodcalculatedprice" => $calcprice);
         $GLOBALS['ISC_CLASS_DB']->UpdateQuery("products", $updatedProduct, "productid='" . $GLOBALS['ISC_CLASS_DB']->Quote($row['productid']) . "'");
     }
     // Log this action
     $GLOBALS['ISC_CLASS_LOG']->LogAdminAction();
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:15,代码来源:class.settings_nov25.php

示例4: CalcProductVariationPrice

/**
 * Calculate the price adjustment for a variation of a product.
 *
 * @var decimal The base price of the product.
 * @var string The type of adjustment to be performed (empty, add, subtract, fixed)
 * @var decimal The value to be adjusted by
 * @return decimal The adjusted value
 */
function CalcProductVariationPrice($basePrice, $type, $difference, $product=null)
{
	switch (strtolower($type)) {
		case "fixed":
			$newPrice = $difference;
			break;
		case "add":
			$newPrice = $basePrice + $difference;
			break;
		case "subtract":
			$adjustedCost = $basePrice - $difference;
			if($adjustedCost <= 0) {
				$adjustedCost = 0;
			}
			$newPrice = $adjustedCost;
			break;
		default:
			$newPrice =$basePrice;
	}

	if(!is_null($product)) {
		$newPrice = CalcProdCustomerGroupPrice($product, $newPrice);
	}

	// apply any tax if applicable.
	$newPrice = CalcRealPrice($newPrice, 0, 0);

	return $newPrice;
}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:37,代码来源:pricing.php

示例5: PopupProductList

 private function PopupProductList()
 {
     /* if(isset($_REQUEST['seriesid']) && $_REQUEST['category'] == 0) {
            unset($_REQUEST['category']);
        }  */
     $seriesid = $_REQUEST['seriesid'];
     $brandid = $_REQUEST['brandid'];
     $_SESSION['radiotype'] = "series";
     $_SESSION['lastselseriesid'] = $seriesid;
     $_SESSION['lastselbrandid'] = $brandid;
     if (!isset($_REQUEST['seriesid'])) {
         $tags[] = $this->MakeXMLTag('status', 0);
         $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectEnterTerms'), true);
     } else {
         if (isset($_REQUEST['seriesid'])) {
             $_REQUEST['seriesid'] = array($_REQUEST['seriesid']);
         }
         $ResultCount = 0;
         $GLOBALS['ISC_CLASS_ADMIN_PRODUCT'] = GetClass('ISC_ADMIN_PRODUCT');
         $products = $GLOBALS["ISC_CLASS_DB"]->Query("SELECT * FROM [|PREFIX|]products where brandseriesid = '{$seriesid}' and prodbrandid = '{$brandid}'");
         $ResultCount = $GLOBALS["ISC_CLASS_DB"]->CountResult($products);
         if ($ResultCount == 0) {
             $tags[] = $this->MakeXMLTag('status', 0);
             if (isset($_REQUEST['searchQuery'])) {
                 $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectNoProducts'), true);
             } else {
                 $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectNoProductsBrands'), true);
             }
         } else {
             $results = '';
             $tags[] = $this->MakeXMLTag('status', 1);
             while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($products)) {
                 $actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
                 $actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice);
                 $isConfigurable = false;
                 if ($product['prodvariationid'] != 0 || $product['prodconfigfields'] != 0 || $product['prodeventdaterequired'] == 1) {
                     $isConfigurable = true;
                 }
                 $results .= '
                         <product>
                             <productId>' . $product['productid'] . '</productId>
                             <productName><![CDATA[' . $product['prodname'] . ']]></productName>
                             <productPrice>' . FormatPrice($actualPrice, false, false, true) . '</productPrice>
                             <productCode><![CDATA[' . $product['prodcode'] . ']]></productCode>
                             <productType>' . $product['prodtype'] . '</productType>
                             <productConfigurable>' . (int) $isConfigurable . '</productConfigurable>
                         </product>
                     ';
             }
             $tags[] = $this->MakeXMLTag('results', $results);
         }
     }
     $this->SendXMLHeader();
     $this->SendXMLResponse($tags);
     die;
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:56,代码来源:class.remote_dec04.php

示例6: PopupProductSearch

    /**
     * Show the select a product popup page on the create a coupon page
     *
     * @return void
     **/
    private function PopupProductSearch()
    {
        if (isset($_REQUEST['category']) && $_REQUEST['category'] == 0) {
            unset($_REQUEST['category']);
        }
        if (!isset($_REQUEST['searchQuery']) && !isset($_REQUEST['category'])) {
            $tags[] = $this->MakeXMLTag('status', 0);
            $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectEnterTerms'), true);
        } else {
            if (isset($_REQUEST['category'])) {
                $_REQUEST['category'] = array($_REQUEST['category']);
            }
            $ResultCount = 0;
            $GLOBALS['ISC_CLASS_ADMIN_PRODUCT'] = GetClass('ISC_ADMIN_PRODUCT');
            $products = $GLOBALS['ISC_CLASS_ADMIN_PRODUCT']->_GetProductList(0, 'prodname', 'asc', $ResultCount, 'p.productid,p.prodname,p.prodprice,p.prodsaleprice,p.prodretailprice,p.prodconfigfields,p.prodvariationid,p.prodtype,p.prodcode,p.prodistaxable,p.prodeventdaterequired', false);
            if ($ResultCount == 0) {
                $tags[] = $this->MakeXMLTag('status', 0);
                if (isset($_REQUEST['searchQuery'])) {
                    $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectNoProducts'), true);
                } else {
                    $tags[] = $this->MakeXMLTag('message', GetLang('ProductSelectNoProductsCategory'), true);
                }
            } else {
                $results = '';
                $tags[] = $this->MakeXMLTag('status', 1);
                while ($product = $GLOBALS['ISC_CLASS_DB']->Fetch($products)) {
                    $actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
                    $actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice);
                    $isConfigurable = false;
                    if ($product['prodvariationid'] != 0 || $product['prodconfigfields'] != 0 || $product['prodeventdaterequired'] == 1) {
                        $isConfigurable = true;
                    }
                    $results .= '
							<product>
								<productId>' . $product['productid'] . '</productId>
								<productName><![CDATA[' . $product['prodname'] . ']]></productName>
								<productPrice>' . FormatPrice($actualPrice, false, false, true) . '</productPrice>
								<productCode><![CDATA[' . $product['prodcode'] . ']]></productCode>
								<productType>' . $product['prodtype'] . '</productType>
								<productConfigurable>' . (int) $isConfigurable . '</productConfigurable>
							</product>
						';
                }
                $tags[] = $this->MakeXMLTag('results', $results);
            }
        }
        $this->SendXMLHeader();
        $this->SendXMLResponse($tags);
        die;
    }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:55,代码来源:class.remote_dec01.php

示例7: 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');
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:43,代码来源:class.remote.orders_23_Jult_mj.php

示例8: parsedata

 /**
  * Parse the product data
  *
  * Method will parse the product data to be inserted into the database
  *
  * @access private
  * @param array &$input The input data
  * @return NULL
  */
 private function parsedata(&$input)
 {
     // Workout the calculated price for this product as it will be displayed
     $input['prodcalculatedprice'] = CalcRealPrice($input['prodprice'], $input['prodretailprice'], $input['prodsaleprice'], $input['prodistaxable']);
     // If inventory tracking is on a product option basis, then product options are required
     if ($input['prodinvtrack'] == 2) {
         $input['prodoptionsrequired'] = 1;
     }
     // If we are importing and don't have any variations
     if (!array_key_exists('prodvariationid', $input)) {
         $input['prodvariationid'] = 0;
     }
     if (!array_key_exists('prodallowpurchases', $input)) {
         $input['prodallowpurchases'] = 1;
         $input['prodhideprice'] = 0;
         $input['prodcallforpricinglabel'] = '';
     }
     if (!array_key_exists('prodhideprice', $input)) {
         $input['prodhideprice'] = 0;
     }
     if (!array_key_exists('prodcallforpricinglabel', $input)) {
         $input['prodcallforpricinglabel'] = '';
     }
     //if (array_key_exists('prodcats', $input)) {
     //	$input['prodcatids'] = implode(',', $input['prodcats']);
     //} else {
     //$input['prodcatids'] = '';
     //}
     if (isset($input['prodcats']) and $input['prodcats'] != "") {
         $input['prodcatids'] = implode(',', $input['prodcats']);
     } else {
         $input['prodcatids'] = '';
     }
     if (!isset($input['prodvendorid'])) {
         $input['prodvendorid'] = 0;
     }
     if (isset($input['prodtags']) && $input['prodtags'] != '') {
         $input['prodhastags'] = 1;
     } else {
         $input['prodhastags'] = 0;
     }
     if (!isset($input['prodvendorfeatured'])) {
         $input['prodvendorfeatured'] = 0;
     }
     if (!isset($input['prodwrapoptions'])) {
         $input['prodwrapoptions'] = 0;
     }
     if (!isset($input['prodeventdatefieldname'])) {
         $input['prodeventdaterequired'] = 0;
         $input['prodeventdatefieldname'] = '';
         $input['prodeventdatelimited'] = 0;
         $input['prodeventdatelimitedtype'] = 0;
         $input['prodeventdatelimitedstartdate'] = 0;
         $input['prodeventdatelimitedenddate'] = 0;
     }
     $id = null;
     if (array_key_exists('productid', $input)) {
         $id = $input['productid'];
     }
     $input = array('prodname' => $input['prodname'], 'prodtype' => $input['prodtype'], 'prodcode' => $input['prodcode'], 'proddesc' => $input['proddesc'], 'prodmfg' => $input['prodmfg'], 'prodsearchkeywords' => $input['prodsearchkeywords'], 'prodalternates' => $input['prodalternates'], 'prodavailability' => $input['prodavailability'], 'prodprice' => $input['prodprice'], 'prodcostprice' => $input['prodcostprice'], 'prodretailprice' => $input['prodretailprice'], 'prodsaleprice' => $input['prodsaleprice'], 'prodcalculatedprice' => $input['prodcalculatedprice'], 'prodistaxable' => $input['prodistaxable'], 'prodsortorder' => $input['prodsortorder'], 'prodvisible' => $input['prodvisible'], 'prodfeatured' => $input['prodfeatured'], 'prodvendorfeatured' => (int) $input['prodvendorfeatured'], 'prodrelatedproducts' => $input['prodrelatedproducts'], 'prodinvtrack' => $input['prodinvtrack'], 'prodcurrentinv' => $input['prodcurrentinv'], 'prodlowinv' => $input['prodlowinv'], 'prodoptionsrequired' => $input['prodoptionsrequired'], 'prodwarranty' => $input['prodwarranty'], 'prodweight' => $input['prodweight'], 'prodwidth' => $input['prodwidth'], 'prodheight' => $input['prodheight'], 'proddepth' => $input['proddepth'], 'prodfixedshippingcost' => $input['prodfixedshippingcost'], 'prodfreeshipping' => $input['prodfreeshipping'], 'prodbrandid' => $input['prodbrandid'], 'prodpagetitle' => $input['prodpagetitle'], 'prodmetakeywords' => $input['prodmetakeywords'], 'prodmetadesc' => $input['prodmetadesc'], 'prodlayoutfile' => $input['prodlayoutfile'], 'prodvariationid' => $input['prodvariationid'], 'prodallowpurchases' => $input['prodallowpurchases'], 'prodhideprice' => $input['prodhideprice'], 'prodcallforpricinglabel' => $input['prodcallforpricinglabel'], 'prodcatids' => $input['prodcatids'], 'prodlastmodified' => time(), 'prodvendorid' => (int) $input['prodvendorid'], 'prodhastags' => $input['prodhastags'], 'prodwrapoptions' => $input['prodwrapoptions'], 'prodeventdaterequired' => $input['prodeventdaterequired'], 'prodeventdatefieldname' => $input['prodeventdatefieldname'], 'prodeventdatelimited' => $input['prodeventdatelimited'], 'prodeventdatelimitedtype' => $input['prodeventdatelimitedtype'], 'prodeventdatelimitedstartdate' => $input['prodeventdatelimitedstartdate'], 'prodeventdatelimitedenddate' => $input['prodeventdatelimitedenddate'], 'prodmyobasset' => $input['prodmyobasset'], 'prodmyobincome' => $input['prodmyobincome'], 'prodmyobexpense' => $input['prodmyobexpense'], 'prodpeachtreegl' => $input['prodpeachtreegl'], 'prodvendorprefix' => $input['prodvendorprefix'], 'proddescfeature' => $input['proddescfeature'], 'jobberprice' => $input['jobberprice'], 'mapprice' => $input['mapprice'], 'unilateralprice' => $input['unilateralprice'], 'alternativecategory' => $input['alternativecategory'], 'complementaryupcharge' => $input['complementaryupcharge'], 'ourcost' => $input['ourcost'], 'package_length' => $input['package_length'], 'package_width' => $input['package_width'], 'package_height' => $input['package_height'], 'package_weight' => $input['package_weight'], 'brandseriesid' => $input['brandseriesid'], 'future_retail_price' => $input['future_retail_price'], 'future_jobber_price' => $input['future_jobber_price'], 'prod_instruction' => $input['prod_instruction'], 'prod_article' => $input['prod_article'], 'skubarcode' => $input['skubarcode'], 'price_log' => $input['price_log'], 'SKU_last_update_time' => $input['SKU_last_update_time'], 'price_update_time' => $input['price_update_time'], 'install_time' => $input['install_time'], 'testdata' => $input['testdata'], 'comp_type' => $input['comp_type']);
     if (!is_null($id)) {
         $input['productid'] = $id;
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:73,代码来源:entity.product.php

示例9: CalculateProductPrice

function CalculateProductPrice($product, $doLocaleFormat = true, $doCurrencyConvert = true, $strikeOutRetail = true)
{
    if (!GetConfig('ShowProductPrice') || $product['prodhideprice'] == 1) {
        return '';
    }
    $actualPrice = CalcRealPrice($product['prodprice'], $product['prodretailprice'], $product['prodsaleprice'], $product['prodistaxable']);
    $actualPrice = CalcProdCustomerGroupPrice($product, $actualPrice);
    // Calculate the actual price for this product in the current currency
    if ($doCurrencyConvert == true) {
        $actualPrice = ConvertPriceToCurrency($actualPrice);
    }
    $output = '';
    if ($doLocaleFormat) {
        // Does this product have a RRP?
        if ($actualPrice > 0 && $actualPrice < $product['prodretailprice'] && $strikeOutRetail == true) {
            $rrp = CalcProdCustomerGroupPrice($product, $product['prodretailprice']);
            $rrp = ConvertPriceToCurrency($product['prodretailprice']);
            $output .= '<strike>' . FormatPrice($rrp) . '</strike> ';
        }
    }
    if ($product['prodsaleprice'] > 0 && $product['prodsaleprice'] < $product['prodprice']) {
        $output .= '<span class="SalePrice">' . FormatPrice($actualPrice) . '</span>';
    } else {
        $output .= FormatPrice($actualPrice);
    }
    return $output;
}
开发者ID:nirvana-info,项目名称:old_bak,代码行数:27,代码来源:pricing_SDec03.php

示例10: 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
     }
 }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:63,代码来源:class.remote.orders.php

示例11: InsertProduct


//.........这里部分代码省略.........
             $productData['prodrelatedproducts'] = implode(",", $productData['prodrelatedproducts']);
         }
     }
     if (!isset($productData['prodwarranty'])) {
         $productData['prodwarranty'] = '';
     }
     if (!isset($productData['prodwidth'])) {
         $productData['prodwidth'] = 0;
     }
     if (!isset($productData['proddepth'])) {
         $productData['proddepth'] = 0;
     }
     if (!isset($productData['prodheight'])) {
         $productData['prodheight'] = 0;
     }
     if (!isset($productData['prodfixedshippingcost'])) {
         $productData['prodfixedshippingcost'] = 0;
     }
     if (!isset($productData['prodoptionsrequired'])) {
         $productData['prodoptionsrequired'] = 0;
     }
     if (!isset($productData['prodnumviews'])) {
         $productData['prodnumviews'] = 0;
     }
     if (!isset($productData['prodmetakeywords'])) {
         $productData['prodmetakeywords'] = '';
     }
     if (!isset($productData['prodmetadesc'])) {
         $productData['prodmetadesc'] = '';
     }
     if (!isset($productData['prodlayoutfile'])) {
         $productData['prodlayoutfile'] = 0;
     }
     $calculatedPrice = CalcRealPrice($productData['prodprice'], @$productData['prodretailprice'], @$productData['prodretailprice'], @$productData['prodistaxable']);
     $prodCats = array();
     // Insert any category associations
     foreach ($productData['categories'] as $catId) {
         $categoryId = $this->GetImportCategoryId($catId);
         $prodCats[] = $categoryId;
     }
     $prodCatsCSV = implode(',', $prodCats);
     $product = array("importproductid" => $productId, "prodname" => $productData['prodname'], "prodtype" => (int) $productData['prodtype'], "prodcode" => $productData['prodcode'], "proddesc" => $productData['proddesc'], "prodsearchkeywords" => $productData['prodsearchkeywords'], "prodavailability" => $productData['prodavailability'], "prodprice" => (double) $productData['prodprice'], "prodcostprice" => (double) $productData['prodcostprice'], "prodretailprice" => (double) $productData['prodretailprice'], "prodsaleprice" => (double) $productData['prodsaleprice'], "prodcalculatedprice" => (double) $calculatedPrice, "prodsortorder" => (int) $productData['prodsortorder'], "prodvisible" => $productData['prodvisible'], "prodfeatured" => $productData['prodfeatured'], "prodrelatedproducts" => $productData['prodrelatedproducts'], "prodcurrentinv" => (int) $productData['prodcurrentinv'], "prodlowinv" => (int) $productData['prodlowinv'], "prodoptionsrequired" => $productData['prodoptionsrequired'], "prodwarranty" => $productData['prodwarranty'], "prodweight" => (double) $productData['prodweight'], "prodwidth" => (double) $productData['prodwidth'], "prodheight" => (double) $productData['prodheight'], "proddepth" => (double) $productData['proddepth'], "prodfixedshippingcost" => (double) $productData['prodfixedshippingcost'], "prodfreeshipping" => $productData['prodfreeshipping'], "prodinvtrack" => $productData['prodinvtrack'], "prodratingtotal" => 0, "prodnumratings" => 0, "prodnumsold" => (int) $productData['prodnumsold'], "proddateadded" => (int) $productData['proddateadded'], "prodbrandid" => $brandId, "prodnumviews" => (int) $productData['prodnumviews'], "prodmetakeywords" => $productData['prodmetakeywords'], "prodmetadesc" => $productData['prodmetadesc'], "prodcatids" => $prodCatsCSV, "prodmyobasset" => '', "prodmyobincome" => '', "prodmyobexpense" => '', "prodpeachtreegl" => '');
     $productId = $this->ConvertedInsertQuery("products", $product);
     if (!$productId) {
         $err = "Failed to insert product (DEBUG)";
         $this->_LogImportError('invalid', $err);
         return false;
     }
     // Insert any category associations
     foreach ($prodCats as $categoryId) {
         $association = array("productid" => $productId, "categoryid" => $categoryId);
         $this->ConvertedInsertQuery("categoryassociations", $association);
     }
     // Are there any product images that need to be inserted?
     $has_thumb = false;
     $has_tiny = false;
     $thumb_file = '';
     $tiny_file = '';
     $firstImage = '';
     if (is_array($productData['images'])) {
         $GLOBALS['ISC_CLASS_ADMIN_PRODUCT'] = GetClass('ISC_ADMIN_PRODUCT');
         foreach ($productData['images'] as $k => $image) {
             // Only copy across product images that exist
             if (isset($image['imagefile']) && !file_exists($image['imagefile'])) {
                 continue;
             }
开发者ID:nirvana-info,项目名称:old_bak,代码行数:67,代码来源:class.converter.php

示例12: editPrehook

	protected function editPrehook($productId, &$savedata, $rawInput)
	{
		/**
		 * Workout the calculated price for this product as it will be displayed
		 */
		if (isset($rawInput["prodprice"]) && isset($rawInput["prodretailprice"]) && isset($rawInput["prodsaleprice"])) {
			$savedata["prodcalculatedprice"] = CalcRealPrice($rawInput["prodprice"], $rawInput["prodsaleprice"]);
		}

		/**
		 * If inventory tracking is on a product option basis, then product options are required
		 */
		if (array_key_exists("prodinvtrack", $savedata) && $savedata["prodinvtrack"] == 2) {
			$savedata["prodoptionsrequired"] = 1;
		}

		if (isset($rawInput["prodcats"])) {
			$savedata["prodcatids"] = implode(",", $rawInput["prodcats"]);
		}

		$savedata["prodlastmodified"] = time();

		return true;
	}
开发者ID:hungnv0789,项目名称:vhtm,代码行数:24,代码来源:entity.product.php


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