本文整理汇总了PHP中CSaleOrderPropsValue类的典型用法代码示例。如果您正苦于以下问题:PHP CSaleOrderPropsValue类的具体用法?PHP CSaleOrderPropsValue怎么用?PHP CSaleOrderPropsValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CSaleOrderPropsValue类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getOrderInfo
protected static function getOrderInfo($orderId)
{
// order itself
$order = \CSaleOrder::getById($orderId);
// buyer info
$siteUserId = $order['USER_ID'];
$phone = '';
$email = '';
$result = \CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId));
while ($row = $result->fetch()) {
if (empty($phone) && stripos($row['CODE'], 'PHONE') !== false) {
$stPhone = static::normalizePhoneNumber($row['VALUE']);
if (!empty($stPhone)) {
$phone = sha1($stPhone);
}
}
if (empty($email) && stripos($row['CODE'], 'EMAIL') !== false) {
if (!empty($row['VALUE'])) {
$email = sha1($row['VALUE']);
}
}
}
// products info
$products = array();
$result = \CSaleBasket::getList(array(), $arFilter = array('ORDER_ID' => $orderId), false, false, array('PRODUCT_ID'));
while ($row = $result->fetch()) {
$products[] = array('product_id' => $row['PRODUCT_ID'], 'recommendation' => '0');
}
// all together
$data = array('order_id' => $orderId, 'user_id' => $siteUserId, 'phone' => $phone, 'email' => $email, 'products' => $products);
return $data;
}
开发者ID:rasuldev,项目名称:torino,代码行数:32,代码来源:catalog.php
示例2: DoSaveUserProfile
static function DoSaveUserProfile($userId, $profileId, $profileName, $personTypeId, $orderProps, &$arErrors)
{
$profileId = intval($profileId);
$arIDs = array();
if ($profileId > 0) {
$dbProfile = CSaleOrderUserProps::GetList(array(), array("ID" => $profileId), false, false, array("ID", "NAME", "USER_ID", "PERSON_TYPE_ID"));
$arProfile = $dbProfile->Fetch();
if (!$arProfile) {
$arErrors[] = array("CODE" => "PROFILE_NOT_FOUND", "TEXT" => GetMessage('SKGOUP_PROFILE_NOT_FOUND'));
return false;
}
if ($arProfile["USER_ID"] != $userId || $arProfile["PERSON_TYPE_ID"] != $personTypeId) {
$arErrors[] = array("CODE" => "PARAM", "TEXT" => GetMessage('SKGOUP_PARRAMS_ERROR'));
return false;
}
//if (strlen($profileName) > 0 && $profileName != $arProfile["NAME"])
if (strlen($profileName) > 0) {
$arFields = array("NAME" => $profileName, "USER_ID" => $userId);
CSaleOrderUserProps::Update($profileId, $arFields);
}
$dbUserPropsValues = CSaleOrderUserPropsValue::GetList(array(), array("USER_PROPS_ID" => $profileId), false, false, array("ID", "ORDER_PROPS_ID"));
while ($arUserPropsValue = $dbUserPropsValues->Fetch()) {
$arIDs[$arUserPropsValue["ORDER_PROPS_ID"]] = $arUserPropsValue["ID"];
}
}
if (!is_array($orderProps)) {
$dbOrderPropsValues = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => intval($orderProps)), false, false, array("ORDER_PROPS_ID", "VALUE"));
$orderProps = array();
while ($arOrderPropsValue = $dbOrderPropsValues->Fetch()) {
$orderProps[$arOrderPropsValue["ORDER_PROPS_ID"]] = $arOrderPropsValue["VALUE"];
}
}
$dbOrderProperties = CSaleOrderProps::GetList(array(), array("PERSON_TYPE_ID" => $personTypeId, "ACTIVE" => "Y", "UTIL" => "N", "USER_PROPS" => "Y"), false, false, array("ID", "TYPE", "NAME", "CODE"));
while ($arOrderProperty = $dbOrderProperties->Fetch()) {
$curVal = $orderProps[$arOrderProperty["ID"]];
if ($arOrderProperty["TYPE"] == "MULTISELECT" && is_array($curVal)) {
$curVal = implode(",", $curVal);
}
if (strlen($curVal) > 0) {
if ($profileId <= 0) {
if (strlen($profileName) <= 0) {
$profileName = GetMessage("SOA_PROFILE") . " " . Date("Y-m-d");
}
$arFields = array("NAME" => $profileName, "USER_ID" => $userId, "PERSON_TYPE_ID" => $personTypeId);
$profileId = CSaleOrderUserProps::Add($arFields);
}
if (array_key_exists($arOrderProperty["ID"], $arIDs)) {
$arFields = array("NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Update($arIDs[$arOrderProperty["ID"]], $arFields);
unset($arIDs[$arOrderProperty["ID"]]);
} else {
$arFields = array("USER_PROPS_ID" => $profileId, "ORDER_PROPS_ID" => $arOrderProperty["ID"], "NAME" => $arOrderProperty["NAME"], "VALUE" => $curVal);
CSaleOrderUserPropsValue::Add($arFields);
}
}
}
foreach ($arIDs as $id) {
CSaleOrderUserPropsValue::Delete($id);
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:60,代码来源:order_user_props.php
示例3: getOrderPropsValue
public static function getOrderPropsValue($orderId, $fetchByCode = true)
{
static $result = array();
$hash = $orderId . '_' . $fetchByCode;
if($result[$hash] === null)
{
$result[$hash] = array();
$rs = \CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $orderId), false, false, array('NAME', 'VALUE', 'CODE'));
while($ar = $rs->GetNext(true, false))
{
$obj = new OrderPropsValue($ar);
if($fetchByCode)
{
$result[$hash][$ar['CODE']] = $obj;
}
else
{
$result[$hash][] = $obj;
}
}
}
return $result[$hash];
}
开发者ID:AlexSmerw,项目名称:domino,代码行数:25,代码来源:OrderPropsValue.class.php
示例4: OnBeforeEventAddHandler
public static function OnBeforeEventAddHandler(&$event, &$lid, &$arFields)
{
if ($event == "SALE_NEW_ORDER") {
$orderId = $arFields['ORDER_ID'];
$dbOrderProps = CSaleOrderPropsValue::GetList(array("CODE" => "ASC"), array("ORDER_ID" => $orderId, "CODE" => array("ORDER_PHONE", "ORDER_ADDRESS", "ORDER_ADDRESS_DETAILS", "ORDER_NAME")));
while ($arOrderProps = $dbOrderProps->GetNext()) {
$arFields[$arOrderProps['CODE']] = $arOrderProps['~VALUE'];
}
$arFields["ORDER_DESCRIPTION"] = trim(CSaleOrder::GetByID($orderId)["USER_DESCRIPTION"]);
}
}
开发者ID:rasuldev,项目名称:torino,代码行数:11,代码来源:eventhandlers.php
示例5: getProperties
public function getProperties()
{
if (!isset($this->props)) {
$this->props = $this->propsRaw = array();
$res = \CSaleOrderPropsValue::GetList(array('SORT' => 'ASC'), array('ORDER_ID' => $this->id));
while ($row = $res->Fetch()) {
$this->props[$row['CODE']] = $row['VALUE'];
$this->propsRaw[] = $row;
}
}
return $this->props;
}
开发者ID:ASDAFF,项目名称:bitrix_lib,代码行数:12,代码来源:Order.class.php
示例6: Update
function Update($ID, $arFields)
{
global $DB;
$ID = IntVal($ID);
if (!CSaleOrderPropsValue::CheckFields("UPDATE", $arFields, $ID)) {
return false;
}
$strUpdate = $DB->PrepareUpdate("b_sale_order_props_value", $arFields);
$strSql = "UPDATE b_sale_order_props_value SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
return $ID;
}
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:12,代码来源:order_props_values.php
示例7: GetByID
function GetByID($ID)
{
global $DB;
$ID = IntVal($ID);
if (CSaleLocation::isLocationProMigrated()) {
$strSql = "SELECT V.ID, V.USER_PROPS_ID, V.ORDER_PROPS_ID, V.NAME, " . CSaleOrderPropsValue::getPropertyValueFieldSelectSql('V') . ", P.TYPE " . "FROM b_sale_user_props_value V " . "INNER JOIN b_sale_order_props P ON (V.ORDER_PROPS_ID = P.ID) " . CSaleOrderPropsValue::getLocationTableJoinSql('V') . "WHERE V.ID = " . $ID . "";
} else {
$strSql = "SELECT * " . "FROM b_sale_user_props_value " . "WHERE ID = " . $ID . "";
}
$db_res = $DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
if ($res = $db_res->Fetch()) {
return $res;
}
return False;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:15,代码来源:order_user_props_value.php
示例8: AddOrderProperty
function AddOrderProperty($prop_id, $value, $order)
{
if (!strlen($prop_id)) {
return false;
}
if (CModule::IncludeModule('sale')) {
if ($arOrderProps = CSaleOrderProps::GetByID($prop_id)) {
$db_vals = CSaleOrderPropsValue::GetList(array(), array('ORDER_ID' => $order, 'ORDER_PROPS_ID' => $arOrderProps['ID']));
if ($arVals = $db_vals->Fetch()) {
return CSaleOrderPropsValue::Update($arVals['ID'], array('NAME' => $arVals['NAME'], 'CODE' => $arVals['CODE'], 'ORDER_PROPS_ID' => $arVals['ORDER_PROPS_ID'], 'ORDER_ID' => $arVals['ORDER_ID'], 'VALUE' => $value));
} else {
return CSaleOrderPropsValue::Add(array('NAME' => $arOrderProps['NAME'], 'CODE' => $arOrderProps['CODE'], 'ORDER_PROPS_ID' => $arOrderProps['ID'], 'ORDER_ID' => $order, 'VALUE' => $value));
}
}
}
}
开发者ID:VitaliiSestrenskyi,项目名称:sest,代码行数:16,代码来源:AddOrderProperty.php
示例9: Update
function Update($ID, $arFields)
{
global $DB;
$ID = IntVal($ID);
if (!CSaleOrderPropsValue::CheckFields("UPDATE", $arFields, $ID)) {
return false;
}
// need to check here if we got CODE or ID came
if (isset($arFields['VALUE']) && (string) $arFields['VALUE'] != '' && CSaleLocation::isLocationProMigrated()) {
$propValue = self::GetByID($ID);
if ($propValue['TYPE'] == 'LOCATION') {
$arFields['VALUE'] = CSaleLocation::tryTranslateIDToCode($arFields['VALUE']);
}
}
$strUpdate = $DB->PrepareUpdate("b_sale_order_props_value", $arFields);
$strSql = "UPDATE b_sale_order_props_value SET " . "\t" . $strUpdate . " " . "WHERE ID = " . $ID . " ";
$DB->Query($strSql, false, "File: " . __FILE__ . "<br>Line: " . __LINE__);
return $ID;
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:19,代码来源:order_props_values.php
示例10: preparePreregistrationReqData
public static function preparePreregistrationReqData($arOrder, $profileId, $arConfig)
{
$result = array();
$result["sender"] = array("inn" => $arConfig["INN"]["VALUE"], "city" => static::getFilialAndCity($arConfig["CITY_DELIVERY"]["VALUE"]), "title" => $arConfig["NAME"]["VALUE"], "phone" => $arConfig["PHONE"]["VALUE"]);
$inn = "";
$city = "";
$title = "";
$phone = "";
$address = "";
if (isset($extraParams["location"])) {
$city = $extraParams["location"];
}
$dbOrderProps = \CSaleOrderPropsValue::GetOrderProps($arOrder["ID"]);
while ($arOrderProps = $dbOrderProps->Fetch()) {
if ($arOrderProps["CODE"] == "COMPANY" || $arOrderProps["CODE"] == "FIO") {
$title = $arOrderProps["VALUE"];
}
if ($arOrderProps["CODE"] == "INN") {
$inn = $arOrderProps["VALUE"];
}
if ($arOrderProps["CODE"] == "PHONE") {
$phone = $arOrderProps["VALUE"];
}
if ($arOrderProps["CODE"] == "LOCATION") {
$location = $arOrderProps["VALUE"];
$locDelivery = Adapter::mapLocation($location);
// todo: if more than one
$city = static::getFilialAndCity(key($locDelivery));
}
if ($arOrderProps["CODE"] == "ADDRESS") {
$address = $arOrderProps["VALUE"];
}
}
$arPacks = \CSaleDeliveryHelper::getBoxesFromConfig($profileId, $arConfig);
$arPackagesParams = \CSaleDeliveryHelper::getRequiredPacks($arOrder["ITEMS"], $arPacks, 0);
$result["cargos"] = array(array("common" => array("positionsCount" => count($arPackagesParams), "decription" => GetMessage("SALE_DH_PECOM_DESCRIPTION_GOODS"), "orderNumber" => $arOrder["ACCOUNT_NUMBER"], "paymentForm" => $arConfig["PAYMENT_FORM"]["VALUE"], "accompanyingDocuments" => false), "receiver" => array("inn" => $inn, "city" => $city, "title" => $title, "phone" => $phone, "addressStock" => $address), "services" => array("transporting" => array("payer" => array("type" => 1)), "hardPacking" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_RIGID_PACKING'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_RIGID_PAYER'))), "palletTransporting" => array("enabled" => !\CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_RIGID_PACKING') && \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_PALLETE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_PALLETE_PAYER'))), "insurance" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_INSURANCE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_INSURANCE_PAYER')), "cost" => intval($arOrder["PRICE"])), "sealing" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_OTHER_PLOMBIR_ENABLE'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_PLOMBIR_PAYER'))), "strapping" => array("enabled" => false), "documentsReturning" => array("enabled" => false), "delivery" => array("enabled" => \CDeliveryPecom::isConfCheckedVal($arConfig, 'SERVICE_DELIVERY_ENABLED'), "payer" => array("type" => \CDeliveryPecom::getConfValue($arConfig, 'SERVICE_OTHER_DELIVERY_PAYER'))))));
return $result;
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:38,代码来源:adapter.php
示例11: array
$html = "";
$arRelFilter = array();
$arRelFilter["RELATED"]["DELIVERY_ID"] = $str_DELIVERY_ID;
$arRelFilter["RELATED"]["PAYSYSTEM_ID"] = $str_PAY_SYSTEM_ID;
if (isset($arRelFilter["RELATED"]) && (strlen($arRelFilter["RELATED"]["DELIVERY_ID"]) > 0 || intval($arRelFilter["RELATED"]["PAYSYSTEM_ID"]) > 0))
{
$dbRelatedProps = CSaleOrderProps::GetList(array(), $arRelFilter, false, false, array("*"));
while ($arRelatedProps = $dbRelatedProps->GetNext())
$arProps[] = $arRelatedProps;
$arPropsValues = array();
if (!$bVarsFromForm)
{
$dbPropValue = CSaleOrderPropsValue::GetOrderRelatedProps($ID, $arRelFilter["RELATED"]);
while ($arValue = $dbPropValue->GetNext())
$arPropsValues[$arValue["ORDER_PROPS_ID"]] = $arValue["VALUE"];
}
$propsHTML = getOrderPropertiesHTML($arProps, $arPropsValues, $LID, $str_USER_ID, $ID, $bVarsFromForm);
}
$tabControl->AddSection("RELATED_PROPS", GetMessage("NEW_ORDER_RELATED_PROPS"));
$tabControl->BeginCustomField("RELATED_PROPS_DATA", GetMessage("NEW_ORDER_RELATED_PROPS"), true);
?>
<tr>
<td id="related_props_content" colspan="2">
<?php
echo $propsHTML;
?>
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:30,代码来源:order_new.php
示例12: array
array(
"ORDER_ID" => $ID,
"PERSON_TYPE_ID" => $arPersonType["ID"],
"ACTIVE" => "Y",
">INPUT_FIELD_LOCATION" => 0
),
false,
false,
array("INPUT_FIELD_LOCATION")
);
while ($arProperties = $dbProperties->Fetch())
$arTownOrderProps[$arProperties["INPUT_FIELD_LOCATION"]] = $arProperties["INPUT_FIELD_LOCATION"];
$arEnableTownProps = array();
$arOrderPropsValue = array();
$dbOrderProps = CSaleOrderPropsValue::GetOrderProps($ID);
while ($arOrderProps = $dbOrderProps->Fetch())
{
$arOrderPropsValue[] = $arOrderProps;
if ($arOrderProps["TYPE"] == "LOCATION" && $arOrderProps["ACTIVE"] == "Y" && $arOrderProps["IS_LOCATION"] == "Y" && in_array($arOrderProps["INPUT_FIELD_LOCATION"], $arTownOrderProps))
{
if(CSaleLocation::isLocationProMigrated())
{
$arEnableTownProps[$arOrderProps["INPUT_FIELD_LOCATION"]] = CSaleLocation::checkLocationIsAboveCity($arOrderProps["VALUE"]);
}
else
{
$arLocation = CSaleLocation::GetByID($arOrderProps["VALUE"]);
if (IntVal($arLocation["CITY_ID"]) <= 0)
$arEnableTownProps[$arOrderProps["INPUT_FIELD_LOCATION"]] = true;
else
开发者ID:akniyev,项目名称:arteva.ru,代码行数:31,代码来源:order_detail.php
示例13: fGetBuyerType
//.........这里部分代码省略.........
{
$arPropertiesList[$property['ID']] = $property;
}
// getting values
$arPropValues = array();
if ($formVarsSubmit) // from request
{
$locationIndexForm = "";
foreach ($_POST as $key => $value)
{
if (substr($key, 0, strlen("CITY_ORDER_PROP_")) == "CITY_ORDER_PROP_")
{
$arPropValues[intval(substr($key, strlen("CITY_ORDER_PROP_")))] = htmlspecialcharsbx($value);
$locationIndexForm = intval(substr($key, strlen("CITY_ORDER_PROP_")));
}
if (substr($key, 0, strlen("ORDER_PROP_")) == "ORDER_PROP_")
{
if ($locationIndexForm != intval(substr($key, strlen("ORDER_PROP_"))) && !is_array($value))
$arPropValues[intval(substr($key, strlen("ORDER_PROP_")))] = htmlspecialcharsbx($value);
}
}
$userComment = $_POST["USER_DESCRIPTION"];
}
elseif ($ORDER_ID == "" AND $USER_ID != "") // from profile
{
//profile
$userProfile = array();
$userProfile = CSaleOrderUserProps::DoLoadProfiles($USER_ID, $PERSON_TYPE_ID);
$arPropValues = $userProfile[$PERSON_TYPE_ID]["VALUES"];
}
elseif ($ORDER_ID != "") // from order properties
{
$dbPropValuesList = CSaleOrderPropsValue::GetList(
array(),
array("ORDER_ID" => $ORDER_ID, "ACTIVE" => "Y"),
false,
false,
array("ID", "ORDER_PROPS_ID", "NAME", "VALUE", "CODE")
);
while ($arPropValuesList = $dbPropValuesList->Fetch())
{
// from db
if(CSaleLocation::isLocationProMigrated() && $arPropertiesList[$arPropValuesList['ORDER_PROPS_ID']]['TYPE'] == 'LOCATION')
$arPropValuesList["VALUE"] = CSaleLocation::getLocationIDbyCODE($arPropValuesList["VALUE"]);
$arPropValues[intval($arPropValuesList["ORDER_PROPS_ID"])] = htmlspecialcharsbx($arPropValuesList["VALUE"]);
}
}
$location2townFldMap = array();
$arDisableFieldForLocation = array();
//select field (town) for disable
$dbProperties = CSaleOrderProps::GetList(
array(),
array("PERSON_TYPE_ID" => $PERSON_TYPE_ID, "ACTIVE" => "Y", ">INPUT_FIELD_LOCATION" => 0),
false,
false,
array("INPUT_FIELD_LOCATION")
);
while ($arProperties = $dbProperties->Fetch())
{
$arDisableFieldForLocation[$arProperties["INPUT_FIELD_LOCATION"]] = $arProperties["INPUT_FIELD_LOCATION"];
}
//show town if location is another
开发者ID:akniyev,项目名称:arteva.ru,代码行数:67,代码来源:admin_tool.php
示例14: bxModifySaleMails
/**
* событие вызывается перед отправкой письма о новом заказе
* @param $orderID
* @param $eventName
* @param $arFields
*/
function bxModifySaleMails($order_id, &$eventName, &$arFieldsEmail)
{
//unset($_SESSION['OnBeforeOrderAddHandler']);
//$_SESSION['OnBeforeOrderAddHandler']['bxModifySaleMails']='bxModifySaleMails';
//$_SESSION['OnBeforeOrderAddHandler']['id']=$order_id;
//$_SESSION['OnBeforeOrderAddHandler']['arFields']=$arFieldsorder_old;
$basket_props="";
$post['INFO']="";
$id_product=array();
if(
(CModule::IncludeModule("main"))
&&
(CModule::IncludeModule("iblock"))
&&
(CModule::IncludeModule("catalog"))
&&
(CModule::IncludeModule("sale"))
){
/**
* получаем параметры сформировавшегося старого заказа
*/
$arFieldsorder_old = CSaleOrder::GetByID($order_id);
/*
echo "<pre>";
var_dump($arFieldsorder_old);die();
echo "</pre>";*/
/**
* выборка свойства сформировавшегося заказа по id заказа
*/
$db_props = CSaleOrderPropsValue::GetOrderProps($order_id);
$arFields_props = array();
while ($arProps = $db_props->Fetch())
{
$arFields_props_old[$arProps['CODE']]=$arProps;
}
//_debug($arFields_props_old);
/**
* выборка из корзины по id заказа
* получаем масси id продукта
*/
$rsUser = CUser::GetByID(CUser::GetID());
$arUser = $rsUser->Fetch();
/*if (!$ORDER_ID = CSaleOrder::Add(array(
"LID" => SITE_ID,
"PERSON_TYPE_ID" => 1,
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE" => 0,
"CURRENCY" => CSaleLang::GetLangCurrency(SITE_ID),
"USER_ID" => $arUser['ID'],
"PAY_SYSTEM_ID" => $arFieldsorder_old['PAY_SYSTEM_ID'],
"PRICE_DELIVERY" => 0,
"DELIVERY_ID" => $arFieldsorder_old['DELIVERY_ID'],
"DISCOUNT_VALUE" => $arFieldsorder_old['DISCOUNT_VALUE'],
"TAX_VALUE" => $arFieldsorder_old['TAX_VALUE'],
"USER_DESCRIPTION" => $post['INFO']
))){
$rows['msg'] = 'Ошибка создания заказа';
$fail = true;
}else{
$rows['msg']=$ORDER_ID;
//continue;
}*/
$dbBasketItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
"LID" => SITE_ID,
"ORDER_ID" => $order_id
),
false,
false,
array()
);
while ($arItem = $dbBasketItems->Fetch()){
$id_product[] = $arItem['PRODUCT_ID'];
$products_basket[$arItem['PRODUCT_ID']]=$arItem;
}
foreach($products_basket as $product){
$price_product+=$product['PRICE']*$product['QUANTITY'];
$products_descriptions.=$product['NAME']." - ".$product['QUANTITY']." шт: ".intval($product['PRICE'])." руб <br/>";
}
$price_product+=$arFieldsorder_old["PRICE_DELIVERY"];
//.........这里部分代码省略.........
开发者ID:ASDAFF,项目名称:gpbitrix,代码行数:101,代码来源:class.php
示例15: round
$val["DISCOUNT_RATION_PERCENT"] = round($val["PRICE"] * 100 / $priceTotal, 5);
$val["DISCOUNT_RATION_VALUE"] = round($discount * $val["DISCOUNT_RATION_PERCENT"] / 100, 5);
$val["PRICE"] -= $val["DISCOUNT_RATION_VALUE"];
$arBasket[$key] = $val;
}
return $arBasket;
}
if (CModule::IncludeModule("sale")) {
if ($arOrder = CSaleOrder::GetByID($ORDER_ID)) {
$rep_file_name = GetRealPath2Report($doc . ".php");
if (strlen($rep_file_name) <= 0) {
ShowError("PRINT TEMPLATE NOT FOUND");
die;
}
$arOrderProps = array();
$dbOrderPropVals = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $ORDER_ID), false, false, array("ID", "CODE", "VALUE", "ORDER_PROPS_ID", "PROP_TYPE"));
while ($arOrderPropVals = $dbOrderPropVals->Fetch()) {
$arCurOrderPropsTmp = CSaleOrderProps::GetRealValue($arOrderPropVals["ORDER_PROPS_ID"], $arOrderPropVals["CODE"], $arOrderPropVals["PROP_TYPE"], $arOrderPropVals["VALUE"], LANGUAGE_ID);
foreach ($arCurOrderPropsTmp as $key => $value) {
$arOrderProps[$key] = $value;
}
}
if (CSaleLocation::isLocationProMigrated()) {
if (strlen($arOrderProps['LOCATION_VILLAGE']) && !strlen($arOrderProps['LOCATION_CITY'])) {
$arOrderProps['LOCATION_CITY'] = $arOrderProps['LOCATION_VILLAGE'];
}
// street added to the beginning of address, as it used to be before
if (strlen($arOrderProps['LOCATION_STREET']) && isset($arOrderProps['ADDRESS'])) {
$arOrderProps['ADDRESS'] = $arOrderProps['LOCATION_STREET'] . (strlen($arOrderProps['ADDRESS']) ? ', ' . $arOrderProps['ADDRESS'] : '');
}
}
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:31,代码来源:print.php
示例16: obtainProps
/**
* Function gets order properties from database
* @param mixed[] $cached Cached data taken from obtainDataCachedStructure()
* @return void
*/
protected function obtainProps(&$cached)
{
if (empty($this->dbResult["ID"])) {
return;
}
$props = array();
$dbOrderProps = CSaleOrderPropsValue::GetOrderProps($this->dbResult["ID"]);
$iGroup = -1;
while ($arOrderProps = $dbOrderProps->GetNext()) {
if (empty($this->arParams["PROP_" . $this->dbResult["PERSON_TYPE_ID"]]) || !in_array($arOrderProps["ORDER_PROPS_ID"], $this->arParams["PROP_" . $this->dbResult["PERSON_TYPE_ID"]])) {
if ($arOrderProps["ACTIVE"] == "Y" && $arOrderProps["UTIL"] == "N") {
$arOrderPropsTmp = $arOrderProps;
if ($iGroup != intval($arOrderProps["PROPS_GROUP_ID"])) {
$arOrderPropsTmp["SHOW_GROUP_NAME"] = "Y";
$iGroup = intval($arOrderProps["PROPS_GROUP_ID"]);
}
if ($arOrderProps["TYPE"] == "SELECT" || $arOrderProps["TYPE"] == "RADIO") {
$arVal = CSaleOrderPropsVariant::GetByValue($arOrderProps["ORDER_PROPS_ID"], $arOrderProps["VALUE"]);
$arOrderPropsTmp["VALUE"] = htmlspecialcharsEx($arVal["NAME"]);
} elseif ($arOrderProps["TYPE"] == "MULTISELECT") {
$arOrderPropsTmp["VALUE"] = "";
$curVal = explode(",", $arOrderProps["VALUE"]);
for ($i = 0, $intCount = count($curVal); $i < $intCount; $i++) {
$arVal = CSaleOrderPropsVariant::GetByValue($arOrderProps["ORDER_PROPS_ID"], $curVal[$i]);
if ($i > 0) {
$arOrderPropsTmp["VALUE"] .= ", ";
}
$arOrderPropsTmp["VALUE"] .= htmlspecialcharsEx($arVal["NAME"]);
}
} elseif ($arOrderProps["TYPE"] == "LOCATION") {
$locationName = "";
if (CSaleLocation::isLocationProMigrated()) {
$locationName = Location\Admin\LocationHelper::getLocationStringById($arOrderProps["VALUE"]);
} else {
$arVal = CSaleLocation::GetByID($arOrderProps["VALUE"], LANGUAGE_ID);
$locationName .= !strlen($arVal["COUNTRY_NAME"]) ? "" : $arVal["COUNTRY_NAME"];
if (strlen($arVal["COUNTRY_NAME"]) && strlen($arVal["REGION_NAME"])) {
$locationName .= " - " . $arVal["REGION_NAME"];
} elseif (strlen($arVal["REGION_NAME"])) {
$locationName .= $arVal["REGION_NAME"];
}
if (strlen($arVal["COUNTRY_NAME"]) || strlen($arVal["REGION_NAME"])) {
$locationName .= " - " . $arVal["CITY_NAME"];
} elseif (strlen($arVal["CITY_NAME"])) {
$locationName .= $arVal["CITY_NAME"];
}
}
$arOrderPropsTmp["VALUE"] = $locationName;
} elseif ($arOrderProps["TYPE"] == "FILE") {
if (strpos($arOrderProps["VALUE"], ",") !== false) {
$fileValue = "";
$values = explode(",", $arOrderProps["VALUE"]);
if (self::isNonemptyArray($values)) {
foreach ($values as $fileId) {
$fileValue .= CFile::ShowFile(trim($fileId), 0, 90, 90, true) . "<br/>";
}
}
$arOrderPropsTmp["VALUE"] = $fileValue;
} else {
$arOrderPropsTmp["VALUE"] = CFile::ShowFile($arOrderProps["VALUE"], 0, 90, 90, true);
}
}
$props[] = $arOrderPropsTmp;
}
}
}
$cached["ORDER_PROPS"] = $props;
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:73,代码来源:class.php
示例17: getPhoneEmail
protected static function getPhoneEmail($orderId)
{
$result = array("EMAIL" => "", "PHONE" => "");
$dbOrderProps = \CSaleOrderPropsValue::GetOrderProps($orderId);
while ($arOrderProps = $dbOrderProps->Fetch()) {
if ($arOrderProps["CODE"] == "EMAIL") {
$result["EMAIL"] = $arOrderProps["VALUE"];
}
if ($arOrderProps["CODE"] == "PHONE") {
$result["PHONE"] = $arOrderProps["VALUE"];
}
}
return $result;
}
开发者ID:rasuldev,项目名称:torino,代码行数:14,代码来源:delivery_pecom.php
示例18: __MakeOrder
//.........这里部分代码省略.........
$arPrd = Array();
$dbItem = CIBlockElement::GetList(Array("PROPERTY_MORE_PHOTO" => "DESC", "ID" => "ASC"), Array("IBLOCK_TYPE" => "offers", "IBLOCK_SITE_ID" => WIZARD_SITE_ID, "PROPERTY_NEWPRODUCT" => false), false, Array("nTopCount" => 10), Array("ID", "IBLOCK_ID", "XML_ID", "NAME", "DETAIL_PAGE_URL", "IBLOCK_XML_ID"));
while($arItem = $dbItem->GetNext())
$arPrd[] = $arItem;
if(!empty($arPrd))
{
for($i=0; $i<$prdCnt;$i++)
{
$prdID = $arPrd[mt_rand(0, 9)];
$arProduct = CCatalogProduct::GetByID($prdID["ID"]);
$CALLBACK_FUNC = "";
$arCallbackPrice = CSaleBasket::ReReadPrice($CALLBACK_FUNC, "catalog", $prdID["ID"], 1);
$arFields = array(
"PRODUCT_ID" => $prdID["ID"],
"PRODUCT_PRICE_ID" => $arCallbackPrice["PRODUCT_PRICE_ID"],
"PRICE" => $arCallbackPrice["PRICE"],
"CURRENCY" => $arCallbackPrice["CURRENCY"],
"WEIGHT" => $arProduct["WEIGHT"],
"QUANTITY" => 1,
"LID" => WIZARD_SITE_ID,
"DELAY" => "N",
"CAN_BUY" => "Y",
"NAME" => $prdID["NAME"],
"CALLBACK_FUNC" => $CALLBACK_FUNC,
"MODULE" => "catalog",
"PRODUCT_PROVIDER_CLASS" => "CCatalogProductProvider",
"ORDER_CALLBACK_FUNC" => "",
"CANCEL_CALLBACK_FUNC" => "",
"PAY_CALLBACK_FUNC" => "",
"DETAIL_PAGE_URL" => $prdID["DETAIL_PAGE_URL"],
"CATALOG_XML_ID" => $prdID["IBLOCK_XML_ID"],
"PRODUCT_XML_ID" => $prdID["XML_ID"],
"VAT_RATE" => $arCallbackPrice['VAT_RATE'],
);
$addres = CSaleBasket::Add($arFields);
}
$arOrder = Array(
"LID" => $arData["SITE_ID"],
"PERSON_TYPE_ID" => $arData["PERSON_TYPE_ID"],
"PAYED" => "N",
"CANCELED" => "N",
"STATUS_ID" => "N",
"PRICE" => 1,
"CURRENCY" => $arData["CURRENCY"],
"USER_ID" => $arData["USER_ID"],
"PAY_SYSTEM_ID" => $arData["PAY_SYSTEM_ID"],
//"PRICE_DELIVERY" => $arData["PRICE_DELIVERY"],
//"DELIVERY_ID" => $arData["DELIVERY_ID"],
);
$dbFUserListTmp = CSaleUser::GetList(array("USER_ID" => $arData["USER_ID"]));
if(empty($dbFUserListTmp))
{
$arFields = array(
"=DATE_INSERT" => $DB->GetNowFunction(),
"=DATE_UPDATE" => $DB->GetNowFunction(),
"USER_ID" => $arData["USER_ID"]
);
$ID = CSaleUser::_Add($arFields);
}
$orderID = CSaleOrder::Add($arOrder);
CSaleBasket::OrderBasket($orderID, CSaleBasket::GetBasketUserID(), WIZARD_SITE_ID);
$dbBasketItems = CSaleBasket::GetList(
array("NAME" => "ASC"),
array(
"FUSER_ID" => CSaleBasket::GetBasketUserID(),
"LID" => WIZARD_SITE_ID,
"ORDER_ID" => $orderID
),
false,
false,
array("ID", "CALLBACK_FUNC", "MODULE", "PRODUCT_ID", "QUANTITY", "DELAY", "CAN_BUY", "PRICE", "WEIGHT", "NAME")
);
$ORDER_PRICE = 0;
while ($arBasketItems = $dbBasketItems->GetNext())
{
$ORDER_PRICE += roundEx($arBasketItems["PRICE"], SALE_VALUE_PRECISION) * DoubleVal($arBasketItems["QUANTITY"]);
}
$totalOrderPrice = $ORDER_PRICE + $arData["PRICE_DELIVERY"];
CSaleOrder::Update($orderID, Array("PRICE" => $totalOrderPrice));
foreach($arData["PROPS"] as $val)
{
$arFields = Array(
"ORDER_ID" => $orderID,
"ORDER_PROPS_ID" => $val["ID"],
"NAME" => $val["NAME"],
"CODE" => $val["CODE"],
"VALUE" => $val["VALUE"],
);
CSaleOrderPropsValue::Add($arFields);
}
return $orderID;
}
}
开发者ID:ASDAFF,项目名称:entask.ru,代码行数:101,代码来源:step1.php
示例19: array
if ($arOrderProperties["TYPE"] == "CHECKBOX" && strlen($curVal) <= 0 && $arOrderProperties["REQUIED"] != "Y")
{
$curVal = "N";
}
if (strlen($curVal) > 0)
{
$arFields = array(
"ORDER_ID" => $arResult["ORDER_ID"],
"ORDER_PROPS_ID" => $arOrderProperties["ID"],
"NAME" => $arOrderProperties["NAME"],
"CODE" => $arOrderProperties["CODE"],
"VALUE" => $curVal
);
CSaleOrderPropsValue::Add($arFields);
if ( $arOrderProperties["USER_PROPS"] == "Y"
|
请发表评论