• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP CSaleBasket类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: isBarCodeValid

 public static function isBarCodeValid($arParams)
 {
     $bResult = false;
     $arBasket = array();
     if (intval($arParams["basketItemId"]) > 0) {
         $dbBasket = CSaleBasket::GetList(array("ID" => "DESC"), array("ID" => $arParams["basketItemId"]), false, false, array("ID", "PRODUCT_ID", "PRODUCT_PROVIDER_CLASS", "MODULE", "BARCODE_MULTI"));
         $arBasket = $dbBasket->GetNext();
     } else {
         $arBasket = array("PRODUCT_PROVIDER_CLASS" => $arParams["productProvider"], "MODULE" => $arParams["moduleName"], "PRODUCT_ID" => $arParams["productId"], "BARCODE_MULTI" => $arParams["barcodeMult"]);
     }
     if (!empty($arBasket) && is_array($arBasket)) {
         /** @var $productProvider IBXSaleProductProvider */
         if ($productProvider = CSaleBasket::GetProductProvider($arBasket)) {
             $arCheckBarcodeFields = array("BARCODE" => $arParams["barcode"], "PRODUCT_ID" => $arBasket["PRODUCT_ID"], "ORDER_ID" => $arParams["orderId"]);
             if ($arBasket["BARCODE_MULTI"] == "Y") {
                 $arCheckBarcodeFields["STORE_ID"] = $arParams["storeId"];
             }
             $res = $productProvider::CheckProductBarcode($arCheckBarcodeFields);
             if ($res) {
                 $bResult = true;
             }
         }
     }
     return $bResult;
 }
开发者ID:Satariall,项目名称:izurit,代码行数:25,代码来源:order_helper.php


示例2: GetBasketList

function GetBasketList($bSkipFUserInit = true)
{
    $fUserID = (int) CSaleBasket::GetBasketUserID($bSkipFUserInit);
    $arRes = array();
    if ($fUserID > 0) {
        $basketID = array();
        $db_res = CSaleBasket::GetList(array(), array("FUSER_ID" => $fUserID, "LID" => SITE_ID, "ORDER_ID" => false), false, false, array('ID', 'CALLBACK_FUNC', 'PRODUCT_PROVIDER_CLASS', 'MODULE', 'PRODUCT_ID', 'QUANTITY', 'NOTES'));
        while ($res = $db_res->Fetch()) {
            $res['CALLBACK_FUNC'] = (string) $res['CALLBACK_FUNC'];
            $res['PRODUCT_PROVIDER_CLASS'] = (string) $res['PRODUCT_PROVIDER_CLASS'];
            if ($res['CALLBACK_FUNC'] != '' || $res['PRODUCT_PROVIDER_CLASS'] != '') {
                CSaleBasket::UpdatePrice($res["ID"], $res["CALLBACK_FUNC"], $res["MODULE"], $res["PRODUCT_ID"], $res["QUANTITY"], 'N', $res["PRODUCT_PROVIDER_CLASS"], $res['NOTES']);
            }
            $basketID[] = $res['ID'];
        }
        unset($res, $db_res);
        if (!empty($basketID)) {
            $basketIterator = CSaleBasket::GetList(array('NAME' => 'ASC'), array('ID' => $basketID));
            while ($basket = $basketIterator->GetNext()) {
                $arRes[] = $basket;
            }
            unset($basket, $basketIterator);
        }
        unset($basketID);
    }
    return $arRes;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:27,代码来源:include.php


示例3: OrderBasket

    /**
     *
    * return array() BasketList - experation - Send Order
    **/
    public static function OrderBasket($experation = NULL,$sort = array("ID" => "ASC"), $limit = NULL){
        global $DB;
        $arItems = array();
        if(! $experation){
            $experation = 30*24*60*60;
        }
        $time = date($DB->DateFormatToPHP(CSite::GetDateFormat("FULL", SITE_ID)), time() - $experation);
        $arPages = false;
        if(! empty($limit)){
            $arPages = array('nTopCount' =>  $limit);
        }
        $arFilter = array('>=DATE_UPDATE' => $time,
                          "ORDER_ID" => true,
                          "CAN_BUY" => "Y");
        $arSelect = array("ID", "USER_ID", "PRODUCT_ID", "CAN_BUY", "DELAY", "SUBSCRIBE", "QUANTITY","DATE_UPDATE","DETAIL_PAGE_URL");
        $dbBasketList = CSaleBasket::GetList(
				$sort,
				$arFilter,
				false,
				$arPages,
				$arSelect
			);
			while($_arItems = $dbBasketList->Fetch()){
				$arItems[] = $_arItems;
			}
        return $arItems;
    }
开发者ID:Kulkow,项目名称:ipdesign.k1785,代码行数:31,代码来源:basket.php


示例4: AddGoogleAnaliticsEcommerceCode

    function AddGoogleAnaliticsEcommerceCode($orderId, $arOrder, $arParams){

        global $APPLICATION;

        if(isset($_SESSION['GA_ORDER_ID']) && $_SESSION['GA_ORDER_ID'] == $orderId) return;

        $gaOutput = array();

        $arSite = CSite::GetByID($arOrder['LID'])->Fetch();

        $gaOutput[] = "<script>";
        $gaOutput[] = "ga('require', 'ecommerce', 'ecommerce.js');";

        $gaOutput[] = sprintf(
            "ga('ecommerce:addTransaction', {
                'id': '%s',
                'affiliation': '%s',
                'revenue': '%s',
                'shipping': '%s',
                'tax': ''
            });",
            $orderId,
            $arSite['NAME'],
            $arOrder['PRICE'],
            $arOrder['PRICE_DELIVERY']
        );

        $dbBasket = CSaleBasket::GetList(
            array("NAME" => "ASC"),
            array("ORDER_ID" => $orderId)
        );

        while($basketItem = $dbBasket->fetch()){

            $gaOutput[] = sprintf(
                "ga('ecommerce:addItem', {
                    'id': '%s',
                    'name': '%s',
                    'sku': '%s',
                    'category': '',
                    'price': '%s',
                    'quantity': '%s'
                });",
                $orderId,
                $basketItem['NAME'],
                $basketItem['PRODUCT_ID'],
                $basketItem['PRICE'],
                $basketItem['QUANTITY']
            );

        }

        $gaOutput[] = "ga('ecommerce:send');";
        $gaOutput[] = "</script>";

        $APPLICATION->AddHeadString(implode("\n", $gaOutput), true);

        $_SESSION['GA_ORDER_ID'] = $orderId;

    }
