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


PHP CSaleBasket::UpdatePrice方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: json_decode

			'header' => 'Content-Type: application/json'.PHP_EOL,
			'content' => '{"api_auth_token": "'.$secret.'"}'
		)
	));
	$api_answer = json_decode(file_get_contents($token_url, FALSE, $context));
	if (!$api_answer) { throw new Exception(GetMessage("EXCEPTION_NO_API_ANSWER", array("#URL#" => $token_url))); }
	if (!($arResult['WIDGET_TOKEN'] = $api_answer->token)) { throw new Exception(GetMessage("EXCEPTION_NO_WIDGET_TOKEN")); }
	if (!($arResult['GP_DELIVERY_DESCRIPTION'] = $api_answer->description)) { throw new Exception(GetMessage("EXCEPTION_NO_DELIVERY_DESCRIPTION")); }

	$arBasketItems = array();
	$dbBasketItems = CSaleBasket::GetList(
		array("NAME" => "ASC", "ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL")
	);
	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;
	}

	$arResult['WIDGET_ITEMS'] = array();
	$ESTIMATED_PRICE_TYPE_ID = 4;
	foreach($arBasketItems as $index=>$item) {
		$widgetItem = array();
		$widgetItem['price'] = $item['PRICE'];
		$widgetItem['shop_good_code'] = $item['PRODUCT_ID'];
		$widgetItem['count'] = $item['QUANTITY'];
		$widgetItem['weight'] = $item['WEIGHT'];
		$widgetItem['name'] = $item['NAME'];
		$rsPrices = CPrice::GetList(array(), array('PRODUCT_ID' => $item['PRODUCT_ID'], 'CATALOG_GROUP_ID' => $ESTIMATED_PRICE_TYPE_ID));
开发者ID:ASDAFF,项目名称:gpbitrix,代码行数:31,代码来源:component.php

示例5: Add2BasketByProductID

require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_before.php";
?>

<?php 
if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
    // Если к нам идёт Ajax запрос, то ловим его
    if (isset($_POST["ajax_filter"]) && $_POST["ajax_filter"] == "y") {
        if (CModule::IncludeModule("sale") && CModule::IncludeModule("catalog")) {
            Add2BasketByProductID($_POST["productId"], 1, array());
            $arBasketItems = array();
            $productsCount = 0;
            $dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC", "ID" => "ASC"), array("FUSER_ID" => CSaleBasket::GetBasketUserID(), "LID" => SITE_ID, "ORDER_ID" => "NULL"), false, false, array("ID", "QUANTITY", "PRICE"));
            while ($arItems = $dbBasketItems->Fetch()) {
                if (strlen($arItems["CALLBACK_FUNC"]) > 0) {
                    CSaleBasket::UpdatePrice($arItems["ID"], $arItems["QUANTITY"]);
                    $arItems = CSaleBasket::GetByID($arItems["ID"]);
                }
                $arBasketItems[] = $arItems;
            }
            $productsCount = count($arBasketItems);
            $summ = 0;
            for ($i = 0; $i <= $productsCount; $i++) {
                $summ = $summ + $arBasketItems[$i]["PRICE"] * $arBasketItems[$i]["QUANTITY"];
            }
            // Склонение "товаров"
            $goods_title = declOfNum($productsCount, array('товар', 'товара', 'товаров'));
            ?>
			<span class="hc-icon"><i class="icon-cart"></i></span><span class="hidden-xs">В корзине</span> <b><?php 
            echo $productsCount;
            ?>
开发者ID:vim84,项目名称:b-markt,代码行数:30,代码来源:add-to-cart.php

示例6: array

				"LID" => SITE_ID,
                "ORDER_ID" > 0,
				"ORDER_CANCELED"=>"N"
             ),
     false,
     false,
     array()
             );
while ($arItems = $dbBasketItems->Fetch())
{
     if ('' != $arItems['PRODUCT_PROVIDER_CLASS'] || '' != $arItems["CALLBACK_FUNC"])
     {
          CSaleBasket::UpdatePrice($arItems["ID"],
							   $arItems["NAME"],
                                 $arItems["CALLBACK_FUNC"],
                                 $arItems["MODULE"],
                                 $arItems["PRODUCT_ID"],
                                 "N"
                                 );
          $arID[] = $arItems["ID"];
     }
}
if (!empty($arID))
     {
     $dbBasketItems = CSaleBasket::GetList(
     array(
          "NAME" => "ASC",
          "ID" => "ASC"
          ),
     array(
        "ID" => $arID,
开发者ID:Asger13,项目名称:bitrix_project,代码行数:31,代码来源:basketitems.php

示例7: UpdateBasketPrices

 function UpdateBasketPrices($fuserID, $siteID)
 {
     if (IntVal($fuserID) <= 0) {
         return false;
     }
     if (strlen($siteID) <= 0) {
         $siteID = SITE_ID;
     }
     $dbBasketItems = CSaleBasket::GetList(array("ALL_PRICE" => "DESC"), array("FUSER_ID" => $fuserID, "LID" => $siteID, "ORDER_ID" => "NULL", "SUBSCRIBE" => "N"), false, false, array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "PRODUCT_PROVIDER_CLASS"));
     while ($arItems = $dbBasketItems->Fetch()) {
         if (strlen($arItems["CALLBACK_FUNC"]) > 0 || strlen($arItems["PRODUCT_PROVIDER_CLASS"]) > 0) {
             CSaleBasket::UpdatePrice($arItems["ID"], $arItems["CALLBACK_FUNC"], $arItems["MODULE"], $arItems["PRODUCT_ID"], $arItems["QUANTITY"], "N", $arItems["PRODUCT_PROVIDER_CLASS"]);
         }
     }
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:15,代码来源:basket.php


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