本文整理汇总了PHP中CSaleBasket::GetPropsList方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleBasket::GetPropsList方法的具体用法?PHP CSaleBasket::GetPropsList怎么用?PHP CSaleBasket::GetPropsList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleBasket
的用法示例。
在下文中一共展示了CSaleBasket::GetPropsList方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: explode
$arColumns = explode(",", $strColumns);
$strOffersProps = isset($_POST["offers_props"]) ? $_POST["offers_props"] : "";
$strOffersProps = explode(",", $strOffersProps);
if ($_POST[$action_var] == "select_item") {
$arItemSelect = array("ID", "XML_ID", "PRODUCT_ID", "PRICE", "CURRENCY", "WEIGHT", "QUANTITY", "MODULE", "PRODUCT_PROVIDER_CLASS", "CALLBACK_FUNC", "NOTES");
$arItem = false;
$currentId = 0;
if (isset($_POST['basketItemId'])) {
$currentId = (int) $_POST['basketItemId'];
}
if ($currentId > 0) {
$dbItemRes = CSaleBasket::GetList(array(), array('ID' => $currentId), false, false, $arItemSelect);
$arItem = $dbItemRes->Fetch();
}
if ($arItem) {
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $arItem["ID"]), false, false, array('NAME', 'CODE', 'VALUE', 'SORT'));
while ($arProp = $dbProp->Fetch()) {
if (!isset($arItem['PROPS'])) {
$arItem['PROPS'] = array();
}
$arItem['PROPS'][] = $arProp;
}
$element = false;
$sku = false;
$parentId = 0;
$elementIterator = \Bitrix\Iblock\ElementTable::getList(array('select' => array('ID', 'IBLOCK_ID', 'XML_ID'), 'filter' => array('ID' => $arItem['PRODUCT_ID'])));
$element = $elementIterator->fetch();
unset($elementIterator);
if (!empty($element)) {
$sku = CCatalogSKU::GetInfoByOfferIBlock($element['IBLOCK_ID']);
if (!empty($sku)) {
示例2: array
if ($obparent = $parentres->GetNext()) {
$img = $obparent['PREVIEW_PICTURE'] ? $obparent['PREVIEW_PICTURE'] : $obparent['DETAIL_PICTURE'] ? $obparent['DETAIL_PICTURE'] : $obparent['PROPERTY_MORE_PHOTO'][0];
}
}
}
$method = $arParams['DISPLAY_IMG_PROP'] == 'Y' ? BX_RESIZE_IMAGE_PROPORTIONAL : BX_RESIZE_IMAGE_EXACT;
if ($img) {
$file = CFile::ResizeImageGet($img, array('width' => $arParams['DISPLAY_IMG_WIDTH'], 'height' => $arParams['DISPLAY_IMG_HEIGHT']), $method, true);
} else {
$file['src'] = SITE_TEMPLATE_PATH . '/images/nophoto.png';
}
$arItem['PICTURE'] = array('ID' => $img, 'SRC' => $file['src'], 'HEIGHT' => $file['height'], 'WIDTH' => $file['width']);
unset($img);
unset($file);
}
$db_res = CSaleBasket::GetPropsList(array("SORT" => "ASC", "NAME" => "ASC"), array("BASKET_ID" => $arItem['ID']));
while ($ar_res = $db_res->Fetch()) {
if (!in_array($ar_res['CODE'], $noneprops)) {
$arItem['PROPS'][] = $ar_res;
}
}
$arBasketItems[] = $arItem;
if (CSaleBasketHelper::isSetItem($arItem)) {
$arSetParentWeight[$arItem["SET_PARENT_ID"]] += $arItem["WEIGHT"] * $arItem['QUANTITY'];
}
}
// count weight for set parent products
foreach ($arBasketItems as &$arItem) {
if (CSaleBasketHelper::isSetParent($arItem)) {
$arItem["WEIGHT"] = $arSetParentWeight[$arItem["ID"]] / $arItem["QUANTITY"];
}
示例3: basket_items
private function basket_items() {
CModule::IncludeModule("iblock");
CModule::IncludeModule("sale");
CSaleBasket::UpdateBasketPrices(CSaleBasket::GetBasketUserID(), SITE_ID);
/* Check Values Begin */
$arSelFields = array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY",
"CAN_BUY", "PRICE", "WEIGHT", "NAME", "CURRENCY", "CATALOG_XML_ID", "VAT_RATE",
"NOTES", "DISCOUNT_PRICE", "PRODUCT_PROVIDER_CLASS", "DIMENSIONS", "TYPE", "SET_PARENT_ID", "DETAIL_PAGE_URL"
);
$dbBasketItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => SITE_ID,
"ORDER_ID" => "NULL"
),
false,
false,
$arSelFields
);
while ($arItem = $dbBasketItems->GetNext())
{
if ($arItem["DELAY"] == "N" && $arItem["CAN_BUY"] == "Y")
{
$arItem["PRICE"] = roundEx($arItem["PRICE"], SALE_VALUE_PRECISION);
$arItem["QUANTITY"] = DoubleVal($arItem["QUANTITY"]);
$arItem["WEIGHT"] = DoubleVal($arItem["WEIGHT"]);
$arItem["VAT_RATE"] = DoubleVal($arItem["VAT_RATE"]);
$arDim = unserialize($arItem["~DIMENSIONS"]);
if(is_array($arDim))
{
$arItem["DIMENSIONS"] = $arDim;
unset($arItem["~DIMENSIONS"]);
$arResult["MAX_DIMENSIONS"] = CSaleDeliveryHelper::getMaxDimensions(
array(
$arDim["WIDTH"],
$arDim["HEIGHT"],
$arDim["LENGTH"]
),
$arResult["MAX_DIMENSIONS"]);
$arResult["ITEMS_DIMENSIONS"][] = $arDim;
}
if($arItem["VAT_RATE"] > 0 && !CSaleBasketHelper::isSetItem($arItem))
{
$arResult["bUsingVat"] = "Y";
if($arItem["VAT_RATE"] > $arResult["VAT_RATE"])
$arResult["VAT_RATE"] = $arItem["VAT_RATE"];
//$arItem["VAT_VALUE"] = roundEx((($arItem["PRICE"] / ($arItem["VAT_RATE"] +1)) * $arItem["VAT_RATE"]), SALE_VALUE_PRECISION);
$arItem["VAT_VALUE"] = (($arItem["PRICE"] / ($arItem["VAT_RATE"] +1)) * $arItem["VAT_RATE"]);
$arResult["VAT_SUM"] += roundEx($arItem["VAT_VALUE"] * $arItem["QUANTITY"], SALE_VALUE_PRECISION);
}
$arItem["PRICE_FORMATED"] = SaleFormatCurrency($arItem["PRICE"], $arItem["CURRENCY"]);
$arItem["WEIGHT_FORMATED"] = roundEx(DoubleVal($arItem["WEIGHT"]/$arResult["WEIGHT_KOEF"]), SALE_WEIGHT_PRECISION)." ".$arResult["WEIGHT_UNIT"];
if($arItem["DISCOUNT_PRICE"] > 0)
{
$arItem["DISCOUNT_PRICE_PERCENT"] = $arItem["DISCOUNT_PRICE"]*100 / ($arItem["DISCOUNT_PRICE"] + $arItem["PRICE"]);
$arItem["DISCOUNT_PRICE_PERCENT_FORMATED"] = roundEx($arItem["DISCOUNT_PRICE_PERCENT"], 0)."%";
}
$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())
{
if (array_key_exists('BASKET_ID', $arProp))
{
unset($arProp['BASKET_ID']);
}
if (array_key_exists('~BASKET_ID', $arProp))
{
unset($arProp['~BASKET_ID']);
}
$arProp = array_filter($arProp, array("CSaleBasketHelper", "filterFields"));
$arItem["PROPS"][] = $arProp;
}
if (!CSaleBasketHelper::isSetItem($arItem))
{
$DISCOUNT_PRICE_ALL += $arItem["DISCOUNT_PRICE"] * $arItem["QUANTITY"];
$arItem["DISCOUNT_PRICE"] = roundEx($arItem["DISCOUNT_PRICE"], SALE_VALUE_PRECISION);
$arResult["ORDER_PRICE"] += $arItem["PRICE"] * $arItem["QUANTITY"];
}
$arResult["ORDER_WEIGHT"] += $arItem["WEIGHT"] * $arItem["QUANTITY"];
if (CSaleBasketHelper::isSetItem($arItem))
$arSetParentWeight[$arItem["SET_PARENT_ID"]] += $arItem["WEIGHT"] * $arItem['QUANTITY'];
//get product section
//.........这里部分代码省略.........
示例4: array
<br>
<br>
<?php
$dbBasket = CSaleBasket::GetList(array("DATE_INSERT" => "ASC", "NAME" => "ASC"), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "PRICE", "CURRENCY", "QUANTITY", "NAME", "VAT_RATE", "MEASURE_NAME"));
if ($arBasket = $dbBasket->Fetch()) {
$arCells = array();
$arProps = array();
$n = 0;
$sum = 0.0;
$vat = 0;
$vats = array();
do {
// props in product basket
$arProdProps = array();
$dbBasketProps = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "DESC"), array("BASKET_ID" => $arBasket["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")), false, false, array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT"));
while ($arBasketProps = $dbBasketProps->GetNext()) {
if (!empty($arBasketProps) && $arBasketProps["VALUE"] != "") {
$arProdProps[] = $arBasketProps;
}
}
$arBasket["PROPS"] = $arProdProps;
// @TODO: replace with real vatless price
if (isset($arBasket['VAT_INCLUDED']) && $arBasket['VAT_INCLUDED'] === 'Y') {
$arBasket["VATLESS_PRICE"] = roundEx($arBasket["PRICE"] / (1 + $arBasket["VAT_RATE"]), SALE_VALUE_PRECISION);
} else {
$arBasket["VATLESS_PRICE"] = $arBasket["PRICE"];
}
$productName = $arBasket["NAME"];
if ($productName == "OrderDelivery") {
$productName = "Envío";
示例5: 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;
}
示例6: ExportOrders2Xml
//.........这里部分代码省略.........
</<?php
echo GetMessage("SALE_EXPORT_PROPERTY_VALUE");
?>
>
<<?php
echo GetMessage("SALE_EXPORT_PROPERTY_VALUE");
?>
>
<<?php
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
><?php
echo GetMessage("SALE_EXPORT_TYPE_OF_NOMENKLATURA");
?>
</<?php
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
>
<<?php
echo GetMessage("SALE_EXPORT_VALUE");
?>
><?php
echo GetMessage("SALE_EXPORT_ITEM");
?>
</<?php
echo GetMessage("SALE_EXPORT_VALUE");
?>
>
</<?php
echo GetMessage("SALE_EXPORT_PROPERTY_VALUE");
?>
>
<?
$dbProp = CSaleBasket::GetPropsList(Array("SORT" => "ASC", "ID" => "ASC"), Array("BASKET_ID" => $arBasket["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")));
while($arProp = $dbProp->Fetch())
{
?>
<<?php
echo GetMessage("SALE_EXPORT_PROPERTY_VALUE");
?>
>
<<?php
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
><?php
echo htmlspecialcharsbx($arProp["NAME"]);
?>
</<?php
echo GetMessage("SALE_EXPORT_ITEM_NAME");
?>
>
<<?php
echo GetMessage("SALE_EXPORT_VALUE");
?>
><?php
echo htmlspecialcharsbx($arProp["VALUE"]);
?>
</<?php
echo GetMessage("SALE_EXPORT_VALUE");
?>
>
</<?php
echo GetMessage("SALE_EXPORT_PROPERTY_VALUE");
?>
>
<?
示例7: GetIBlockElement
$val["PREVIEW_TEXT"] = '';
$val["DETAIL_TEXT"] = '';
if ($boolIBlock) {
$arIBlockElement = GetIBlockElement($val["PRODUCT_ID"]);
$val["DETAIL_PAGE_URL"] = $arIBlockElement["DETAIL_PAGE_URL"];
$val["CREATED_BY"] = $arIBlockElement["CREATED_BY"];
$val["IBLOCK_ID"] = $arIBlockElement["IBLOCK_ID"];
$val["IBLOCK_SECTION_ID"] = $arIBlockElement["IBLOCK_SECTION_ID"];
$val["PREVIEW_PICTURE"] = $arIBlockElement["PREVIEW_PICTURE"];
$val["DETAIL_PICTURE"] = $arIBlockElement["DETAIL_PICTURE"];
$val["PREVIEW_TEXT"] = $arIBlockElement["PREVIEW_TEXT"];
$val["DETAIL_TEXT"] = $arIBlockElement["DETAIL_TEXT"];
}
$val["PROPS"] = array();
if (in_array("PROPS", $arParams["COLUMNS_LIST"]) && $val["ID"] > 0) {
$dbProp = CSaleBasket::GetPropsList(array("SORT" => "ASC", "ID" => "ASC"), array("BASKET_ID" => $val["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")));
while ($arProp = $dbProp->GetNext()) {
$val["PROPS"][] = $arProp;
}
}
if ($val["DELAY"] == "N" && $val["CAN_BUY"] == "Y") {
$arResult["ITEMS"]["AnDelCanBuy"][] = $val;
$DISCOUNT_PRICE_ALL += $val["DISCOUNT_PRICE"] * $val["QUANTITY"];
}
if ($val["DELAY"] == "Y" && $val["CAN_BUY"] == "Y") {
$arResult["ITEMS"]["DelDelCanBuy"][] = $val;
}
if ($val["CAN_BUY"] == "N" && $val["SUBSCRIBE"] == "N") {
$arResult["ITEMS"]["nAnCanBuy"][] = $val;
}
if ($val["CAN_BUY"] == "N" && $val["SUBSCRIBE"] == "Y") {
示例8: getPropBasketById
/**
* getPropBasketById() - get value name from HL by basket id and by id of highload block
*
* $basketId
* $HL_ID
*/
public static function getPropBasketById($basketId, $HL_ID)
{
$res = CSaleBasket::GetPropsList(array("SORT" => "ASC", "NAME" => "ASC"), array("BASKET_ID" => $basketId))->fetch();
$resHL = sestHL::getByIdHL($HL_ID, $res['VALUE'], false, 'UF_NAME');
return $resHL['UF_NAME'];
}
示例9: OnOrderNewSendEmailHandler
function OnOrderNewSendEmailHandler($orderID, &$eventName, &$arFields)
{
// Поменять вид списка товаров
if (!CModule::IncludeModule('sale') || !CModule::IncludeModule('catalog')) return;
//global $pre_defined_variables, $DB;
$arOrder = CSaleOrder::GetById($orderID);
$dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC"), array("ORDER_ID" => $orderID), false, false, array("ID", "NAME", "QUANTITY", "PRICE", "CURRENCY", "DETAIL_PAGE_URL"));
$strOrderList = "";
$strOrderList .= '<table width="100%">';
$strOrderList .= '<thead><tr>';
foreach(array("Название","Количество","Цена","Сумма") as $th) $strOrderList .= '<th>'.$th.'</th>';
$strOrderList .= '</tr></thead>';
$strOrderList .= '<tbody>';
$price_total = 0;
$arBasketItems = array();
while ($arBasketItem = $dbBasketItems->Fetch())
{
$dbProp = CSaleBasket::GetPropsList(Array("SORT" => "ASC", "NAME" => "ASC"), Array("BASKET_ID" => $arBasketItem["ID"], "!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")));
while($arProp = $dbProp -> GetNext())
$arBasketItem["PROPS"][] = $arProp;
$arBasketItems[] = $arBasketItem;
$strOrderList .= '<tr>';
$strOrderList .= '<td>';
$strOrderList .= '<a href="http://www.zakrepi.ru'.$arBasketItem["DETAIL_PAGE_URL"].'" target="_blank">'.$arBasketItem["NAME"].'</a>';
// Из свойств товара заказа показать лишь стандартные и название филиала
foreach($arBasketItem['PROPS'] as &$arProp)
{
$strOrderList .= '<div style="font-size:80%">'.$arProp['NAME'].': '.$arProp['VALUE'].'</div>';
}
$strOrderList .= '</td>';
$strOrderList .= '<td style="text-align: center;">'.$arBasketItem["QUANTITY"].' шт.</td>';
$strOrderList .= '<td style="text-align: center;">'.SaleFormatCurrency($arBasketItem["PRICE"], $arBasketItem["CURRENCY"]).'</td>';
$strOrderList .= '<td style="text-align: center;">'.SaleFormatCurrency($arBasketItem["PRICE"] * $arBasketItem["QUANTITY"], $arBasketItem["CURRENCY"]).'</td>';
$strOrderList .= '</tr>';
$price_total += $arBasketItem["PRICE"] * $arBasketItem["QUANTITY"];
$price_currency = $arBasketItem["CURRENCY"];
}
$price_total_formatted = $price_currency? SaleFormatCurrency($price_total, $price_currency): '0';
$strOrderList .= '<tr><td colspan="3" style="text-align:right;">Общая стоимость: </td><td style="text-align: center;">'.$price_total_formatted.'</td></tr>';
//Получаем стоимость доставки цену и общую сумму вместе с ценой доставки
// Указываем способ доставки
// $arOrder['PRICE'] - Общая стоимость
$arFields['DELIVERY'] = '';
if (strlen($arOrder['DELIVERY_ID']))
{
if (is_string($arOrder['DELIVERY_ID']))
{
$sid = explode(":", $arOrder['DELIVERY_ID']);
$dbDeliv = CSaleDeliveryHandler::GetBySID($sid[0]);
$arDeliv = $dbDeliv->GetNext();
$arFields['DELIVERY'] = '<p><b>Способ доставки:</b> '.$arDeliv['NAME'].'</p>';
$price_total += $arOrder['PRICE_DELIVERY'];
$strOrderList .= '<tr><td colspan="3" style="text-align:right;">Стоимость доставки: </td><td style="text-align: center;">'.SaleFormatCurrency($arOrder['PRICE_DELIVERY'], $price_currency).'</td></tr>';
$strOrderList .= '<tr><td colspan="3" style="text-align:right;">Итого: </td><td style="text-align: center;">'.SaleFormatCurrency($price_total, $price_currency).'</td></tr>';
$arFields['ALL_PRICE'] = '<p><b>Итого: </b>'.SaleFormatCurrency($price_total, $price_currency).'</p>';
}
else{
$arDelivery = CSaleDelivery::GetById($arOrder['DELIVERY_ID']);
if ($arDelivery)
{
$value = $arDelivery['NAME'];
$value_name = $arDelivery['NAME'];
$value_price = '';
if ($arDelivery['PRICE']<=0)
{
$value .= ', Бесплатно';
$value_price = 'Бесплатно';
}
else
{
$value .= ', '.SaleFormatCurrency($arDelivery['PRICE'], $arDelivery['CURRENCY']);
$value_price = SaleFormatCurrency($arDelivery['PRICE'], $arDelivery['CURRENCY']);
$strOrderList .= '<tr><td colspan="3" style="text-align:right;">Стоимость доставки: </td><td style="text-align: center;">'.$value_price.'</td></tr>';
}
$arFields['DELIVERY'] = '<p><b>Способ доставки:</b> '.$value_name.'</p>';
$price_total += $arDelivery['PRICE'];
$strOrderList .= '<tr><td colspan="3" style="text-align:right;">Итого: </td><td style="text-align: center;">'.SaleFormatCurrency($price_total, $price_currency).'</td></tr>';
$arFields['ALL_PRICE'] = '<p><b>Итого: </b>'.SaleFormatCurrency($price_total, $price_currency).'</p>';
}
}
}
//.........这里部分代码省略.........
示例10: intval
"PRODUCT_PROVIDER_CLASS",
"CALLBACK_FUNC",
"NOTES"
);
$dbItemRes = CSaleBasket::GetList(array(),
array("ID" => intval($_POST["basketItemId"])),
false,
false,
$arItemSelect
);
if ($arItem = $dbItemRes->Fetch())
{
$dbProp = CSaleBasket::GetPropsList(
array("SORT" => "ASC", "ID" => "ASC"),
array("BASKET_ID" => $arItem["ID"])
);
while ($arProp = $dbProp->GetNext())
{
$arItem["PROPS"][] = $arProp;
}
$dbRes = CIBlockElement::GetList(
array("SORT" => "ASC", "ID" => "ASC"),
array("ID" => $arItem["PRODUCT_ID"]),
false,
false,
$arSelect
);
if ($arElement = $dbRes->Fetch())
示例11: orderHistory
//.........这里部分代码省略.........
if (isset($order['delivery']['address']['city'])) {
$order['location'] = $order['delivery']['address']['city'];
}
if (isset($order['orderType']) && isset($optionsOrderTypes[$order['orderType']])) {
if (isset($optionsOrderProps[$arFields['PERSON_TYPE_ID']])) {
foreach ($optionsOrderProps[$arFields['PERSON_TYPE_ID']] as $code => $value) {
if (in_array($code, array_keys($order)) === false && isset($optionsOrderProps[$optionsOrderTypes[$order['orderType']]][$code])) {
$order[$code] = $arUpdateProps[$optionsOrderProps[$arFields['PERSON_TYPE_ID']][$code]]['VALUE'];
}
}
}
//update ordertype
CSaleOrder::Update($order['externalId'], array('PERSON_TYPE_ID' => $optionsOrderTypes[$order['orderType']]));
$arProp = CSaleOrderProps::GetList(array(), array('PERSON_TYPE_ID' => $optionsOrderTypes[$order['orderType']]));
$typeParam = array();
while ($ar = $arProp->Fetch()) {
$typeParam[$ar['CODE']] = $ar['CODE'];
}
foreach (array_diff_key($arUpdateProps, $typeParam) as $code => $param) {
if (isset($arUpdateProps[$code])) {
CSaleOrderPropsValue::Delete($param['ID']);
}
}
$arFields['PERSON_TYPE_ID'] = $optionsOrderTypes[$order['orderType']];
}
array_walk_recursive(self::clearArr($order), 'self::recursiveUpdate', array('update' => $arUpdateProps, 'type' => $arFields['PERSON_TYPE_ID'], 'options' => $optionsOrderProps, 'orderId' => $order['externalId']));
foreach ($order['items'] as $item) {
if (isset($item['deleted']) && $item['deleted']) {
if ($p = CSaleBasket::GetList(array(), array('ORDER_ID' => $order['externalId'], 'PRODUCT_ID' => $item['id']))->Fetch()) {
if (!CSaleBasket::Delete($p['ID'])) {
self::eventLog('ICrmOrderActions::orderHistory', 'CSaleBasket::Delete', 'Error element delete');
}
} else {
$prp = CSaleBasket::GetPropsList(array(), array("ORDER_ID" => $order['externalId'], "CODE" => 'ID', "VALUE" => $item['id']))->Fetch();
if (!CSaleBasket::Delete($prp['BASKET_ID'])) {
self::eventLog('ICrmOrderActions::orderHistory', 'CSaleBasket::Delete', 'Error castom element delete');
}
}
continue;
}
if (isset($item['offer']) === false && isset($item['offer']['externalId']) === false) {
continue;
}
$res = CIBlockElement::GetByID($item['offer']['externalId'])->Fetch();
if ($res) {
$p = CSaleBasket::GetList(array(), array('ORDER_ID' => $order['externalId'], 'PRODUCT_ID' => $item['offer']['externalId']))->Fetch();
if ($p == false) {
$p = CIBlockElement::GetByID($item['offer']['externalId'])->GetNext();
$iblock = CIBlock::GetByID($p['IBLOCK_ID'])->Fetch();
$p['CATALOG_XML_ID'] = $iblock['XML_ID'];
$p['PRODUCT_XML_ID'] = $p['XML_ID'];
unset($p['XML_ID']);
} elseif ($propResult = CSaleBasket::GetPropsList(array(''), array('BASKET_ID' => $p['ID']))) {
while ($r = $propResult->Fetch()) {
unset($r['ID']);
unset($r['BASKET_ID']);
$p['PROPS'][] = $r;
}
}
$arProduct = array();
if (isset($item['created']) && $item['created'] == true) {
$productPrice = GetCatalogProductPrice($item['offer']['externalId'], COption::GetOptionString(self::$MODULE_ID, self::$CRM_CATALOG_BASE_PRICE, 0));
$arProduct = array('FUSER_ID' => $userId, 'ORDER_ID' => $order['externalId'], 'QUANTITY' => $item['quantity'], 'CURRENCY' => $productPrice['CURRENCY'], 'LID' => $LID, 'PRODUCT_ID' => $item['offer']['externalId'], 'PRODUCT_PRICE_ID' => $p['PRODUCT_PRICE_ID'], 'WEIGHT' => $p['WEIGHT'], 'DELAY' => $p['DELAY'], 'CAN_BUY' => $p['CAN_BUY'], 'MODULE' => $p['MODULE'], 'NOTES' => $item['comment'] ?: $p['NOTES'], 'PRODUCT_PROVIDER_CLASS' => $p['PRODUCT_PROVIDER_CLASS'], 'DETAIL_PAGE_URL' => $p['DETAIL_PAGE_URL'], 'CATALOG_XML_ID' => $p['CATALOG_XML_ID'], 'PRODUCT_XML_ID' => $p['PRODUCT_XML_ID'], 'CUSTOM_PRICE' => 'Y');
}
if (isset($item['isCanceled']) == false) {
if (isset($item['initialPrice']) && $item['initialPrice']) {
示例12: getOrederLk
/**
* [getOrederLk description]
* @param int $idUser
* @return array
*/
function getOrederLk($idUser)
{
CModule::IncludeModule('iblock');
CModule::IncludeModule('sale');
$arFilter = array("USER_ID" => $idUser);
$db_sales = CSaleOrder::GetList(array("DATE_INSERT" => "DESC"), $arFilter);
if ($ar_sales = $db_sales->Fetch()) {
$db_props = CSaleOrderPropsValue::GetOrderProps($ar_sales["ID"]);
$arPropsAll = array();
while ($arProps = $db_props->Fetch()) {
$ar_sales["PROPERTIES"][] = $arProps;
}
$arFields = array();
$dbBasketItems = CSaleBasket::GetList(array("NAME" => "ASC", "ID" => "ASC"), array("LID" => SITE_ID, "ORDER_ID" => $ar_sales["ID"]), false, false, array());
while ($arItems = $dbBasketItems->Fetch()) {
$db_res = CSaleBasket::GetPropsList(array("SORT" => "ASC", "NAME" => "ASC"), array("BASKET_ID" => $arItems['ID']), false, array());
while ($ar_res = $db_res->Fetch()) {
$arPropOrderItems[] = $ar_res;
}
$arProducts = getItemCart($arItems["PRODUCT_ID"]);
$arItems["PRODUCTS"] = $arProducts;
$arItems["PROP_ORDER_ITEMS"] = $arPropOrderItems;
$ar_sales["ITEMS"][] = $arItems;
}
return $ar_sales;
}
}
示例13: getBasketItems
function getBasketItems($orderID)
{
// выбираем товар из заказа
$params = array(
'select' => array("ID", "QUANTITY", "PRICE", "NAME", "PRODUCT_ID", "DISCOUNT_PRICE", "XML_ID" => "ELEMENT.XML_ID"),
'filter' => array(
'=ORDER_ID' => $orderID
),
'runtime' => array(
new ReferenceField(
'ELEMENT',
'\Bitrix\Iblock\ElementTable',
array('=this.PRODUCT_ID' => 'ref.ID'),
array('join_type' => 'LEFT')
)
)
);
$arBasketItems = BasketTable::getList($params)->fetchAll();
// выбираем свойства товара
foreach ($arBasketItems as &$arBasketItem)
{
$rsBasketProp = \CSaleBasket::GetPropsList(
array("SORT" => "ASC"),
array(
"BASKET_ID" => $arBasketItem["ID"],
"!CODE" => array("CATALOG.XML_ID", "PRODUCT.XML_ID")
)
);
while ($arBasketProp = $rsBasketProp->Fetch())
{
$arElemMod = ElementModifiers::getByPropCode($arBasketProp['CODE']);
$arBasketItem["PROPS"][] = array_merge($arBasketProp, $arElemMod);
}
}
return $arBasketItems;
}
示例14: getBasketItemProps
/**
* Function obtains all properties of a basket item
* @param int $id Basket item Id to search for
* @return mixed[] List of basket item properties
*/
protected function getBasketItemProps($id)
{
$arProps = array();
$dbBasketProps = CSaleBasket::GetPropsList(array("SORT" => "ASC"), array("BASKET_ID" => $id), false, false, array("ID", "BASKET_ID", "NAME", "VALUE", "CODE", "SORT"));
if ($arBasketProps = $dbBasketProps->Fetch()) {
do {
$arProps[] = array("NAME" => $arBasketProps["NAME"], "CODE" => $arBasketProps["CODE"], "VALUE" => $arBasketProps["VALUE"]);
} while ($arBasketProps = $dbBasketProps->Fetch());
}
return $arProps;
}
示例15: getBasketItems
public function getBasketItems()
{
global $APPLICATION;
$bUseCatalog = CModule::IncludeModule("catalog");
$bUseIblock = $bUseCatalog;
CSaleBasket::UpdateBasketPrices(CSaleBasket::GetBasketUserID(), SITE_ID);
$bShowReady = False;
$bShowDelay = False;
$bShowSubscribe = False;
$bShowNotAvail = False;
$allSum = 0;
$allWeight = 0;
$allCurrency = CSaleLang::GetLangCurrency(SITE_ID);
$allVATSum = 0;
$arParents = array();
$arResult["ITEMS"]["AnDelCanBuy"] = array();
$arResult["ITEMS"]["DelDelCanBuy"] = array();
$arResult["ITEMS"]["nAnCanBuy"] = array();
$arResult["ITEMS"]["ProdSubscribe"] = array();
$DISCOUNT_PRICE_ALL = 0;
// BASKET PRODUCTS (including measures, ratio, iblock properties data)
$arImgFields = array("PREVIEW_PICTURE", "DETAIL_PICTURE");
$arBasketItems = array();
$arSku2Parent = array();
$arSetParentWeight = array();
$dbItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"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 = $dbItems->GetNext())
{
$arBasketItems[] = $arItem;
if (CSaleBasketHelper::isSetItem($arItem))
continue;
$arElementId[] = $arItem["PRODUCT_ID"];
if ($bUseCatalog)
{
$arParent = CCatalogSku::GetProductInfo($arItem["PRODUCT_ID"]);
if ($arParent)
{
$arElementId[] = $arParent["ID"];
$arSku2Parent[$arItem["PRODUCT_ID"]] = $arParent["ID"];
$arParents[$arItem["PRODUCT_ID"]]["PRODUCT_ID"] = $arParent["ID"];
$arParents[$arItem["PRODUCT_ID"]]["IBLOCK_ID"] = $arParent["IBLOCK_ID"];
}
}
}
// get measures, ratio, sku props data and available quantity
if (!empty($arBasketItems) && $bUseCatalog)
{
$arBasketItems = getMeasures($arBasketItems);
$arBasketItems = getRatio($arBasketItems);
$arBasketItems = $this->getAvailableQuantity($arBasketItems);
}
// get product properties data
$arProductData = getProductProps($arElementId, array_merge(array("ID"), $arImgFields, $this->arCustomSelectFields));
foreach ($arBasketItems as &$arItem)
{
$quantityIsFloat = false;
if (number_format(doubleval($arItem['QUANTITY']), 2, '.', '') != intval($arItem['QUANTITY']))
{
$quantityIsFloat = true;
}
$arItem["QUANTITY"] = ($quantityIsFloat === false && $this->quantityFloat != "Y") ? intval($arItem['QUANTITY']) : number_format(doubleval($arItem['QUANTITY']), 2, '.', '');
$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;
//.........这里部分代码省略.........