开发者ID:nycmic,项目名称:bittest,代码行数:60,代码来源:init.php


示例5: getUserDelay

function getUserDelay ($userId){
    // Получаем список корзины
    $arBasketItems = array();
    $dbBasketItems = CSaleBasket::GetList(
            array(
                    "NAME" => "ASC",
                    "ID" => "ASC"
                ),
            array(
                    "FUSER_ID" =>$userId,
                    "LID" => SITE_ID,
                    "ORDER_ID" => "NULL"
                ),
            false,
            false,
            array("ID", "CALLBACK_FUNC", "MODULE", "NAME", 
                  "PRODUCT_ID", "QUANTITY", "DELAY", 
                  "CAN_BUY", "PRICE", "DATE_INSERT", "DATE_UPDATE")
        );
    while ($arItems = $dbBasketItems->Fetch())
    {
        if (strlen($arItems["CALLBACK_FUNC"]) > 0)
        {
            CSaleBasket::UpdatePrice($arItems["ID"], 
                                     $arItems["CALLBACK_FUNC"], 
                                     $arItems["MODULE"], 
                                     $arItems["PRODUCT_ID"], 
                                     $arItems["QUANTITY"]);
            $arItems = CSaleBasket::GetByID($arItems["ID"]);
        }

        $arBasketItems[] = $arItems;
    }

    // Печатаем массив, содержащий актуальную на текущий момент корзину
   /* echo "<pre>";
    print_r($arBasketItems);
    echo "</pre>"; */ 
    
    $whishlist="";
    foreach ($arBasketItems as $delay){  
        $notBuy="Y"; // флаг для проверки покупался ли данный товар,
       $difference = floor(intval(abs( time() - strtotime($delay[DATE_INSERT]) ))/(3600 * 24));  
        // перебираем отложенные элементы, срок которых менее 30 дней        
        if ($delay["DELAY"]=="Y" && $difference < 30){
            foreach ($arBasketItems as $notDelay){
                //перебираем купленные элементы и сравниваем с отложенными
                if ($notDelay["DELAY"]!="Y" && $delay[PRODUCT_ID]==$notDelay[PRODUCT_ID] && $difference < 30){
                   $notBuy="N";  // товар уже покупался                  
                }                
            }
            if($notBuy=="Y"){
            $whishlist .= ' '.$delay["NAME"].',';    
            }
        }        
    }
    $whishlist = trim($whishlist, ",");
    return  $whishlist;    
}
开发者ID:russeljo,项目名称:ratio_test,代码行数:59,代码来源:task2a.php


