本文整理汇总了PHP中CSaleDeliveryHandler::GetBySID方法的典型用法代码示例。如果您正苦于以下问题:PHP CSaleDeliveryHandler::GetBySID方法的具体用法?PHP CSaleDeliveryHandler::GetBySID怎么用?PHP CSaleDeliveryHandler::GetBySID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSaleDeliveryHandler
的用法示例。
在下文中一共展示了CSaleDeliveryHandler::GetBySID方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
$bErrorField = True;
}
}
if ($bErrorField)
$arResult["ERROR"][] = GetMessage("SOA_ERROR_REQUIRE")." \"".$arOrderProps["NAME"]."\"";
//}//end isset
}//end while
if(IntVal($arUserResult["DELIVERY_LOCATION"]) > 0)
{
if (strlen($arUserResult["DELIVERY_ID"]) > 0 && strpos($arUserResult["DELIVERY_ID"], ":") !== false)
{
$delivery = explode(":", $arUserResult["DELIVERY_ID"]);
$obDeliveryHandler = CSaleDeliveryHandler::GetBySID($delivery[0]);
$arResult["DELIVERY_SUM"] = $obDeliveryHandler->Fetch();
$arResult["DELIVERY_PROFILE_SUM"] = $delivery[1];
$arOrderTmpDel = array(
"PRICE" => $arResult["ORDER_PRICE"],
"WEIGHT" => $arResult["ORDER_WEIGHT"],
"LOCATION_FROM" => COption::GetOptionInt('sale', 'location'),
"LOCATION_TO" => $arUserResult["DELIVERY_LOCATION"],
"LOCATION_ZIP" => $arUserResult["DELIVERY_LOCATION_ZIP"],
);
$arDeliveryPrice = CSaleDeliveryHandler::CalculateFull($delivery[0], $delivery[1], $arOrderTmpDel, $arResult["BASE_LANG_CURRENCY"]);
if ($arDeliveryPrice["RESULT"] == "ERROR")
示例2: doubleval
if (is_set($arParams["START_VALUE"])) {
$arParams["START_VALUE"] = doubleval($arParams["START_VALUE"]);
}
if ($arParams["AJAX_CALL"] == "Y") {
if ($arParams['NO_AJAX'] == 'Y') {
$result = CSaleDeliveryHandler::CalculateFull($arParams["DELIVERY"], $arParams["PROFILE"], array("PRICE" => $arParams["ORDER_PRICE"], "WEIGHT" => $arParams["ORDER_WEIGHT"], "LOCATION_FROM" => $arParams["LOCATION_FROM"], "LOCATION_TO" => $arParams["LOCATION_TO"], "LOCATION_ZIP" => $arParams['LOCATION_ZIP'], "ITEMS" => $arParams["ITEMS"], "EXTRA_PARAMS" => $arParams["EXTRA_PARAMS"]), $arParams["CURRENCY"]);
if (is_array($result)) {
if ($result["RESULT"] == "OK" && CModule::IncludeModule('currency')) {
$result["VALUE_FORMATTED"] = CurrencyFormat($result["VALUE"], $arParams["CURRENCY"]);
} elseif ($result["RESULT"] == "NEXT_STEP" && strlen($result["TEMP"]) > 0) {
$result["TEMP"] = CUtil::JSEscape($result["TEMP"]);
}
$arResult["RESULT"] = $result;
}
} else {
$dbHandler = CSaleDeliveryHandler::GetBySID($arParams["DELIVERY"]);
if ($arHandler = $dbHandler->Fetch()) {
foreach ($arHandler["PROFILES"] as $profile_id => $arProfile) {
if ($profile_id != $arParams["PROFILE"]) {
unset($arHandler["PROFILES"][$profile_id]);
}
}
$result = CSaleDeliveryHandler::Calculate($arParams["STEP"], $arParams["DELIVERY"], $arParams["PROFILE"], array("PRICE" => $arParams["ORDER_PRICE"], "WEIGHT" => $arParams["ORDER_WEIGHT"], "LOCATION_FROM" => $arParams["LOCATION_FROM"], "LOCATION_TO" => $arParams["LOCATION_TO"], "LOCATION_ZIP" => $arParams['LOCATION_ZIP'], "ITEMS" => $arParams["ITEMS"], "EXTRA_PARAMS" => $arParams["EXTRA_PARAMS"]), $arParams["CURRENCY"], $arParams["~TEMP"]);
if (is_array($result)) {
if ($result["RESULT"] == "OK" && CModule::IncludeModule('currency')) {
$result["VALUE_FORMATTED"] = CurrencyFormat($result["VALUE"], $arParams["CURRENCY"]);
} elseif ($result["RESULT"] == "NEXT_STEP" && strlen($result["TEMP"]) > 0) {
$result["TEMP"] = CUtil::JSEscape($result["TEMP"]);
}
$arResult["RESULT"] = $result;
}
示例3: CheckFields
//.........这里部分代码省略.........
return false;
}
}
if (is_set($arFields, "PERSON_TYPE_ID"))
{
if (!($arPersonType = CSalePersonType::GetByID($arFields["PERSON_TYPE_ID"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PERSON_TYPE_ID"], GetMessage("SKGO_WRONG_PERSON_TYPE")), "ERROR_NO_PERSON_TYPE");
return false;
}
}
if (is_set($arFields, "PAY_SYSTEM_ID") && IntVal($arFields["PAY_SYSTEM_ID"]) > 0)
{
if (!($arPaySystem = CSalePaySystem::GetByID(IntVal($arFields["PAY_SYSTEM_ID"]))))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["PAY_SYSTEM_ID"], GetMessage("SKGO_WRONG_PS")), "ERROR_NO_PAY_SYSTEM");
return false;
}
}
if (is_set($arFields, "DELIVERY_ID") && (
strpos($arFields["DELIVERY_ID"], ":") !== false
||
IntVal($arFields["DELIVERY_ID"]) > 0
)
)
{
if (strpos($arFields["DELIVERY_ID"], ":") !== false)
{
$arId = explode(":", $arFields["DELIVERY_ID"]);
$obDelivery = new CSaleDeliveryHandler();
if ($arDelivery = $obDelivery->GetBySID($arId[0]))
{
if ($arDelivery = $arDelivery->Fetch())
{
if (!is_set($arDelivery["PROFILES"], $arId[1]))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["DELIVERY_ID"], GetMessage("SKGO_WRONG_DELIVERY")), "ERROR_NO_DELIVERY");
return false;
}
}
}
else
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["DELIVERY_ID"], GetMessage("SKGO_WRONG_DELIVERY")), "ERROR_NO_DELIVERY");
return false;
}
}
else
{
if (!($arDelivery = CSaleDelivery::GetByID(IntVal($arFields["DELIVERY_ID"]))))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["DELIVERY_ID"], GetMessage("SKGO_WRONG_DELIVERY")), "ERROR_NO_DELIVERY");
return false;
}
}
}
if (is_set($arFields, "STATUS_ID"))
{
if (!($arStatus = CSaleStatus::GetByID($arFields["STATUS_ID"])))
{
$GLOBALS["APPLICATION"]->ThrowException(str_replace("#ID#", $arFields["STATUS_ID"], GetMessage("SKGO_WRONG_STATUS")), "ERROR_NO_STATUS_ID");
return false;
示例4: CSaleDeliveryHandler
$row->AddField("PAY_SYSTEM", $fieldValue);
$fieldValue = "";
if (in_array("DELIVERY", $arVisibleColumns))
{
if (strpos($arOrder["DELIVERY_ID"], ":") !== false)
{
if (!isset($obDelivery))
{
$obDelivery = new CSaleDeliveryHandler();
$obDelivery->GetList(array("SITE_ID" => "ASC"), array("SITE_ID" => "ALL", "ACTIVE" => "ALL"));
}
$arId = explode(":", $arOrder["DELIVERY_ID"]);
$rsDelivery = CSaleDeliveryHandler::GetBySID($arId[0]);
$arDelivery = $rsDelivery->Fetch();
$fieldValue .= "[";
if ($saleModulePermissions >= "W")
$fieldValue .= '<a href="/bitrix/admin/sale_delivery_handler_edit.php?SID='.$arId[0].'&lang='.LANGUAGE_ID.'">';
$fieldValue .= $arOrder["DELIVERY_ID"];
if ($saleModulePermissions >= "W")
$fieldValue .= "</a>";
$fieldValue .= "] ".htmlspecialcharsEx($arDelivery["NAME"]);
$fieldValue .= " (".htmlspecialcharsEx($arDelivery["PROFILES"][$arId[1]]["TITLE"]).")";
}
elseif (IntVal($arOrder["DELIVERY_ID"]) > 0)
{
if (!isset($LOCAL_DELIVERY_CACHE[$arOrder["DELIVERY_ID"]])
示例5: DoInstall
public function DoInstall()
{
if ($GLOBALS['APPLICATION']->GetGroupRight('main') < 'W') {
return;
}
if (is_array($this->NEED_MODULES) && !empty($this->NEED_MODULES)) {
foreach ($this->NEED_MODULES as $module) {
if (!IsModuleInstalled($module)) {
$this->ShowForm('ERROR', $this->GetMessage('DDELIVERY_NEED_MODULES', array('#MODULE#' => $module, '#NEED#' => $this->NEED_MODULES)));
return;
}
include $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/' . $module . '/install/version.php';
if (!CheckVersion($arModuleVersion['VERSION'], $this->NEED_MAIN_VERSION)) {
$this->ShowForm('ERROR', $this->GetMessage('DDELIVERY_NEED_MODULES', array('#MODULE#' => $module, '#NEED#' => $this->NEED_MAIN_VERSION)));
return;
}
}
}
if (!function_exists('curl_init')) {
$this->ShowForm('ERROR', $this->GetMessage('DDELIVERY_NEED_MODULES_CURL', array('#MODULE#' => 'cURL')));
return;
}
if (CheckVersion(SM_VERSION, $this->NEED_MAIN_VERSION)) {
RegisterModuleDependences('sale', 'onSaleDeliveryHandlersBuildList', self::MODULE_ID, 'DDeliveryEvents', 'Init');
RegisterModuleDependences('sale', 'OnOrderNewSendEmail', self::MODULE_ID, 'DDeliveryEvents', 'OnOrderNewSendEmail');
RegisterModuleDependences('sale', 'OnSaleBeforeStatusOrder', self::MODULE_ID, 'DDeliveryEvents', 'OnSaleBeforeStatusOrder');
if (!symlink(__DIR__ . "/components/ddelivery", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components/ddelivery")) {
CopyDirFiles(__DIR__ . "/components", $_SERVER["DOCUMENT_ROOT"] . "/bitrix/components", true, true);
}
RegisterModule(self::MODULE_ID);
CModule::IncludeModule("sale");
$ddeliveryConfig = CSaleDeliveryHandler::GetBySID('ddelivery')->Fetch();
$ddeliveryConfig['ACTIVE'] = 'N';
CSaleDeliveryHandler::Set('ddelivery', $ddeliveryConfig, false);
include_once __DIR__ . '/../include.php';
include_once __DIR__ . '/../DDeliveryEvents.php';
include_once __DIR__ . '/../DDeliveryShop.php';
// Добавляем свойства в бд
CSaleOrderProps::add(array('PERSON_TYPE_ID' => '1', 'NAME' => 'DDelivery LocalID', 'TYPE' => 'TEXT', 'REQUIED' => 'N', 'DEFAULT_VALUE' => '', 'SORT' => '10000', 'USER_PROPS' => 'N', 'IS_LOCATION' => 'N', 'PROPS_GROUP_ID' => '2', 'IS_EMAIL' => 'N', 'IS_PROFILE_NAME' => 'N', 'IS_PAYER' => 'N', 'IS_LOCATION4TAX' => 'N', 'IS_ZIP' => 'N', 'CODE' => 'DDELIVERY_ID', 'IS_FILTERED' => 'Y', 'ACTIVE' => 'Y', 'UTIL' => 'Y', 'INPUT_FIELD_LOCATION' => '0', 'MULTIPLE' => 'N'));
$IntegratorShop = new DDeliveryShop($ddeliveryConfig['CONFIG']['CONFIG'], array(), array());
$ddeliveryUI = new DDeliveryUI($IntegratorShop, true);
$ddeliveryUI->createTables();
$this->ShowForm('OK', GetMessage('MOD_INST_OK'), true);
} else {
$this->ShowForm('ERROR', $this->GetMessage('DDELIVERY_NEED_RIGHT_VER', array('#NEED#' => $this->NEED_MAIN_VERSION)));
}
}
示例6: FormatOrderDeliverySystemChanged
public static function FormatOrderDeliverySystemChanged($arData)
{
$info = GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED_INFO");
foreach ($arData as $param => $value) {
if ($param == "DELIVERY_ID") {
if (strpos($value, ":") !== false) {
$arId = explode(":", $value);
$dbDelivery = CSaleDeliveryHandler::GetBySID($arId[0]);
$arDelivery = $dbDelivery->Fetch();
$value = "\"" . htmlspecialcharsEx($arDelivery["NAME"]) . "\"";
} elseif (intval($value) > 0) {
$arDelivery = CSaleDelivery::GetByID($value);
$value = "\"" . $arDelivery["NAME"] . "\"";
}
}
$info = str_replace("#" . $param . "#", $value, $info);
}
return array("NAME" => GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED"), "INFO" => $info);
}
示例7: array
CSaleDelivery2PaySystem::UpdateDelivery($SID, array("PAYSYSTEM_ID" => $arPSIds, "DELIVERY_PROFILE_ID" => $profileName));
}
}
if (strlen($errorsList) <= 0) {
if (strlen($_REQUEST["apply"]) > 0) {
LocalRedirect($APPLICATION->GetCurPage() . "?lang=" . LANG . "&SID=" . urlencode($SID));
} else {
LocalRedirect('/bitrix/admin/sale_delivery_handlers.php?lang=' . LANG);
}
die;
}
} else {
$errorsList .= GetMessage('SALE_DH_ERROR_UNRECOGNIZED') . "<br />";
}
}
$rsDeliveryInfo = CSaleDeliveryHandler::GetBySID($SID);
if ($rsDeliveryInfo->SelectedRowsCount() <= 0) {
echo 'error';
die;
}
while ($arHandler = $rsDeliveryInfo->Fetch()) {
$bInstall = $arHandler["INSTALLED"] == "N";
unset($arHandler["DBGETSETTINGS"]);
unset($arHandler["DBSETSETTINGS"]);
unset($arHandler["GETCONFIG"]);
unset($arHandler["COMPABILITY"]);
unset($arHandler["CALCULATOR"]);
if (strlen($arHandler["LID"]) > 0) {
$arDeliveryInfo[$arHandler["LID"]] = $arHandler;
} else {
$arDeliveryInfo = array("ALL" => $arHandler);
示例8: GetMessage
$tabControl->AddSection("order_delivery", GetMessage("P_ORDER_DELIVERY_TITLE"));
$tabControl->BeginCustomField("ORDER_DELIVERY", GetMessage("P_ORDER_DELIVERY"));
?>
<tr>
<td width="40%"><?echo $tabControl->GetCustomLabelHTML()?>:</td>
<td>
<span id="allow_delivery_name">
<?
$arDeliveryName = array();
$arDeliveryData = array();
if (strpos($arOrder["DELIVERY_ID"], ":") !== false)
{
$arDeliveryName = explode(":", $arOrder["DELIVERY_ID"]);
$dbDelivery = CSaleDeliveryHandler::GetBySID($arDeliveryName[0]);
$arDeliveryData = $dbDelivery->Fetch();
echo "[".$arDeliveryData["SID"]."] ".htmlspecialcharsEx($arDeliveryData["NAME"])." (".$arOrder["LID"].")";
}
elseif (intval($arOrder["DELIVERY_ID"]) > 0)
{
$arDeliveryData = CSaleDelivery::GetByID($arOrder["DELIVERY_ID"]);
echo htmlspecialcharsbx($arDeliveryData["NAME"]);
}
else
echo GetMessage("SOD_NONE");
?>
</span>
</td>
</tr>
示例9: OnSaleBeforeStatusOrder
/**
*
* @param $orderId
* @param $statusID
* @return bool
* @throws Bitrix\Main\DB\Exception
*/
static function OnSaleBeforeStatusOrder($orderId, $statusID)
{
$orderDeliveryTableData = OrderDeliveryTable::getList(array('filter' => array('ORDER_ID' => $orderId)))->fetch();
if (empty($orderDeliveryTableData)) {
return true;
}
$property = unserialize($orderDeliveryTableData['PARAMS']);
if (empty($property) || empty($property['DD_LOCAL_ID'])) {
$property = CSaleOrderPropsValue::GetList(array(), array("ORDER_ID" => $orderId, 'CODE' => 'DDELIVERY_ID'))->Fetch();
if (!$property) {
return true;
} else {
$ddLocalId = $property['VALUE'];
}
} else {
$ddLocalId = $property['DD_LOCAL_ID'];
}
global $APPLICATION;
try {
$DDConfig = CSaleDeliveryHandler::GetBySID('ddelivery')->Fetch();
if ($statusID != $DDConfig['CONFIG']['CONFIG']['SEND_STATUS']['VALUE']) {
return true;
}
$cmsOrder = CSaleOrder::GetByID($orderId);
if ($cmsOrder['DELIVERY_ID'] != 'ddelivery:all') {
return true;
}
$IntegratorShop = self::getShopObject($DDConfig['CONFIG']['CONFIG'], array(), array());
$ddeliveryUI = new DdeliveryUI($IntegratorShop, true);
$order = $ddeliveryUI->initOrder($ddLocalId);
$bxOrder = CSaleBasket::GetList(array(), array('ORDER_ID' => $orderId), false, false, array('PRODUCT_ID', 'PRICE', 'QUANTITY', 'NAME'));
$bxItems = array();
while ($bxItem = $bxOrder->Fetch()) {
$bxItems[] = $bxItem;
}
$order->setProducts($IntegratorShop->itemListToDDCart($bxItems));
$point = $order->getPoint();
$newPoint = false;
if ($order->type == DDeliverySDK::TYPE_SELF) {
$newPoint = $ddeliveryUI->calculateSelfPointPrice($order, $point['_id']);
$newPoint = isset($newPoint[0]) ? $newPoint[0] : false;
} else {
if ($order->type == DDeliverySDK::TYPE_COURIER) {
$resultPoints = $ddeliveryUI->calculateCourierPrices($order);
foreach ($resultPoints as $resultPoint) {
if ($resultPoint['delivery_company'] == $point['delivery_company']) {
$newPoint = $resultPoint;
}
}
}
}
if ($newPoint) {
$order->setPoint($newPoint);
} else {
$APPLICATION->ThrowException(GetMessage('DDELIVERY_SAVE_STATUS_ERROR_ORDER_NOT_LOAD'));
return false;
}
if (empty($order) || $order->ddeliveryID) {
$APPLICATION->ThrowException(GetMessage('DDELIVERY_SAVE_STATUS_ERROR_ORDER_NOT_LOAD'));
return false;
}
$order->localStatus = $statusID;
/**
* @var \DDelivery\Order\DDeliveryOrder $order
*/
$order->shopRefnum = $orderId;
$order->paymentVariant = $cmsOrder['PAY_SYSTEM_ID'];
$ddeliveryOrderID = $ddeliveryUI->sendOrderToDD($order);
$ddeliveryUI->saveFullOrder($order);
if (!$ddeliveryOrderID) {
$APPLICATION->ThrowException(GetMessage('DDELIVERY_SAVE_STATUS_ERROR_NOT_SAVE'));
return false;
}
CSaleOrder::Update($orderId, array("TRACKING_NUMBER" => $ddeliveryOrderID));
return true;
} catch (\DDelivery\DDeliveryException $e) {
$APPLICATION->ThrowException(GetMessage('DDELIVERY_SAVE_STATUS_ERROR_EXCEPTION', array('%1' => $APPLICATION->ConvertCharset($e->getMessage(), 'UTF-8', SITE_CHARSET))));
return false;
}
}
示例10: 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>';
}
}
}
//.........这里部分代码省略.........
示例11: explode
if ($arPaySysAction > 0)
$arPaySysAction["LOGOTIP"] = CFile::GetFileArray($arPaySysAction["LOGOTIP"]);
$arResult["PAY_SYSTEM"] = $arPaySysAction;
}
}
$arResult["ORDER"] = $arOrder;
if (!empty($arResult["ORDER"]["DELIVERY_ID"])){
$arDeliv = CSaleDelivery::GetByID($arResult["ORDER"]["DELIVERY_ID"]);
$arResult["ORDER_INFO"]["DELIVERY"] = $arDeliv;
if (count($arResult["ORDER_INFO"]["DELIVERY"]) == 0 || is_string($arResult["ORDER"]["DELIVERY_ID"]))
{
$sid = explode(":", $arResult["ORDER"]["DELIVERY_ID"]);
$dbDeliv = CSaleDeliveryHandler::GetBySID($sid[0]);
if ($arDeliv = $dbDeliv->GetNext())
{
$arResult["ORDER_INFO"]["DELIVERY"] = $arDeliv;
}
}
}
}
}
}
if(!$isAjaxRequest)
{
CJSCore::Init(array('fx', 'popup', 'window', 'ajax'));
}
示例12: aroundPrice
public function aroundPrice($price)
{
$price = parent::aroundPrice($price);
if ($this->useTaxRate) {
$DDConfig = CSaleDeliveryHandler::GetBySID('ddelivery')->Fetch();
$taxRate = $DDConfig['TAX_RATE'];
$price = round($price * (1 + $taxRate / 100), 2);
if ($DDConfig['PROFILES']['all']['TAX_RATE']) {
$taxRate = $DDConfig['PROFILES']['all']['TAX_RATE'];
$price = round($price * (1 + $taxRate / 100), 2);
}
}
return $price;
}
示例13: FormatOrderDeliverySystemChanged
public static function FormatOrderDeliverySystemChanged($data)
{
$isOrderConverted = \Bitrix\Main\Config\Option::get("main", "~sale_converted_15", 'N');
$info = GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED_INFO");
if (is_array($data)) {
foreach ($data as $param => $value) {
if ($param == "DELIVERY_ID") {
if (!array_key_exists('DELIVERY_NAME', $arData) && strval($arData['DELIVERY_NAME']) != '') {
if (strpos($value, ":") !== false) {
$arId = explode(":", $value);
$dbDelivery = CSaleDeliveryHandler::GetBySID($arId[0]);
$arDelivery = $dbDelivery->Fetch();
$value = "\"" . htmlspecialcharsEx($arDelivery["NAME"]) . "\"";
} elseif (intval($value) > 0) {
if ($isOrderConverted == "Y") {
$arDelivery = \Bitrix\Sale\Delivery\Services\Manager::getById($value);
} else {
$arDelivery = CSaleDelivery::GetByID($value);
}
$value = "\"" . $arDelivery["NAME"] . "\"";
}
} else {
$value = "\"" . $arData['DELIVERY_NAME'] . "\"";
}
} elseif ($param == "DELIVERY_NAME") {
$value = "\"" . $value . "\"";
} else {
continue;
}
$info = str_replace("#" . $param . "#", $value, $info);
}
} else {
$info = $data;
}
return array("NAME" => GetMessage("SOC_ORDER_DELIVERY_SYSTEM_CHANGED"), "INFO" => $info);
}
示例14: isset
if (isset($order['summ']) === false || $order['summ'] <= 0) {
$order['summ'] = $arFields['PRICE'] - $arFields['PRICE_DELIVERY'];
}
$wasCanaceled = $arFields['CANCELED'] == 'Y' ? true : false;
if (isset($optionsDelivTypes[$order['delivery']['code']])) {
$resultDeliveryTypeId = $optionsDelivTypes[$order['delivery']['code']];
} else {
$resultDeliveryTypeId = isset($order['delivery']['service']) && isset($order['delivery']['service']['code']) ?
reset(explode(":", $arFields['DELIVERY_ID'], 1)) :
$arFields['DELIVERY_ID'];
}
if(isset($order['delivery']['service']) && isset($order['delivery']['service']['code'])) {
$deliveryHandler = reset(CSaleDeliveryHandler::GetBySID($resultDeliveryTypeId)->arResult);
if (count($deliveryHandler) > 0 && array_key_exists($order['delivery']['service']['code'], $deliveryHandler['PROFILES'])) {
$resultDeliveryTypeId = $resultDeliveryTypeId . ':' . $order['delivery']['service']['code'];
}
}
// orderUpdate
$arFields = ICrmOrderActions::clearArr(array(
'PRICE_DELIVERY' => $order['delivery']['cost'],
'PRICE' => $order['summ'] + (double) $order['delivery']['cost'],
'DATE_MARKED' => $order['markDatetime'],
'USER_ID' => $userId,
'PAY_SYSTEM_ID' => $optionsPayTypes[$order['paymentType']],
'DELIVERY_ID' => $resultDeliveryTypeId,
'STATUS_ID' => $optionsPayStatuses[$order['status']],
'REASON_CANCELED' => ICrmOrderActions::fromJSON($order['statusComment']),
示例15: define
<?
use DDelivery\DDeliveryUI;
define("STOP_STATISTICS", true);
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$saleModulePermissions = $APPLICATION->GetGroupRight("sale");
if ($saleModulePermissions == "D")
$APPLICATION->AuthForm(GetMessage("ACCESS_DENIED"));
header('Content-Type: text/html; charset=utf-8');
CModule::IncludeModule("sale");
$ddeliveryConfig = CSaleDeliveryHandler::GetBySID('ddelivery')->Fetch();
//$ddOrderId = $_REQUEST['order_id'];
$formData = array('bx_order_id' => $_REQUEST['bx_order_id']);
if(isset($_REQUEST['order_id'])){
$formData['order_id'] = $_REQUEST['order_id'];
}
$dbBasketItems = CSaleBasket::GetList(
array("ID" => "ASC"),
array(
"ORDER_ID" => $_REQUEST['bx_order_id']
),
false,
false,
array('PRODUCT_ID', 'PRICE', 'QUANTITY', 'NAME')