示例6: OnBeforeBasketAdd

 public static function OnBeforeBasketAdd(array $fields)
 {
     if (Loader::includeModule('conversion')) {
         if ($row = \CSaleBasket::GetList(array(), array('LID' => $fields['LID'], 'FUSER_ID' => $fields['FUSER_ID'], 'PRODUCT_ID' => $fields['PRODUCT_ID'], 'ORDER_ID' => 'NULL'), false, false, array('PRICE', 'QUANTITY'))->Fetch()) {
             self::$cartSum = $row['PRICE'] * $row['QUANTITY'];
         } else {
             self::$cartSum = 0;
         }
     }
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:10,代码来源:handlers.php


示例7: addProductToCart

 public function addProductToCart(Product $product, $quantity)
 {
     Loader::includeModule('sale');
     $price = reset($product['PRICES']);
     $properties = array();
     foreach ($product->getShopParameters() as $name => $value) {
         $properties[] = array('NAME' => $name, 'VALUE' => $value);
     }
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     \CSaleBasket::Add(array('PRODUCT_ID' => $product['ID'], 'PRODUCT_PRICE_ID' => $price['ID'], 'PRICE' => $price['PRICE'], 'CURRENCY' => $price['CURRENCY'], 'QUANTITY' => $quantity, 'LID' => SITE_ID, 'NAME' => $product['NAME'], 'NOTES' => $product['DETAIL_TEXT'], 'PROPS' => $properties));
 }
开发者ID:techart,项目名称:bitrix.tao,代码行数:11,代码来源:Bundle.php


示例8: getProductInBasketParams

 /**
  * Returns quantity of product in current user's basket
  *
  * @param integer $productID
  * @return float
  */
 public static function getProductInBasketParams($productID)
 {
     global $DB;
     CModule::IncludeModule('sale');
     $id = intval($productID);
     $fuserID = CSaleBasket::GetBasketUserID();
     $strSql = "SELECT ID, QUANTITY " . "FROM b_sale_basket " . "WHERE PRODUCT_ID = " . $id . " AND FUSER_ID = " . $fuserID . " AND ORDER_ID IS NULL";
     $rsBasket = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
     if ($arBasket = $rsBasket->Fetch()) {
         return array("ID" => $arBasket["ID"], "QUANTITY" => floatval($arBasket["QUANTITY"]));
     }
     return false;
 }
开发者ID:ASDAFF,项目名称:bitrix-snippets,代码行数:19,代码来源:class.SaleHelper.php


示例9: GetBasketList

function GetBasketList($bSkipFUserInit = False)
{
    $fUserID = CSaleBasket::GetBasketUserID($bSkipFUserInit);
    $arRes = array();
    if ($fUserID > 0) {
        $db_res = CSaleBasket::GetList(array("NAME" => "ASC"), array("FUSER_ID" => $fUserID, "LID" => SITE_ID, "ORDER_ID" => "NULL"));
        while ($res = $db_res->GetNext()) {
            if (strlen($res["CALLBACK_FUNC"]) > 0 || strlen($res["PRODUCT_PROVIDER_CLASS"]) > 0) {
                CSaleBasket::UpdatePrice($res["ID"], $res["CALLBACK_FUNC"], $res["MODULE"], $res["PRODUCT_ID"], $res["QUANTITY"], $res["PRODUCT_PROVIDER_CLASS"]);
                $res = CSaleBasket::GetByID($res["ID"]);
            }
            $arRes[] = $res;
        }
    }
    return $arRes;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:16,代码来源:include.php


示例10: onGenerateInitialData

 public static function onGenerateInitialData(Date $from, Date $to)
 {
     $data = array();
     // 1. Payments
     $result = \CSaleOrder::GetList(array(), array('PAYED' => 'Y', 'CANCELED' => 'N', '>=DATE_PAYED' => $from, '<=DATE_PAYED' => $to), false, false, array('LID', 'DATE_PAYED', 'PRICE', 'CURRENCY'));
     while ($row = $result->Fetch()) {
         $day = new DateTime($row['DATE_PAYED']);
         $sum = Utils::convertToBaseCurrency($row['PRICE'], $row['CURRENCY']);
         if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
             $counters['sale_payment_add_day'] += 1;
             $counters['sale_payment_sum_add'] += $sum;
         } else {
             $counters = array('sale_payment_add_day' => 1, 'sale_payment_sum_add' => $sum);
         }
     }
     // 2. Orders
     $result = \CSaleOrder::GetList(array(), array('CANCELED' => 'N', '>=DATE_INSERT' => $from, '<=DATE_INSERT' => $to), false, false, array('LID', 'DATE_INSERT', 'PRICE', 'CURRENCY'));
     while ($row = $result->Fetch()) {
         $day = new DateTime($row['DATE_INSERT']);
         $sum = Utils::convertToBaseCurrency($row['PRICE'], $row['CURRENCY']);
         if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
             $counters['sale_order_add_day'] += 1;
             $counters['sale_order_sum_add'] += $sum;
         } else {
             $counters = array('sale_order_add_day' => 1, 'sale_order_sum_add' => $sum);
         }
     }
     // 3. Cart
     $result = \CSaleBasket::GetList(array(), array('>=DATE_INSERT' => $from, '<=DATE_INSERT' => $to), false, false, array('LID', 'DATE_INSERT', 'PRICE', 'CURRENCY', 'QUANTITY'));
     while ($row = $result->Fetch()) {
         $day = new DateTime($row['DATE_INSERT']);
         $sum = Utils::convertToBaseCurrency($row['PRICE'] * $row['QUANTITY'], $row['CURRENCY']);
         if ($counters =& $data[$row['LID']][$day->format('Y-m-d')]) {
             $counters['sale_cart_add_day'] += 1;
             $counters['sale_cart_sum_add'] += $sum;
         } else {
             $counters = array('sale_cart_add_day' => 1, 'sale_cart_sum_add' => $sum);
         }
     }
     // Result
     unset($counters);
     $result = array();
     foreach ($data as $siteId => $dayCounters) {
         $result[] = array('ATTRIBUTES' => array('conversion_site' => $siteId), 'DAY_COUNTERS' => $dayCounters);
     }
     return $result;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:47,代码来源:conversionhandlers.php


示例11: getNmuBasket

 function getNmuBasket(){
     $dbBasketItems = CSaleBasket::GetList(
     array(
             "NAME" => "ASC",
             "ID" => "ASC"
             ),
     array(
             "FUSER_ID" => CSaleBasket::GetBasketUserID(),
             "LID" => SITE_ID,
             "ORDER_ID" => "NULL"
             ),
     false,
     false,
     array()
     );
     $num=0;
     while($basket=$dbBasketItems->Fetch()) $num++;
     return $num;
 }
开发者ID:ASDAFF,项目名称:bitrix-solution.video,代码行数:19,代码来源:calculate.php


示例12: OnBasketChange

	public static function OnBasketChange($ID, $arFields = false)
	{
		if(isset($_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID]))
		{
			$num_products = $_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID];
		}
		else
		{
			if(!CModule::IncludeModule("sale"))
			{
				return;
			}
			$fUserID = CSaleBasket::GetBasketUserID(True);
			$fUserID = IntVal($fUserID);
			$num_products = 0;
			if ($fUserID > 0)
			{
				$dbRes = CSaleBasket::GetList(
					array(),
					array(
						"FUSER_ID" => $fUserID,
						"LID" => SITE_ID,
						"ORDER_ID" => "NULL",
						"CAN_BUY" => "Y",
						"DELAY" => "N",
						"SUBSCRIBE" => "N"
					)
				);
				while ($arItem = $dbRes->GetNext())
				{
					if (!CSaleBasketHelper::isSetItem($arItem))
						$num_products++;
				}
			}
			$_SESSION["SALE_BASKET_NUM_PRODUCTS"][SITE_ID] = intval($num_products);
		}

		echo "<script>
			if (document.getElementById('bx_cart_num'))
				document.getElementById('bx_cart_num').innerHTML = '".(($num_products > 0) ? " (".$num_products.")" : "")."';
			</script>";
	}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:42,代码来源:include.php


示例13: OnSalePayOrder

 public static function OnSalePayOrder($ID, $val)
 {
     $ID = intval($ID);
     if ($ID > 0 && $val == 'Y') {
         $arOrder = array();
         $dbBasketItems = CSaleBasket::GetList(array(), array('ORDER_ID' => $ID), false, false, array('ID', 'MODULE', 'CATALOG_XML_ID', 'QUANTITY'));
         while ($arItems = $dbBasketItems->Fetch()) {
             if ($arItems['MODULE'] == 'asd.money' && !empty($arItems['CATALOG_XML_ID']) && strpos($arItems['CATALOG_XML_ID'], '@') !== false) {
                 if (empty($arOrder)) {
                     $rsOrders = CSaleOrder::GetList(array(), array('ID' => $ID), false, false, array('ID', 'USER_ID'));
                     $arOrder = $rsOrders->Fetch();
                     if (empty($arOrder)) {
                         return;
                     }
                 }
                 list($amount, $curr) = explode('@', $arItems['CATALOG_XML_ID']);
                 CSaleUserAccount::UpdateAccount($arOrder['USER_ID'], doubleval($amount) * doubleval($arItems['QUANTITY']), $curr, GetMessage('ASD_MODULE_TRANSACT_PREPAID'), $ID);
             }
         }
     }
 }
开发者ID:Hawkart,项目名称:megatv,代码行数:21,代码来源:include.php


示例14: getProductDataToFillBasket


//.........这里部分代码省略.........

		// ratio
		$arElementInfo["RATIO"] = 1;
		$dbratio = CCatalogMeasureRatio::GetList(array(), array("PRODUCT_ID" => $productId));
		if ($arRatio = $dbratio->Fetch())
			$arElementInfo["RATIO"] = $arRatio["RATIO"];

		// image
		if ($arElementInfo["PREVIEW_PICTURE"] > 0)
			$imgCode = $arElementInfo["PREVIEW_PICTURE"];
		elseif ($arElementInfo["DETAIL_PICTURE"] > 0)
			$imgCode = $arElementInfo["DETAIL_PICTURE"];

		if ($imgCode == "" && count($arParent) > 0)
		{
			if ($arParent["PREVIEW_PICTURE"] > 0)
				$imgCode = $arParent["PREVIEW_PICTURE"];
			elseif ($arParent["DETAIL_PICTURE"] > 0)
				$imgCode = $arParent["DETAIL_PICTURE"];
		}

		if ($imgCode > 0)
		{
			$arFile = CFile::GetFileArray($imgCode);
			$arImgProduct = CFile::ResizeImageGet($arFile, array('width'=>80, 'height'=>80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
			if (is_array($arImgProduct))
				$imgUrl = $arImgProduct["src"];
		}

		$arSetInfo = array();
		$arStores = array();

		/** @var $productProvider IBXSaleProductProvider */
		if ($productProvider = CSaleBasket::GetProductProvider(array("MODULE" => $arElementInfo["MODULE"], "PRODUCT_PROVIDER_CLASS" => $arElementInfo["PRODUCT_PROVIDER_CLASS"])))
		{
			// get set items if it is set
			if ($arProduct["TYPE"] == CCatalogProduct::TYPE_SET)
			{
				if (method_exists($productProvider, "GetSetItems"))
				{
					$arSets = $productProvider::GetSetItems($productId, CSaleBasket::TYPE_SET);

					if ($tmpId == "")
						$tmpId = randString(7);

					if (!empty($arSets))
					{
						foreach ($arSets as $arSetData)
						{
							foreach ($arSetData["ITEMS"] as $setItem)
							{
								$arSetItemParams = getProductDataToFillBasket($setItem["PRODUCT_ID"], $setItem["QUANTITY"], $userId, $LID, $userColumns, $tmpId); // recursive call

								// re-define some fields with set data values
								$arSetItemParams["id"] = $setItem["PRODUCT_ID"];
								$arSetItemParams["name"] = $setItem["NAME"];
								$arSetItemParams["module"] = $setItem["MODULE"];
								$arSetItemParams["productProviderClass"] = $setItem["PRODUCT_PROVIDER_CLASS"];
								$arSetItemParams["url"] = $setItem["DETAIL_PAGE_URL"];
								$arSetItemParams["quantity"] = $setItem["QUANTITY"] * $quantity;
								$arSetItemParams["barcodeMulti"] = $setItem["BARCODE_MULTI"];
								$arSetItemParams["productType"] = $setItem["TYPE"];
								$arSetItemParams["weight"] = $setItem["WEIGHT"];
								$arSetItemParams["vatRate"] = $setItem["VAT_RATE"];
								$arSetItemParams["setItems"] = "";
开发者ID:akniyev,项目名称:arteva.ru,代码行数:66,代码来源:admin_tool.php


示例15: obtainBasketProps

 public function obtainBasketProps(&$arBasketItems)
 {
     // prepare some indexes
     $arElementIds = array();
     // a collection of PRODUCT_IDs and parent PRODUCT_IDs
     $arSku2Parent = array();
     // a mapping SKU PRODUCT_IDs to PARENT PRODUCT_IDs
     $arParents = array();
     // also
     $arSkuProps = array();
     if (self::isNonemptyArray($arBasketItems)) {
         foreach ($arBasketItems as &$arItem) {
             // get sale properties: which was added with CSaleBasket::Add(array('PROP' => array(...)))
             $arItem["PROPS"] = array();
             $dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arItem["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")));
             while ($arProp = $dbProp->GetNext()) {
                 $arItem["PROPS"][] = $arProp;
             }
             // catalog-specific logic farther: iblocks, catalogs and other friends
             if (!$this->cameFromCatalog($arItem)) {
                 continue;
             }
             $arElementIds[] = $arItem["PRODUCT_ID"];
             if ($arItem['PARENT']) {
                 $arElementIds[] = $arItem['PARENT']["ID"];
                 $arSku2Parent[$arItem["PRODUCT_ID"]] = $arItem['PARENT']["ID"];
                 $arParents[$arItem["PRODUCT_ID"]]["PRODUCT_ID"] = $arItem['PARENT']["ID"];
                 $arParents[$arItem["PRODUCT_ID"]]["IBLOCK_ID"] = $arItem['PARENT']["IBLOCK_ID"];
             }
             if (self::isNonemptyArray($arItem['PROPS'])) {
                 foreach ($arItem['PROPS'] as $prop) {
                     $arSkuProps[$prop['CODE']] = 1;
                 }
             }
         }
         $arSkuProps = array_keys($arSkuProps);
         // fetching iblock props
         $this->obtainBasketPropsElement($arBasketItems, $arElementIds, $arSku2Parent);
         // fetching sku props, if any
         $this->obtainBasketPropsSKU($arBasketItems, $arSkuProps, $arParents);
     }
     return $arBasketItems;
 }
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:43,代码来源:class.php


示例16: array

$weight = 0;
$price = 0;
$price_total = 0;
$arProdIds = array();
//http://jabber.bx/view.php?id=37744
$arProdIdsPrIds = array();
$useStores = false;
while ($arBasket = $dbBasket->Fetch()) {
    $arProdIds[] = $arBasket["PRODUCT_ID"];
    $arProdIdsPrIds[$arBasket["PRODUCT_ID"]] = $arBasket["ID"];
    $arBasket["BALANCE"] = "0";
    $arBasket["STORES"] = array();
    $arBasket["HAS_SAVED_QUANTITY"] = "N";
    $arBasket["HAS_SAVED_BARCODES"] = false;
    /** @var $productProvider IBXSaleProductProvider */
    if ($productProvider = CSaleBasket::GetProductProvider($arBasket)) {
        $storeCount = $productProvider::GetStoresCount(array("SITE_ID" => $LID));
        if ($storeCount > 0) {
            if ($arProductStore = $productProvider::GetProductStores(array("PRODUCT_ID" => $arBasket["PRODUCT_ID"], "SITE_ID" => $LID, 'BASKET_ID' => $arBasket['ID']))) {
                foreach ($arProductStore as $arStore) {
                    $arBasket["STORES"][$arStore["STORE_ID"]] = $arStore;
                }
                if (!$useStores && $storeCount != -1) {
                    $useStores = true;
                }
                // if barcodes/store quantity are already saved for this product,
                // then check if barcodes are still valid and save them to the store array
                $ind = 0;
                $dbres = CSaleStoreBarcode::GetList(array(), array("BASKET_ID" => $arBasket["ID"]), false, false, array("ID", "BASKET_ID", "BARCODE", "STORE_ID", "ORDER_ID", "QUANTITY", "DEDUCTED"));
                while ($arRes = $dbres->GetNext()) {
                    $arCheckBarcodeFields = array("BARCODE" => $arRes["BARCODE"], "PRODUCT_ID" => $arBasket["PRODUCT_ID"], "ORDER_ID" => $arParams["ORDER_ID"]);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:component.php


示例17: array

<?php

// в модуле интернет-магазина нужно включить на стройку - "Использовать совместимость для просмотренных товаров каталога"
$countViewedProducts = 0;
$GLOBALS['arViewedProducts'] = array();
if (\Bitrix\Main\Loader::includeModule("catalog") && \Bitrix\Main\Loader::includeModule("sale")) {
    $arFilter["FUSER_ID"] = CSaleBasket::GetBasketUserID();
    if (\Bitrix\Main\Config\Option::get("sale", "viewed_capability", "") == "Y") {
        $viewedIterator = \Bitrix\Catalog\CatalogViewedProductTable::getList(array("filter" => $arFilter, "select" => array("ID", "PRODUCT_ID"), "order" => array("DATE_VISIT" => "DESC")));
        while ($row = $viewedIterator->fetch()) {
            $GLOBALS['arViewedProducts'][] = $row['PRODUCT_ID'];
            $countViewedProducts++;
        }
    }
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:15,代码来源:viewed_product.php


示例18: array

						<td align="center">Цена, руб</td>
						<td align="center">Cумма, руб</td>
					</tr>
					<?php 
    $priceTotal = 0;
    $bUseVat = false;
    $arBasketOrder = array();
    for ($i = 0, $countBasketIds = count($arBasketIDs); $i < $countBasketIds; $i++) {
        $arBasketTmp = CSaleBasket::GetByID($arBasketIDs[$i]);
        if (floatval($arBasketTmp["VAT_RATE"]) > 0) {
            $bUseVat = true;
        }
        $priceTotal += $arBasketTmp["PRICE"] * $arBasketTmp["QUANTITY"];
        $arBasketTmp["PROPS"] = array();
        if (isset($_GET["PROPS_ENABLE"]) && $_GET["PROPS_ENABLE"] == "Y") {
            $dbBasketProps = CSaleBasket::GetPropsList(array("SORT" => "ASC", "NAME" => "ASC"), array("BASKET_ID" => $arBasketTmp["ID"]), false, false, array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT"));
            while ($arBasketProps = $dbBasketProps->GetNext()) {
                $arBasketTmp["PROPS"][$arBasketProps["ID"]] = $arBasketProps;
            }
        }
        $arBasketOrder[] = $arBasketTmp;
    }
    //разбрасываем скидку на заказ по товарам
    if (floatval($arOrder["DISCOUNT_VALUE"]) > 0) {
        $arBasketOrder = GetUniformDestribution($arBasketOrder, $arOrder["DISCOUNT_VALUE"], $priceTotal);
    }
    //налоги
    $arTaxList = array();
    $db_tax_list = CSaleOrderTax::GetList(array("APPLY_ORDER" => "ASC"), array("ORDER_ID" => $ORDER_ID));
    $iNds = -1;
    $i = 0;
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:order_form.php


示例19: isset

$arParams['SHOW_DELAY'] = isset($arParams['SHOW_DELAY']) && $arParams['SHOW_DELAY'] == 'N' ? 'N' : 'Y';
$arParams['SHOW_NOTAVAIL'] = isset($arParams['SHOW_NOTAVAIL']) && $arParams['SHOW_NOTAVAIL'] == 'N' ? 'N' : 'Y';
$arParams['SHOW_SUBSCRIBE'] = isset($arParams['SHOW_SUBSCRIBE']) && $arParams['SHOW_SUBSCRIBE'] == 'N' ? 'N' : 'Y';
$bReady = false;
$bDelay = false;
$bNotAvail = false;
$bSubscribe = false;
$arItems = array();
$arReadyItems = array();
$allSum = 0.0;
$allWeight = 0.0;
$arBasketItems = array();
$arSetParentWeight = array();
$fuserId = (int) CSaleBasket::GetBasketUserID(true);
if ($fuserId > 0) {
    $rsBaskets = CSaleBasket::GetList(array("ID" => "ASC"), array("FUSER_ID" => $fuserId, "LID" => SITE_ID, "ORDER_ID" => "NULL"), false, false, array("ID", "NAME", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "WEIGHT", "DETAIL_PAGE_URL", "NOTES", "CURRENCY", "VAT_RATE", "CATALOG_XML_ID", "PRODUCT_XML_ID", "SUBSCRIBE", "DISCOUNT_PRICE", "PRODUCT_PROVIDER_CLASS", "TYPE", "SET_PARENT_ID"));
    while ($arItem = $rsBaskets->GetNext()) {
        $arBasketItems[] = $arItem;
        if (CSaleBasketHelper::isSetItem($arItem)) {
            $arSetParentWeight[$arItem["SET_PARENT_ID"]] += $arItem["WEIGHT"] * $arItem['QUANTITY'];
        }
    }
}
if (!empty($arBasketItems)) {
    // count weight for set parent products
    foreach ($arBasketItems as &$arItem) {
        if (CSaleBasketHelper::isSetParent($arItem)) {
            $arItem["WEIGHT"] = $arSetParentWeight[$arItem["ID"]] / $arItem["QUANTITY"];
        }
    }
    unset($arItem);
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:component.php


示例20: RemindPayment

 function RemindPayment()
 {
     $reminder = COption::GetOptionString("sale", "pay_reminder", "");
     $arReminder = unserialize($reminder);
     if (!empty($arReminder)) {
         $arSites = array();
         $minDay = mktime();
         foreach ($arReminder as $key => $val) {
             if ($val["use"] == "Y") {
                 $arSites[] = $key;
                 $days = array();
                 for ($i = 0; $i <= floor($val["period"] / $val["frequency"]); $i++) {
                     $day = AddToTimeStamp(array("DD" => -($val["after"] + $val["period"] - $val["frequency"] * $i)));
                     if ($day < mktime()) {
                         if ($minDay > $day) {
                             $minDay = $day;
                         }
                         $day = ConvertTimeStamp($day);
                         $days[] = $day;
                     }
                 }
                 $arReminder[$key]["days"] = $days;
             }
         }
         if (!empty($arSites)) {
             $bTmpUser = False;
             if (!isset($GLOBALS["USER"]) || !is_object($GLOBALS["USER"])) {
                 $bTmpUser = True;
                 $GLOBALS["USER"] = new CUser();
             }
             $arFilter = array("LID" => $arSites, "PAYED" => "N", "CANCELED" => "N", "ALLOW_DELIVERY" => "N", ">=DATE_INSERT" => ConvertTimeStamp($minDay));
             $dbOrder = CSaleOrder::GetList(array("ID" => "DESC"), $arFilter, false, false, array("ID", "DATE_INSERT", "PAYED", "USER_ID", "LID", "PRICE", "CURRENCY"));
             while ($arOrder = $dbOrder->GetNext()) {
                 $date_insert = ConvertDateTime($arOrder["DATE_INSERT"], CSite::GetDateFormat("SHORT"));
                 if (in_array($date_insert, $arReminder[$arOrder["LID"]]["days"])) {
                     $strOrderList = "";
                     $dbBasketTmp = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $arOrder["ID"]), false, false, array("ID", "NAME", "QUANTITY"));
                     while ($arBasketTmp = $dbBasketTmp->Fetch()) {
                         $strOrderList .= $arBasketTmp["NAME"] . " (" . $arBasketTmp["QUANTITY"] . ")";
                         $strOrderList .= "\n";
                     }
                     $payerEMail = "";
                     $dbOrderProp = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $arOrder["ID"], "PROP_IS_EMAIL" => "Y"));
                     if ($arOrderProp = $dbOrderProp->Fetch()) {
                         $payerEMail = $arOrderProp["VALUE"];
                     }
                     $payerName = "";
                     $dbUser = CUser::GetByID($arOrder["USER_ID"]);
                     if ($arUser = $dbUser->Fetch()) {
                         if (strlen($payerName) <= 0) {
                             $payerName = $arUser["NAME"] . (strlen($arUser["NAME"]) <= 0 || strlen($arUser["LAST_NAME"]) <= 0 ? "" : " ") . $arUser["LAST_NAME"];
                         }
                         if (strlen($payerEMail) <= 0) {
                             $payerEMail = $arUser["EMAIL"];
                         }
                     }
                     $arFields = array("ORDER_ID" => $arOrder["ID"], "ORDER_DATE" => $date_insert, "ORDER_USER" => $payerName, "PRICE" => SaleFormatCurrency($arOrder["PRICE"], $arOrder["CURRENCY"]), "BCC" => COption::GetOptionString("sale", "order_email", "order@" . $_SERVER["SERVER_NAME"]), "EMAIL" => $payerEMail, "ORDER_LIST" => $strOrderList, "SALE_EMAIL" => COption::GetOptionString("sale", "order_email", "order@" . $SERVER_NAME));
                     $eventName = "SALE_ORDER_REMIND_PAYMENT";
                     $bSend = true;
                     foreach (GetModuleEvents("sale", "OnOrderRemindSendEmail", true) as $arEvent) {
                         if (ExecuteModuleEventEx($arEvent, array($arOrder["ID"], &$eventName, &$arFields)) === false) {
                             $bSend = false;
                         }
                     }
                     if ($bSend) {
                         $event = new CEvent();
                         $event->Send($eventName, $arOrder["LID"], $arFields, "N");
                     }
                 }
             }
             if ($bTmpUser) {
                 unset($GLOBALS["USER"]);
             }
         }
     }
     return "CSaleOrder::RemindPayment();";
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:77,代码来源:order.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP CSaleBasketHelper类代码示例发布时间:2022-05-20
下一篇:
PHP CSV类代码示例发布时间:2022-05-20
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap