14 while(@ob_end_clean());
26 if (intval($USER_ID) > 0)
28 $rsUser = CUser::GetByID($USER_ID);
29 $arUser = $rsUser->Fetch();
31 if (
count($arUser) > 1)
33 $user =
"<a href='javascript:void(0);' onClick=\"window.open('/bitrix/admin/user_search.php?lang=".LANGUAGE_ID.
"&FN=order_edit_info_form&FC=user_id', '', 'scrollbars=yes,resizable=yes,width=840,height=500,top='+Math.floor((screen.height - 840)/2-14)+',left='+Math.floor((screen.width - 760)/2-5));\">";
34 $user .=
"(".htmlspecialcharsbx($arUser[
"LOGIN"]).
")";
36 if ($arUser[
"NAME"] !=
"")
37 $user .=
" ".htmlspecialcharsbx($arUser[
"NAME"]);
38 if ($arUser[
"LAST_NAME"] !=
"")
39 $user .=
" ".htmlspecialcharsbx($arUser[
"LAST_NAME"]);
41 $user .=
"<span class='pencil'> </span></a>";
51function fGetFormatedProductData($USER_ID, $LID, $arData, $CNT,
$currency,
$type, $crmMode =
false)
56 if (!is_array($arData) ||
count($arData) <= 0)
59 $result =
'<table width="100%">';
60 if (CModule::IncludeModule(
'catalog'))
62 $arProductId =
array();
65 $arSkuParentChildren =
array();
66 $arSkuParentId =
array();
67 $arSkuParent =
array();
69 foreach ($arData as $item)
71 if (!empty($item[
"CURRENCY"]) && $item[
"CURRENCY"] !=
$currency)
73 if (doubleval($item[
"PRICE"]) > 0)
76 if (doubleval($item[
"DISCOUNT_PRICE"]) > 0)
86 if (method_exists($productProvider,
"GetSetItems"))
88 $itemInfo = (isset($item[
'ID']) ?
array(
'BASKET_ID' => $item[
'ID']) :
array());
92 if (is_array($arSets))
94 foreach ($arSets as $arSetData)
96 foreach ($arSetData[
"ITEMS"] as $setItem)
98 $setItem[
"FUSER_ID"] = $item[
"FUSER_ID"];
99 $setItem[
"LID"] = $item[
"LID"];
100 $setItem[
"MODULE"] = $item[
"MODULE"];
101 $setItem[
"PRODUCT_PROVIDER_CLASS"] = $productProvider;
102 $setItem[
"SET_PARENT_ID"] = $item[
"ID"];
104 $arSet[$item[
"PRODUCT_ID"]][] = $setItem;
111 if ($item[
"MODULE"] ==
"catalog")
113 $arProductId[] = $item[
"PRODUCT_ID"];
114 $arDataTab[$item[
"PRODUCT_ID"]] = $item;
119 $arSkuParentChildren[$item[
"PRODUCT_ID"]] = $arParent[
"ID"];
120 $arSkuParentId[$arParent[
"ID"]] = $arParent[
"ID"];
125 if(!empty($arSkuParentId))
127 $res =
CIBlockElement::GetList(
array(),
array(
"ID" => $arSkuParentId),
false,
false,
array(
"ID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"PREVIEW_PICTURE",
"DETAIL_PICTURE",
"NAME",
"DETAIL_PAGE_URL"));
128 while ($arItems =
$res->GetNext())
129 $arSkuParent[$arItems[
"ID"]] = $arItems;
132 if(!empty($arProductId))
134 $arProducts =
array();
135 $dbProduct =
CIBlockElement::GetList(
array(),
array(
"ID" => $arProductId),
false,
false,
array(
'ID',
'IBLOCK_ID',
'IBLOCK_SECTION_ID',
'DETAIL_PICTURE',
'PREVIEW_PICTURE',
'IBLOCK_TYPE_ID'));
136 while($arProduct = $dbProduct->GetNext())
137 $arProducts[] = $arProduct;
139 foreach ($arProducts as $arProduct)
142 $arDataTab[$arProduct[
'ID']][
'IBLOCK_ID'] = $arProduct[
'IBLOCK_ID'];
143 $arDataTab[$arProduct[
'ID']][
'IBLOCK_SECTION_ID'] = $arProduct[
'IBLOCK_SECTION_ID'];
144 $arDataTab[$arProduct[
'ID']][
'DETAIL_PICTURE'] = $arProduct[
'DETAIL_PICTURE'];
145 $arDataTab[$arProduct[
'ID']][
'PREVIEW_PICTURE'] = $arProduct[
'PREVIEW_PICTURE'];
146 $arDataTab[$arProduct[
'ID']][
'IBLOCK_TYPE_ID'] = $arProduct[
'IBLOCK_TYPE_ID'];
147 $arProduct = $arDataTab[$arProduct[
'ID']];
149 if ($arProduct[
"PREVIEW_PICTURE"] ==
"" && $arProduct[
"DETAIL_PICTURE"] ==
"" &&
is_set($arSkuParentChildren[$arProduct[
"PRODUCT_ID"]]))
151 $idTmp = $arSkuParentChildren[$arProduct[
"PRODUCT_ID"]];
152 $arProduct[
"DETAIL_PICTURE"] = $arSkuParent[$idTmp][
"DETAIL_PICTURE"];
153 $arProduct[
"PREVIEW_PICTURE"] = $arSkuParent[$idTmp][
"PREVIEW_PICTURE"];
156 if ($arProduct[
"IBLOCK_ID"] > 0)
159 "find_section_section" => $arProduct[
"IBLOCK_SECTION_ID"],
168 if ($arProduct[
"PREVIEW_PICTURE"] > 0)
169 $imgCode = $arProduct[
"PREVIEW_PICTURE"];
170 elseif ($arProduct[
"DETAIL_PICTURE"] > 0)
171 $imgCode = $arProduct[
"DETAIL_PICTURE"];
178 if (is_array($arImgProduct))
180 $imgProduct =
'<a href="'.$arProduct[
"EDIT_PAGE_URL"].
'" target="_blank"><img src="'.$arImgProduct[
"src"].
'" alt="" title="'.$arProduct[
"NAME"].
'" ></a>';
184 $imgProduct =
'<div class="no_foto">'.GetMessage(
'SOD_NO_FOTO').
"</div>";
186 $result .=
'<tr><td class="tab_img">'.$imgProduct.
'</td><td class="tab_text">
187 <div class="order_name"><a href="'.$arProduct[
"EDIT_PAGE_URL"].
'" target="_blank" title="'.$arProduct[
"NAME"].
'">'.$arProduct[
"NAME"].
'</a></div>
190 if (!empty($arSet) && array_key_exists($arProduct[
"PRODUCT_ID"], $arSet))
194 <a id="set_toggle_link_b'.$arProduct[
"ID"].
'"
195 href="javascript:void(0);"
196 class="dashed-link show-set-link"
198 onclick="fToggleSetItems(\'b'.$arProduct[
"ID"].
'\');
">'.GetMessage("SOD_SHOW_SET
").'</a>
204 $arResult = CSaleProduct::GetProductSku($USER_ID, $LID, $arProduct["PRODUCT_ID
"], $arProduct["NAME
"], '', $arProduct);
206 $arResult["POPUP_MESSAGE
"] = array(
207 "PRODUCT_ADD
" => GetMessage('SOD_POPUP_TO_BASKET'),
208 "PRODUCT_NOT_ADD
" => GetMessage('SOD_POPUP_TO_BASKET_NOT'),
209 "PRODUCT_PRICE_FROM
" => GetMessage('SOD_POPUP_FROM')
214 if (!empty($arResult["SKU_ELEMENTS
"]))
216 $result .= '<a href="javascript:void(0);
" class="get_new_order
" onclick="fAddToBasketMoreProductSku(
'.CUtil::PhpToJSObject($arResult['SKU_ELEMENTS
']).',
'.CUtil::PhpToJSObject($arResult['SKU_PROPERTIES
']).', \
'\',
'.CUtil::PhpToJSObject($arResult["POPUP_MESSAGE"]).');
"><span></span>'.GetMessage('SOD_SUBTAB_ADD_ORDER').'</a>';
220 $cntProd = (floatval($arProduct["QUANTITY
"]) > 0) ? floatval($arProduct["QUANTITY
"]) : 1;
221 $url = "/bitrix/admin/sale_order_new.php?
lang=
".LANGUAGE_ID."&user_id=
".$USER_ID."&LID=
".$LID."&product[
".$arProduct["PRODUCT_ID
"]."]=
".$cntProd;
222 $result .= "<a href=\
"".$url.
"\" target=\"_blank\" class=\"get_new_order\"><span></span>".
GetMessage(
'SOD_SUBTAB_ADD_ORDER').
"</a>";
229 if (!empty($arSet) && array_key_exists($arProduct[
"PRODUCT_ID"], $arSet))
231 foreach ($arSet[$arProduct[
"PRODUCT_ID"]] as $set)
234 "find_section_section" => $set[
"IBLOCK_SECTION_ID"],
238 if ($set[
"PREVIEW_PICTURE"] > 0)
239 $imgCode = $set[
"PREVIEW_PICTURE"];
240 elseif ($set[
"DETAIL_PICTURE"] > 0)
241 $imgCode = $set[
"DETAIL_PICTURE"];
248 if (is_array($arImgProduct))
250 $img =
'<a href="'.$editUrl.
'" target="_blank"><img src="'.$arImgProduct[
"src"].
'" alt="" title="'.$set[
"NAME"].
'" ></a>';
254 $img =
'<div class="no_foto">'.GetMessage(
'SOD_NO_FOTO').
"</div>";
257 <tr style="display:none" class="set_item_b'.$arProduct[
"ID"].
'">
258 <td class="tab_img">'.$img.
'</td>
259 <td class="tab_text">
260 <div class="order_name">
261 <a href="'.$editUrl.
'" style="font-style:italic" target="_blank" title="'.$set[
"NAME"].
'">'.$set[
"NAME"].
'</a>
272 $result .=
'<tr><td colspan="2" align="right" class="more_product">';
274 $result .=
"<a href='javascript:void(0);' onClick=\"fGetMoreProduct('".$type.
"');\" class=\"get_more\">".
GetMessage(
'SOD_SUBTAB_MORE').
"<span></span></a>";
286 $errorMessageTmp =
"";
288 $STATUS_ID = trim($STATUS_ID);
289 if ($STATUS_ID ==
'')
290 $errorMessageTmp .=
GetMessage(
"ERROR_NO_STATUS").
". ";
292 if (
'' == $errorMessageTmp)
295 $errorMessageTmp .=
GetMessage(
"SOD_NO_PERMS2STATUS").
". ";
298 if (
'' == $errorMessageTmp)
304 if ($ex->GetID() !=
"ALREADY_FLAG")
305 $errorMessageTmp .= $ex->GetString();
308 $errorMessageTmp .=
GetMessage(
"ERROR_CHANGE_STATUS").
". ";
313 'STATUS_ERR' =>
false,
314 'STATUS_ERR_MESS' =>
'',
318 array(
"ID" =>
"DESC"),
322 array(
"DATE_STATUS",
"EMP_STATUS_ID",
"STATUS_ID")
324 if ($arOrder = $dbOrder->Fetch())
326 $arResult[
"DATE_STATUS"] = $arOrder[
"DATE_STATUS"];
327 if (!$crmMode && (
int)$arOrder[
"EMP_STATUS_ID"] > 0)
330 $arResult[
"STATUS_ID"] = $arOrder[
"STATUS_ID"];
332 if (
'' != $errorMessageTmp)
335 $arResult[
'STATUS_ERR_MESS'] = $errorMessageTmp;
347 $disableFiles = (isset($crmMode) && $crmMode);
349 if (CModule::IncludeModule(
'fileman'))
351 if (!is_array($values) || empty($values))
352 $values =
array(
"n0" => 0);
354 if ($property_fields[
"MULTIPLE"] ==
"N")
359 $file_id =
$val[
"VALUE"];
363 $res = CFileInput::Show(
371 "IMAGE_POPUP" =>
"Y",
372 "MAX_SIZE" =>
array(
"W" => 200,
"H" => 170),
375 'upload' => !$disableFiles,
376 'del' => !$disableFiles,
378 'file_dialog' =>
false,
380 'description' =>
false
401 "IMAGE_POPUP" =>
"Y",
402 "MAX_SIZE" =>
array(
"W" => 200,
"H" => 170),
404 'upload' => !$disableFiles,
405 'del' => !$disableFiles,
407 'file_dialog' =>
false,
409 'description' =>
false
425 array(
"PERSON_TYPE_ID" => $PERSON_TYPE_ID,
"ACTIVE" =>
"Y"),
426 array(
"IS_PHONE",
"COUNT" =>
"ID"),
438 array(
"PERSON_TYPE_ID" => $PERSON_TYPE_ID,
"ACTIVE" =>
"Y"),
439 array(
"IS_PAYER",
"COUNT" =>
"ID"),
451 array(
"PERSON_TYPE_ID" => $PERSON_TYPE_ID,
"ACTIVE" =>
"Y"),
452 array(
"IS_EMAIL",
"COUNT" =>
"ID"),
470 global $locationZipID, $locationID, $DELIVERY_LOCATION, $DELIVERY_LOCATION_ZIP;
471 $resultHtml =
"<script>locationZipID = 0;locationID = 0;</script><table width=\"100%\" id=\"order_type_props\" class=\"edit-table\">";
474 $personTypeSelect =
"<select name='buyer_type_id' id='buyer_type_id' OnChange='fBuyerChangeType(this);' >";
476 while ($arPersonType = $dbPersonType->GetNext())
478 if (!in_array($LID, $arPersonType[
"LIDS"]))
481 if (!isset($PERSON_TYPE_ID) OR $PERSON_TYPE_ID ==
"")
482 $PERSON_TYPE_ID = $arPersonType[
"ID"];
485 if (intval($arPersonType[
"ID"]) == intval($PERSON_TYPE_ID))
486 $class =
" selected";
488 $personTypeSelect .=
"<option value=\"".$arPersonType[
"ID"].
"\" ".$class.
">".$arPersonType[
"NAME"].
" [".$arPersonType[
"ID"].
"]</option>";
490 $personTypeSelect .=
"</select>";
493 $userDisplay =
"none";
503 $arOrder = $dbOrder->Fetch();
504 $userComment = $arOrder[
"USER_DESCRIPTION"];
505 $userDisplay =
"table-row";
508 if ($formVarsSubmit &&
$_REQUEST[
"btnTypeBuyer"] ==
"btnBuyerNew")
509 $userDisplay =
"none";
510 elseif ($formVarsSubmit &&
$_REQUEST[
"btnTypeBuyer"] ==
"btnBuyerExist")
511 $userDisplay =
"table-row";
513 $resultHtml .=
"<tr id=\"btnBuyerExistField\" style=\"display:".$userDisplay.
"\">
514 <td class=\"adm-detail-content-cell-l\" width=\"40%\">".
GetMessage(
"NEWO_BUYER").
":</td>
515 <td class=\"adm-detail-content-cell-r\" width=\"60%\"><div id=\"user_name\">".
fGetUserName($USER_ID).
"</div></td></tr>";
517 $resultHtml .=
"<tr class=\"adm-detail-required-field\">
518 <td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage(
"SOE_PERSON_TYPE").
":</td>
519 <td class=\"adm-detail-content-cell-r\" width=\"60%\">".$personTypeSelect.
"</td>
522 $bShowTrProfile =
"none";
523 if ($formVarsSubmit && $_POST[
"btnTypeBuyer"] ==
"btnBuyerExist")
524 $bShowTrProfile =
"table-row";
526 $resultHtml .=
"<tr id=\"buyer_profile_display\" style=\"display:".$bShowTrProfile.
"\" class=\"adm-detail-required-field\">
527 <td class=\"adm-detail-content-cell-l\">".
GetMessage(
"NEWO_BUYER_PROFILE").
":</td>
528 <td class=\"adm-detail-content-cell-r\">
529 <div id=\"buyer_profile_select\">";
531 if ($formVarsSubmit && $_POST[
"btnTypeBuyer"] ==
"btnBuyerExist")
533 $resultHtml .=
fUserProfile(intval($_POST[
"user_id"]), intval($_POST[
"buyer_type_id"]), $default =
'');
536 $resultHtml .=
"</div></td>
542 $resultHtml .=
"<tr id=\"btnBuyerNewField\">";
543 if (
count($arCountProps) < 3)
545 $resultHtml .=
"<td colspan=2>
546 <table width=\"100%\" class=\"edit-table\" >";
547 if (intval($arCountProps[
"IS_EMAIL"]) <= 0)
548 $resultHtml .=
"<tr class=\"adm-detail-required-field\">
549 <td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage(
"NEWO_BUYER_REG_MAIL").
"</td>
550 <td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_EMAIL\" size=\"30\" value=\"".
htmlspecialcharsbx(trim(
$_REQUEST[
"NEW_BUYER_EMAIL"])).
"\" tabindex=\"1\" /></td>
552 if (intval($arCountProps[
"IS_PAYER"]) <= 0)
553 $resultHtml .=
"<tr class=\"adm-detail-required-field\">
554 <td class=\"adm-detail-content-cell-l\">".GetMessage(
"NEWO_BUYER_REG_LASTNAME").
"</td>
555 <td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_LAST_NAME\" size=\"30\" value=\"".
htmlspecialcharsbx(trim(
$_REQUEST[
"NEW_BUYER_LAST_NAME"])).
"\" tabindex=\"3\" /></td>
557 <tr class=\"adm-detail-required-field\">
558 <td class=\"adm-detail-content-cell-l\">".
GetMessage(
"NEWO_BUYER_REG_NAME").
"</td>
559 <td class=\"adm-detail-content-cell-r\"><input type=\"text\" name=\"NEW_BUYER_NAME\" size=\"30\" value=\"".
htmlspecialcharsbx(trim(
$_REQUEST[
"NEW_BUYER_NAME"])).
"\" tabindex=\"2\" /></td>
561 $resultHtml .=
"</table>
564 $resultHtml .=
"</tr>";
567 $arPropertiesList =
array();
569 array(
"GROUP_SORT" =>
"ASC",
"PROPS_GROUP_ID" =>
"ASC",
"SORT" =>
"ASC",
"NAME" =>
"ASC"),
570 array(
"PERSON_TYPE_ID" => $PERSON_TYPE_ID,
"ACTIVE" =>
"Y",
"RELATED" =>
false),
575 while($property = $dbProperties->GetNext())
577 $arPropertiesList[$property[
'ID']] = $property;
581 $arPropValues =
array();
584 $locationIndexForm =
"";
585 foreach ($_POST as
$key => $value)
587 if (mb_substr(
$key, 0, mb_strlen(
"CITY_ORDER_PROP_")) ==
"CITY_ORDER_PROP_")
590 $locationIndexForm = intval(mb_substr(
$key, mb_strlen(
"CITY_ORDER_PROP_")));
592 if (mb_substr(
$key, 0, mb_strlen(
"ORDER_PROP_")) ==
"ORDER_PROP_")
594 if ($locationIndexForm != intval(mb_substr(
$key, mb_strlen(
"ORDER_PROP_"))) && !is_array($value))
598 $userComment = $_POST[
"USER_DESCRIPTION"];
604 $arPropValues = $userProfile[$PERSON_TYPE_ID][
"VALUES"];
613 array(
"ID",
"ORDER_PROPS_ID",
"NAME",
"VALUE",
"CODE")
615 while ($arPropValuesList = $dbPropValuesList->Fetch())
617 $arPropValues[intval($arPropValuesList[
"ORDER_PROPS_ID"])] =
htmlspecialcharsbx($arPropValuesList[
"VALUE"]);
621 $location2townFldMap =
array();
622 $arDisableFieldForLocation =
array();
626 array(
"PERSON_TYPE_ID" => $PERSON_TYPE_ID,
"ACTIVE" =>
"Y",
">INPUT_FIELD_LOCATION" => 0),
629 array(
"INPUT_FIELD_LOCATION")
640 while ($arOrderProps = $dbOrderProps->Fetch())
642 if ($arOrderProps[
"TYPE"] ==
"LOCATION" && $arOrderProps[
"ACTIVE"] ==
"Y" && $arOrderProps[
"IS_LOCATION"] ==
"Y")
644 if (in_array($arOrderProps[
"INPUT_FIELD_LOCATION"], $arDisableFieldForLocation))
649 unset($arDisableFieldForLocation[$arOrderProps[
"INPUT_FIELD_LOCATION"]]);
655 unset($arDisableFieldForLocation[$arOrderProps[
"INPUT_FIELD_LOCATION"]]);
659 $location2townFldMap[$arOrderProps[
'ORDER_PROPS_ID']] = $arOrderProps[
'INPUT_FIELD_LOCATION'];
664 $propertyGroupID = -1;
668 if (intval(
$arProperties[
"PROPS_GROUP_ID"]) != $propertyGroupID)
670 $resultHtml .=
"<tr><td colspan=\"2\" style=\"text-align:center;font-weight:bold;font-size:14px;color:rgb(75, 98, 103);\" >".htmlspecialcharsEx(
$arProperties[
"GROUP_NAME"]).
"\n</td>\n</tr>";
674 if (intval(
$arProperties[
"PROPS_GROUP_ID"]) != $propertyGroupID)
681 $adit =
" class=\"adm-detail-required-field\"";
682 $requiredField =
" class=\"adm-detail-content-cell-l\"";
688 if (in_array(
$arProperties[
"ID"], $arDisableFieldForLocation))
689 $resultHtml .=
"<tr style=\"display:none;\" id=\"town_location_".$arProperties[
"ID"].
"\"".$adit.
">\n";
691 $resultHtml .=
"<tr id=\"town_location_".$arProperties[
"ID"].
"\"".$adit.($isTownProperty ?
" class=\"-bx-order-property-city\"" :
'').
">\n";
694 $resultHtml .=
"<td valign=\"top\" class=\"adm-detail-content-cell-l\" width=\"40%\">\n";
696 $resultHtml .=
"<td align=\"right\" width=\"40%\" ".$requiredField.
">\n";
704 if(
$arProperties[
"DEFAULT_VALUE"] ==
'' && intval($USER_ID) > 0)
706 $rsUser = CUser::GetByID($USER_ID);
707 if ($arUser = $rsUser->Fetch())
713 if ($arUser[
"LAST_NAME"] <>
'')
715 if ($arUser[
"NAME"] <>
'')
717 if ($arUser[
"SECOND_NAME"] <>
'' AND $arUser[
"NAME"] <>
'')
718 $arProperties[
"DEFAULT_VALUE"] .=
" ".$arUser[
"SECOND_NAME"];
724 $resultHtml .=
"<td class=\"adm-detail-content-cell-r\" width=\"60%\">";
728 $resultHtml .=
'<input type="checkbox" class="inputcheckbox" ';
729 $resultHtml .=
'name="ORDER_PROP_'.$arProperties[
"ID"].
'" value="Y"';
730 $resultHtml .=
'id="ORDER_PROP_'.$arProperties[
"ID"].
'" ';
731 if ($curVal==
"Y" || !isset($curVal) &&
$arProperties[
"DEFAULT_VALUE"]==
"Y")
732 $resultHtml .=
" checked";
740 $DELIVERY_LOCATION_ZIP = $curVal;
741 $resultHtml .=
'<script> locationZipID = \''.$arProperties[
"ID"].
'\';</script>
';
742 $locationZipID = ((isset($curVal)) ? htmlspecialcharsEx($curVal) : htmlspecialcharsEx($arProperties["DEFAULT_VALUE"]));
745 if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
747 $resultHtml .= '<div
id=
"BREAK_NAME"';
748 if ($ORDER_ID > 0 || ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist"))
749 $resultHtml .= ' style=
"display:none"';
752 $BREAK_LAST_NAME_TMP = GetMessage('NEWO_BREAK_LAST_NAME
');
753 if (isset($_REQUEST["BREAK_LAST_NAME"]) && $_REQUEST["BREAK_LAST_NAME"] <> '')
754 $BREAK_LAST_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_LAST_NAME"]));
756 $NEWO_BREAK_NAME_TMP = GetMessage('NEWO_BREAK_NAME
');
757 if (isset($_REQUEST["BREAK_NAME"]) && $_REQUEST["BREAK_NAME"] <> '')
758 $NEWO_BREAK_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_NAME"]));
760 $BREAK_SECOND_NAME_TMP = GetMessage('NEWO_BREAK_SECOND_NAME
');
761 if (isset($_REQUEST["BREAK_SECOND_NAME"]) && $_REQUEST["BREAK_SECOND_NAME"] <> '')
762 $BREAK_SECOND_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_SECOND_NAME"]));
764 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
765 '<input type=
"text" name=
"BREAK_LAST_NAME" id=
"BREAK_LAST_NAME" size=
"30" '.
766 'value=
"'.$BREAK_LAST_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_LAST_NAME')).'" '.
767 'onblur=
"if (this.value==\'\'){ BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
768 'onfocus=
"if (this.value==\'\') { BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
771 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
772 '<input type=
"text" name=
"BREAK_NAME" id=
"BREAK_NAME_BUYER" size=
"30" '.
773 'value=
"'.$NEWO_BREAK_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_NAME')).'" '.
774 'onblur=
"if (this.value==\'\'){ BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
775 'onfocus=
"if (this.value==\'\') { BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
777 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
778 '<input type=
"text" name=
"BREAK_SECOND_NAME" id=
"BREAK_SECOND_NAME" size=
"30" '.
779 'value=
"'.$BREAK_SECOND_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_SECOND_NAME')).'" '.
780 'onblur=
"if (this.value==\'\'){BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
781 'onfocus=
"if (this.value==\'\') {BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
783 $resultHtml .= '</div>
';
786 $resultHtml .= '<div
id=
"NO_BREAK_NAME"';
788 $tmpNone = ' style=
"display:none"';
789 if ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist")
790 $tmpNone = ' style=
"display:block"';
791 $resultHtml .= $tmpNone.'>
';
794 $resultHtml .= '<input type=
"text" maxlength=
"250" ';
795 $resultHtml .= 'size=
"30" ';
796 $resultHtml .= 'value=
"'.((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE
"]).'" ';
797 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
798 $resultHtml .= ($arProperties["IS_ZIP"] == "Y" ? 'class=
"-bx-property-is-zip" ' : '');
799 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" '.$change.'>
';
801 if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
802 $resultHtml .= '</div>
';
804 elseif ($arProperties["TYPE"] == "SELECT")
806 $size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;
808 $resultHtml .= '<
select name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
809 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
810 $resultHtml .= 'size=
'.$size.' ';
811 $resultHtml .= 'class=
"typeselect">
';
812 $dbVariants = CSaleOrderPropsVariant::GetList(
813 array("SORT" => "ASC"),
814 array("ORDER_PROPS_ID" => $arProperties["ID"]),
819 while ($arVariants = $dbVariants->Fetch())
821 $resultHtml .= '<option value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
822 if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
823 $resultHtml .= " selected";
824 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'</option>
';
826 $resultHtml .= '</
select>
';
828 elseif ($arProperties["TYPE"] == "MULTISELECT")
830 $size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;
832 $resultHtml .= '<
select multiple name=
"ORDER_PROP_'.$arProperties["ID
"].'[]" ';
833 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
834 $resultHtml .= 'size=
'.$size.' ';
835 $resultHtml .= 'class=
"typeselect" type=
"multyselect">
';
837 if (!is_array($curVal))
839 if ($curVal <> '' OR $ORDER_ID != "")
840 $curVal = explode(",", $curVal);
842 $curVal = explode(",", $arProperties["DEFAULT_VALUE"]);
845 $countCurVal = count($curVal);
846 for ($i = 0; $i < $countCurVal; $i++)
847 $arCurVal[$i] = trim($curVal[$i]);
852 $dbVariants = CSaleOrderPropsVariant::GetList(
853 array("SORT" => "ASC"),
854 array("ORDER_PROPS_ID" => $arProperties["ID"]),
859 while ($arVariants = $dbVariants->Fetch())
861 $resultHtml .= '<option value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
862 if (in_array($arVariants["VALUE"], $arCurVal))
863 $resultHtml .= " selected";
864 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'</option>
';
866 $resultHtml .= '</
select>
';
868 elseif ($arProperties["TYPE"] == "TEXTAREA")
870 $resultHtml .= '<textarea
';
871 $resultHtml .= 'rows=
"4" ';
872 $resultHtml .= 'cols=
"40" ';
873 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
874 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" type=
"textarea">
';
875 $resultHtml .= ((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE"]);
876 $resultHtml .= '</textarea>
';
878 elseif ($arProperties["TYPE"] == "LOCATION")
880 $DELIVERY_LOCATION = $arPropValues[intval($arProperties["ID"])];
882 $locationID = $curVal;
887 <?if($arProperties['IS_LOCATION
'] == 'Y
'):?>
890 $funcId = 'changeLocationCity_
'.$arProperties['ID
'];
894 window['<?=$funcId?>
'] = function(node, info){
895 fChangeLocationCity(node, info, <?=intval($location2townFldMap[$arProperties['ID
']])?>)
897 window.orderNewLocationPropId = <?=intval($arProperties['ID
'])?>;
903 CSaleLocation::proxySaleAjaxLocationsComponent(
907 "COUNTRY_INPUT_NAME" => "ORDER_PROP_".$arProperties["ID"],
908 "REGION_INPUT_NAME" => "REGION_ORDER_PROP_".$arProperties["ID"],
909 "CITY_INPUT_NAME" => "CITY_ORDER_PROP_".$arProperties["ID"],
910 "CITY_OUT_LOCATION" => "Y",
911 "ALLOW_EMPTY_CITY" => "Y",
912 "LOCATION_VALUE" => $curVal,
914 "ONCITYCHANGE" => "fChangeLocationCity",
918 "JS_CALLBACK" => $arProperties['IS_LOCATION
'] == 'Y
' ? $funcId : false,
921 "SHOW_DEFAULT_LOCATIONS" => 'Y
',
922 "JS_CONTROL_GLOBAL_ID" => intval($arProperties["ID"]),
924 "PRECACHE_LAST_LEVEL" => "Y",
925 "PRESELECT_TREE_TRUNK" => "Y"
929 'location-selector-wrapper prop-
'.intval($arProperties["ID"])
932 $tmpLocation = ob_get_contents();
935 $resultHtml .= '<script>var locationID = \
''.$arProperties[
"ID"].
'\';</script>
';
936 $resultHtml .= $tmpLocation;
938 elseif ($arProperties["TYPE"] == "RADIO")
940 $dbVariants = CSaleOrderPropsVariant::GetList(
941 array("SORT" => "ASC"),
942 array("ORDER_PROPS_ID" => $arProperties["ID"]),
947 $resultHtml .= '<div
id=
"ORDER_PROP_'.$arProperties["ID
"].'" type=
"radio">
';// type="radio"
948 while ($arVariants = $dbVariants->Fetch())
950 $resultHtml .= '<input type=
"radio" class=
"inputradio" ';
951 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
952 $resultHtml .= 'value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
953 if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
954 $resultHtml .= " checked";
955 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'<br>
';
957 $resultHtml .= '</div>
';
959 elseif ($arProperties["TYPE"] == "FILE")
962 $arTmpValues = array();
963 if (isset($arPropValues[$arProperties["ID"]]))
965 $arTmpValues = explode(", ", $arPropValues[$arProperties["ID"]]);
966 foreach ($arTmpValues as $key => $value)
967 $arValues[$value] = $value;
970 $resultHtml .= fShowFilePropertyField("ORDER_PROP_".$arProperties["ID"], $arProperties, $arValues, $arProperties["SIZE1"], $formVarsSubmit);
973 if ($arProperties["DESCRIPTION"] <> '')
975 $resultHtml .= "<br><small>".htmlspecialcharsEx($arProperties["DESCRIPTION"])."</small>";
977 $resultHtml .= "\n</td>\n</tr>";
981 $resultHtml .= "<tr>\n<td valign=\"top\" class=\"adm-detail-content-cell-l\">".GetMessage("SOE_BUYER_COMMENT").":
983 <td class=\"adm-detail-content-cell-r\">
984 <textarea name=\"USER_DESCRIPTION\" rows=\"4\" cols=\"40\">".htmlspecialcharsbx($userComment)."</textarea>
988 $resultHtml .= "</table>";
993 * Returns HTML controls of the order properties
995 * Currently is used to show order properties related to payment/delivery systems in the order_new form
997function getOrderPropertiesHTML($arOrderProps, $arPropValues = array(), $LID = '', $USER_ID = '', $ORDER_ID = 0, $formVarsSubmit = false)
999 $propertyGroupID = -1;
1000 $arDisableFieldForLocation = array();
1001 $resultHtml = "<table id=\"order_related_props\">";
1003 // get order properties values
1004 if ($formVarsSubmit)
1006 $locationIndexForm = "";
1007 foreach ($_POST as $key => $value)
1009 if (mb_substr($key, 0, mb_strlen("CITY_ORDER_PROP_")) == "CITY_ORDER_PROP_")
1011 $arPropValues[intval(mb_substr($key, mb_strlen("CITY_ORDER_PROP_")))] = htmlspecialcharsbx($value);
1012 $locationIndexForm = intval(mb_substr($key, mb_strlen("CITY_ORDER_PROP_")));
1014 if (mb_substr($key, 0, mb_strlen("ORDER_PROP_")) == "ORDER_PROP_")
1016 if ($locationIndexForm != intval(mb_substr($key, mb_strlen("ORDER_PROP_"))))
1018 if (!is_array($value))
1019 $arPropValues[intval(mb_substr($key, mb_strlen("ORDER_PROP_")))] = htmlspecialcharsbx($value);
1022 $arValues = array();
1023 foreach ($value as $k => $v)
1024 $arValues[$key] = htmlspecialcharsbx($v);
1026 $arPropValues[intval(mb_substr($key, mb_strlen("ORDER_PROP_")))] = $arValues;
1033 // iterate over list of properties
1034 if (is_array($arOrderProps))
1036 foreach ($arOrderProps as $arProperties)
1038 if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID)
1040 $resultHtml .= "<tr><td colspan=\"2\" style=\"text-align:center;font-weight:bold;font-size:14px;color:rgb(75, 98, 103);\" >".htmlspecialcharsEx($arProperties["GROUP_NAME"])."\n</td>\n</tr>";
1041 $propertyGroupID = intval($arProperties["PROPS_GROUP_ID"]);
1044 if (intval($arProperties["PROPS_GROUP_ID"]) != $propertyGroupID)
1045 $propertyGroupID = intval($arProperties["PROPS_GROUP_ID"]);
1048 $requiredField = "";
1049 if ($arProperties["REQUIED"] == "Y" || $arProperties["IS_PROFILE_NAME"] == "Y" || $arProperties["IS_LOCATION"] == "Y" || $arProperties["IS_LOCATION4TAX"] == "Y" || $arProperties["IS_PAYER"] == "Y" || $arProperties["IS_ZIP"] == "Y")
1051 $adit = " class=\"adm-detail-required-field\"";
1052 $requiredField = " class=\"adm-detail-content-cell-l\"";
1055 //delete town from location
1056 if (in_array($arProperties["ID"], $arDisableFieldForLocation))
1057 $resultHtml .= "<tr style=\"display:none;\" id=\"town_location_".$arProperties["ID"]."\"".$adit.">\n";
1059 $resultHtml .= "<tr id=\"town_location_".$arProperties["ID"]."\"".$adit.">\n";
1061 if(($arProperties["TYPE"] == "MULTISELECT" || $arProperties["TYPE"] == "TEXTAREA") || ($ORDER_ID <= 0 && $arProperties["IS_PROFILE_NAME"] == "Y") )
1062 $resultHtml .= "<td valign=\"top\" class=\"adm-detail-content-cell-l\" width=\"40%\">\n";
1064 $resultHtml .= "<td align=\"right\" width=\"40%\" ".$requiredField.">\n";
1066 $resultHtml .= $arProperties["NAME"].":</td>";
1068 $curVal = $arPropValues[intval($arProperties["ID"])];
1070 if($arProperties["IS_EMAIL"] == "Y" || $arProperties["IS_PAYER"] == "Y")
1072 if($arProperties["DEFAULT_VALUE"] == '' && intval($USER_ID) > 0)
1074 $rsUser = CUser::GetByID($USER_ID);
1075 if ($arUser = $rsUser->Fetch())
1077 if($arProperties["IS_EMAIL"] == "Y")
1078 $arProperties["DEFAULT_VALUE"] = $arUser["EMAIL"];
1081 if ($arUser["LAST_NAME"] <> '')
1082 $arProperties["DEFAULT_VALUE"] .= $arUser["LAST_NAME"];
1083 if ($arUser["NAME"] <> '')
1084 $arProperties["DEFAULT_VALUE"] .= " ".$arUser["NAME"];
1085 if ($arUser["SECOND_NAME"] <> '' AND $arUser["NAME"] <> '')
1086 $arProperties["DEFAULT_VALUE"] .= " ".$arUser["SECOND_NAME"];
1092 $resultHtml .= "<td class=\"adm-detail-content-cell-r\" width=\"60%\">";
1094 if ($arProperties["TYPE"] == "CHECKBOX")
1096 $resultHtml .= '<input type=
"checkbox" class=
"inputcheckbox" ';
1097 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" value=
"Y"';
1098 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1099 if ($curVal=="Y" || !isset($curVal) && $arProperties["DEFAULT_VALUE"]=="Y")
1100 $resultHtml .= " checked";
1103 elseif ($arProperties["TYPE"] == "TEXT")
1106 if ($arProperties["IS_ZIP"] == "Y")
1108 $DELIVERY_LOCATION_ZIP = $curVal;
1109 $resultHtml .= '<script> locationZipID = \
''.$arProperties[
"ID"].
'\';</script>
';
1110 $locationZipID = ((isset($curVal)) ? htmlspecialcharsEx($curVal) : htmlspecialcharsEx($arProperties["DEFAULT_VALUE"]));
1113 if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
1115 $resultHtml .= '<div
id=
"BREAK_NAME"';
1116 if ($ORDER_ID > 0 || ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist"))
1117 $resultHtml .= ' style=
"display:none"';
1120 $BREAK_LAST_NAME_TMP = GetMessage('NEWO_BREAK_LAST_NAME
');
1121 if (isset($_REQUEST["BREAK_LAST_NAME"]) && $_REQUEST["BREAK_LAST_NAME"] <> '')
1122 $BREAK_LAST_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_LAST_NAME"]));
1124 $NEWO_BREAK_NAME_TMP = GetMessage('NEWO_BREAK_NAME
');
1125 if (isset($_REQUEST["BREAK_NAME"]) && $_REQUEST["BREAK_NAME"] <> '')
1126 $NEWO_BREAK_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_NAME"]));
1128 $BREAK_SECOND_NAME_TMP = GetMessage('NEWO_BREAK_SECOND_NAME
');
1129 if (isset($_REQUEST["BREAK_SECOND_NAME"]) && $_REQUEST["BREAK_SECOND_NAME"] <> '')
1130 $BREAK_SECOND_NAME_TMP = htmlspecialcharsbx(trim($_REQUEST["BREAK_SECOND_NAME"]));
1132 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
1133 '<input type=
"text" name=
"BREAK_LAST_NAME" id=
"BREAK_LAST_NAME" size=
"30" '.
1134 'value=
"'.$BREAK_LAST_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_LAST_NAME')).'" '.
1135 'onblur=
"if (this.value==\'\'){ BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
1136 'onfocus=
"if (this.value==\'\') { BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
1138 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
1139 '<input type=
"text" name=
"BREAK_NAME" id=
"BREAK_NAME_BUYER" size=
"30" '.
1140 'value=
"'.$NEWO_BREAK_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_NAME')).'" '.
1141 'onblur=
"if (this.value==\'\'){ BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
1142 'onfocus=
"if (this.value==\'\') { BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
1144 $resultHtml .= '<div
class=
"fio newo_break_active">
'.
1145 '<input type=
"text" name=
"BREAK_SECOND_NAME" id=
"BREAK_SECOND_NAME" size=
"30" '.
1146 'value=
"'.$BREAK_SECOND_NAME_TMP.'" placeholder=
"'.htmlspecialcharsbx(GetMessage('NEWO_BREAK_SECOND_NAME')).'" '.
1147 'onblur=
"if (this.value==\'\'){ BX.addClass(this.parentNode, \'newo_break_active\'); }" '.
1148 'onfocus=
"if (this.value==\'\') { BX.removeClass(this.parentNode, \'newo_break_active\'); }">
'.
1150 $resultHtml .= '</div>
';
1153 $resultHtml .= '<div
id=
"NO_BREAK_NAME"';
1155 $tmpNone = ' style=
"display:none"';
1156 if ($formVarsSubmit && $_REQUEST["btnTypeBuyer"] == "btnBuyerExist")
1157 $tmpNone = ' style=
"display:block"';
1158 $resultHtml .= $tmpNone.'>
';
1161 $resultHtml .= '<input type=
"text" maxlength=
"250" ';
1162 $resultHtml .= 'size=
"30" ';
1163 $resultHtml .= 'value=
"'.((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE
"]).'" ';
1164 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1165 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" '.$change.'>
';
1167 if ($arProperties["IS_PAYER"] == "Y" && intval($USER_ID) <= 0)
1168 $resultHtml .= '</div>
';
1170 elseif ($arProperties["TYPE"] == "SELECT")
1172 $size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;
1174 $resultHtml .= '<
select name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1175 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1176 $resultHtml .= 'size=
'.$size.' ';
1177 $resultHtml .= 'class=
"typeselect">
';
1178 $dbVariants = CSaleOrderPropsVariant::GetList(
1179 array("SORT" => "ASC"),
1180 array("ORDER_PROPS_ID" => $arProperties["ID"]),
1185 while ($arVariants = $dbVariants->Fetch())
1187 $resultHtml .= '<option value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
1188 if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
1189 $resultHtml .= " selected";
1190 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'</option>
';
1192 $resultHtml .= '</
select>
';
1194 elseif ($arProperties["TYPE"] == "MULTISELECT")
1196 $size = (intval($arProperties["SIZE1"]) > 0) ? intval($arProperties["SIZE1"]) : 5;
1198 $resultHtml .= '<
select multiple name=
"ORDER_PROP_'.$arProperties["ID
"].'[]" ';
1199 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1200 $resultHtml .= 'size=
'.$size.' ';
1201 $resultHtml .= 'class=
"typeselect" type=
"multyselect">
';
1203 if (!is_array($curVal))
1205 if ($curVal <> '' OR $ORDER_ID != "")
1206 $curVal = explode(",", $curVal);
1208 $curVal = explode(",", $arProperties["DEFAULT_VALUE"]);
1210 $arCurVal = array();
1211 $countCurVal = count($curVal);
1212 for ($i = 0; $i < $countCurVal; $i++)
1213 $arCurVal[$i] = trim($curVal[$i]);
1216 $arCurVal = $curVal;
1218 $dbVariants = CSaleOrderPropsVariant::GetList(
1219 array("SORT" => "ASC"),
1220 array("ORDER_PROPS_ID" => $arProperties["ID"]),
1225 while ($arVariants = $dbVariants->Fetch())
1227 $resultHtml .= '<option value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
1228 if (in_array($arVariants["VALUE"], $arCurVal))
1229 $resultHtml .= " selected";
1230 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'</option>
';
1232 $resultHtml .= '</
select>
';
1234 elseif ($arProperties["TYPE"] == "TEXTAREA")
1236 $resultHtml .= '<textarea
';
1237 $resultHtml .= 'rows=
"4" ';
1238 $resultHtml .= 'cols=
"40" ';
1239 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1240 $resultHtml .= 'id=
"ORDER_PROP_'.$arProperties["ID
"].'" type=
"textarea">
';
1241 $resultHtml .= ((isset($curVal)) ? $curVal : $arProperties["DEFAULT_VALUE"]);
1242 $resultHtml .= '</textarea>
';
1244 elseif ($arProperties["TYPE"] == "LOCATION")
1249 $DELIVERY_LOCATION = $arPropValues[intval($arProperties["ID"])];
1250 $locationID = $curVal;
1255 CSaleLocation::proxySaleAjaxLocationsComponent(
1259 "COUNTRY_INPUT_NAME" => "ORDER_PROP_".$arProperties["ID"],
1260 "REGION_INPUT_NAME" => "REGION_ORDER_PROP_".$arProperties["ID"],
1261 "CITY_INPUT_NAME" => "CITY_ORDER_PROP_".$arProperties["ID"],
1262 "CITY_OUT_LOCATION" => "Y",
1263 "ALLOW_EMPTY_CITY" => "Y",
1264 "LOCATION_VALUE" => $curVal,
1266 "ONCITYCHANGE" => "",
1272 "PROVIDE_LINK_BY" => "code",
1276 $tmpLocation = ob_get_contents();
1279 $resultHtml .= '<script>var locationID = \
''.$arProperties[
"ID"].
'\';</script>
';
1280 $resultHtml .= $tmpLocation;
1282 elseif ($arProperties["TYPE"] == "RADIO")
1284 $dbVariants = CSaleOrderPropsVariant::GetList(
1285 array("SORT" => "ASC"),
1286 array("ORDER_PROPS_ID" => $arProperties["ID"]),
1291 $resultHtml .= '<div
id=
"ORDER_PROP_'.$arProperties["ID
"].'">
';// type="radio"
1292 while ($arVariants = $dbVariants->Fetch())
1294 $resultHtml .= '<input type=
"radio" class=
"inputradio" ';
1295 $resultHtml .= 'name=
"ORDER_PROP_'.$arProperties["ID
"].'" ';
1296 $resultHtml .= 'value=
"'.htmlspecialcharsEx($arVariants["VALUE
"]).'"';
1297 if ($arVariants["VALUE"] == $curVal || !isset($curVal) && $arVariants["VALUE"] == $arProperties["DEFAULT_VALUE"])
1298 $resultHtml .= " checked";
1299 $resultHtml .= '>
'.htmlspecialcharsEx($arVariants["NAME"]).'<br>
';
1301 $resultHtml .= '</div>
';
1303 elseif ($arProperties["TYPE"] == "FILE")
1305 $arValues = array();
1306 $arTmpValues = array();
1307 if (isset($arPropValues[$arProperties["ID"]]) && !is_array($arPropValues[$arProperties["ID"]]))
1309 $arTmpValues = explode(", ", $arPropValues[$arProperties["ID"]]);
1310 foreach ($arTmpValues as $key => $value)
1311 $arValues[$value] = $value;
1314 $resultHtml .= fShowFilePropertyField("ORDER_PROP_".$arProperties["ID"], $arProperties, $arValues, $arProperties["SIZE1"], $formVarsSubmit);
1317 if ($arProperties["DESCRIPTION"] <> '')
1319 $resultHtml .= "<br><small>".htmlspecialcharsEx($arProperties["DESCRIPTION"])."</small>";
1321 $resultHtml .= "\n</td>\n</tr>";
1326 $resultHtml .= "</table>";
1332 * Returns HTML control with payment systems data
1334function fGetPaySystemsHTML($PERSON_TYPE_ID, $PAY_SYSTEM_ID)
1336 $resultHtml = "<table width=\"100%\">";
1337 $resultHtml .= "<tr class=\"adm-detail-required-field\">\n<td class=\"adm-detail-content-cell-l\" width=\"40%\">".GetMessage("SOE_PAY_SYSTEM").":</td><td class=\"adm-detail-content-cell-r\" width=\"60%\">";
1339 $arPaySystem = CSalePaySystem::DoLoadPaySystems($PERSON_TYPE_ID);
1341 $resultHtml .= "<select name=\"PAY_SYSTEM_ID\" id=\"PAY_SYSTEM_ID\" onChange=\"fChangePaymentSystem();\">\n";
1342 $resultHtml .= "<option value=\"\">(".GetMessage("SOE_SELECT").")</option>";
1343 foreach ($arPaySystem as $key => $val)
1345 $resultHtml .= "<option value=\"".$key."\"";
1346 if ($key == intval($PAY_SYSTEM_ID))
1347 $resultHtml .= " selected";
1348 $resultHtml .= ">".$val["NAME"]." [".$key."]</option>";
1350 $resultHtml .= "</select>";
1351 $resultHtml .= "</td>\n</tr>";
1352 $resultHtml .= "</table>";
1360function fUserProfile($USER_ID, $BUYER_TYPE = '', $default = '')
1362 $userProfileSelect = "<select name=\"user_profile\" id=\"user_profile\" onChange=\"fChangeProfile(this);\">";
1363 $userProfileSelect .= "<option value=\"0\">".GetMessage("NEWO_BUYER_PROFILE_NEW")."</option>";
1364 $userProfile = CSaleOrderUserProps::DoLoadProfiles($USER_ID, $BUYER_TYPE);
1366 if (!empty($userProfile) && is_array($userProfile))
1368 foreach($userProfile as $key => $val)
1370 if ($default == "" AND $i == "")
1372 $userProfileSelect .= "<option selected value=\"".$key."\">".$val["NAME"]."</option>";
1375 elseif ($default == $key)
1376 $userProfileSelect .= "<option selected value=\"".$key."\">".$val["NAME"]."</option>";
1378 $userProfileSelect .= "<option value=\"".$key."\">".$val["NAME"]."</option>";
1381 $userProfileSelect .= "</select>";
1383 return $userProfileSelect;
1389function fGetPayFromAccount($USER_ID, $CURRENCY)
1391 $arResult = array("PAY_MESSAGE" => GetMessage("NEWO_PAY_FROM_ACCOUNT_NO"));
1392 $dbUserAccount = CSaleUserAccount::GetList(
1395 "USER_ID" => $USER_ID,
1396 "CURRENCY" => $CURRENCY,
1399 if ($arUserAccount = $dbUserAccount->GetNext())
1401 if ((float)$arUserAccount["CURRENT_BUDGET"] > 0)
1403 $arResult["PAY_BUDGET"] = SaleFormatCurrency($arUserAccount["CURRENT_BUDGET"], $CURRENCY);
1404 $arResult["PAY_MESSAGE"] = str_replace("#MONEY#", $arResult["PAY_BUDGET"], GetMessage("NEWO_PAY_FROM_ACCOUNT_YES"));
1405 $arResult["CURRENT_BUDGET"] = $arUserAccount["CURRENT_BUDGET"];
1416function fGetDeliverySystemsHTML($location, $locationZip, $weight, $price, $currency, $siteId, $defaultDelivery, $arShoppingCart)
1418 $arResult = array();
1421 $setDeliveryPrice = false;
1423 $arDelivery = CSaleDelivery::DoLoadDelivery($location, $locationZip, $weight, $price, $currency, $siteId, $arShoppingCart);
1424 if (empty($arDelivery) || !is_array($arDelivery))
1429 $deliveryHTML = "<select name=\"DELIVERY_ID\" id=\"DELIVERY_ID\" onchange=\"fChangeDelivery();\">";
1430 $deliveryHTML .= "<option value=\"\">".GetMessage('NEWO_DELIVERY_NO
')."</option>";
1432 if (count($arDelivery) > 0)
1434 foreach($arDelivery as $val)
1436 if (isset($val["PROFILES"]))
1438 foreach($val["PROFILES"] as $k => $v)
1440 $currency = $v["CURRENCY"];
1442 if ($v["ID"] == $defaultDelivery)
1444 $selected = " selected=\"selected\"";
1446 if (floatval($v["DELIVERY_PRICE"]) <= 0)
1448 $error = "<div class='error
'>".GetMessage('NEWO_DELIVERY_ERR
')."</div>";
1449 $v["DELIVERY_PRICE"] = 0;
1450 $val["DESCRIPTION"] = "";
1452 $price = $v["DELIVERY_PRICE"];
1453 $description = $val["DESCRIPTION"];
1454 $setDeliveryPrice = true;
1457 $deliveryHTML .= "<option".$selected." value=\"".$v["ID"]."\">".$val["TITLE"]." (".$v["TITLE"].") [".$v["ID"]."]</option>";
1462 $currency = $val["CURRENCY"];
1464 if ($val["ID"] == $defaultDelivery)
1466 $selected = " selected=\"selected\"";
1467 $price = $val["PRICE"];
1468 $setDeliveryPrice = true;
1469 $description = $val["DESCRIPTION"];
1472 $deliveryHTML .= "<option".$selected." value=\"".$val["ID"]."\">".$val["NAME"]." [".$val["ID"]."]</option>";
1477 $deliveryHTML .= "</select>";
1479 $arResult["DELIVERY"] = $deliveryHTML;
1480 $arResult["DELIVERY_DEFAULT"] = $defaultDelivery;
1481 $arResult["DELIVERY_DEFAULT_PRICE"] = (count($arDelivery) > 0 && $setDeliveryPrice === true) ? $price : 0;
1482 $arResult["DELIVERY_DEFAULT_DESCRIPTION"] = $description;
1483 $arResult["DELIVERY_DEFAULT_ERR"] = $error;
1484 $arResult["CURRENCY"] = $currency;
1492function fGetCoupon($COUPON)
1494 $arCoupon = array();
1495 if (!empty($COUPON))
1497 if (is_array($COUPON))
1499 foreach ($COUPON as &$oneCoupon)
1501 $oneCoupon = trim((string)$oneCoupon);
1502 if ($oneCoupon != '')
1503 $arCoupon[] = $oneCoupon;
1509 $coupons = explode(",", $COUPON);
1510 if (!empty($coupons))
1512 foreach($coupons as &$val)
1526 * get location ID and ZIP
1528function fGetLocationID($PERSON_TYPE_ID)
1530 $arResult = array();
1531 $dbProperties = CSaleOrderProps::GetList(
1532 array("SORT" => "ASC"),
1533 array("PERSON_TYPE_ID" => $PERSON_TYPE_ID),
1536 array("TYPE", "IS_ZIP", "ID", "SORT")
1538 while ($arProperties = $dbProperties->Fetch())
1540 if ($arProperties["TYPE"] == "TEXT")
1542 if ($arProperties["IS_ZIP"] == "Y")
1544 $arResult["LOCATION_ZIP_ID"] = $arProperties["ID"];
1547 elseif ($arProperties["TYPE"] == "LOCATION")
1549 $arResult["LOCATION_ID"] = $arProperties["ID"];
1557 * product basket array
1559function fGetUserShoppingCart($arProduct, $LID, $recalcOrder)
1561 $arOrderProductPrice = array();
1564 $arSortNum = array();
1565 foreach($arProduct as $key => $val)
1567 $arSortNum[] = $val['PRICE_DEFAULT
'];
1568 $arProduct[$key]["PRODUCT_ID"] = (int)$val["PRODUCT_ID"];
1569 $arProduct[$key]["TABLE_ROW_ID"] = $key;
1571 if (!empty($arProduct) && !empty($arSortNum))
1572 array_multisort($arSortNum, SORT_DESC, $arProduct);
1574 $arBasketIds = array();
1575 $basketMap = array();
1576 foreach($arProduct as $key => $val)
1578 $val["QUANTITY"] = abs(str_replace(",", ".", $val["QUANTITY"]));
1579 $val["QUANTITY_DEFAULT"] = $val["QUANTITY"];
1580 $val["PRICE"] = str_replace(",", ".", $val["PRICE"]);
1582 // Y is used when custom price was set in the admin form
1583 if ($val["CALLBACK_FUNC"] == "Y")
1585 $val["CALLBACK_FUNC"] = false;
1586 $val["CUSTOM_PRICE"] = "Y";
1588 if (isset($val["BASKET_ID"]) && (int)$val["BASKET_ID"] > 0)
1590 CSaleBasket::Update($val["BASKET_ID"], array("CUSTOM_PRICE" => "Y"));
1593 //$val["DISCOUNT_PRICE"] = $val["PRICE_DEFAULT"] - $val["PRICE"];
1596 $arOrderProductPrice[$i] = $val;
1597 $arOrderProductPrice[$i]["TABLE_ROW_ID"] = $val["TABLE_ROW_ID"];
1598 $arOrderProductPrice[$i]["NAME"] = htmlspecialcharsback($val["NAME"]);
1599 $arOrderProductPrice[$i]["LID"] = $LID;
1600 $arOrderProductPrice[$i]["CAN_BUY"] = "Y";
1601 $arOrderProductPrice[$i]['RESERVED
'] = 'N
';
1603 if (isset($val["BASKET_ID"]) && (int)$val["BASKET_ID"] > 0)
1605 $basketId = (int)$val["BASKET_ID"];
1606 $arOrderProductPrice[$i]["ID"] = $basketId;
1608 $arBasketIds[] = $basketId;
1609 $basketMap[$basketId] = &$arOrderProductPrice[$i];
1611 if ($recalcOrder != "Y" && $arOrderProductPrice[$i]["CALLBACK_FUNC"] != false)
1612 unset($arOrderProductPrice[$i]["CALLBACK_FUNC"]);
1614 $arNewProps = array();
1615 if (is_array($val["PROPS"]))
1617 foreach($val["PROPS"] as $k => $v)
1619 if ($v["NAME"] != "" AND $v["VALUE"] != "")
1620 $arNewProps[$k] = $v;
1624 $arNewProps = array("NAME" => "", "VALUE" => "", "CODE" => "", "SORT" => "");
1626 $arOrderProductPrice[$i]["PROPS"] = $arNewProps;
1629 }//endforeach $arProduct
1631 // collect status of reservation elements basket
1632 if (!empty($arBasketIds))
1634 $rsBasketItems = CSaleBasket::GetList(
1636 array("ID" => $arBasketIds),
1644 while ($arBasketItems = $rsBasketItems->Fetch())
1646 $arBasketItems['ID
'] = (int)$arBasketItems['ID
'];
1647 if (!isset($basketMap[$arBasketItems['ID
']]))
1649 $basketMap[$arBasketItems['ID
']]['RESERVED
'] = $arBasketItems['RESERVED
'];
1651 unset($arBasketItems, $rsBasketItems);
1653 unset($basketMap, $arBasketIds);
1655 return $arOrderProductPrice;
1659 * Returns HTML for recommended product, basket product or product from the viewed list
1661function fGetFormatedProduct($USER_ID, $LID, $arData, $currency, $type = '')
1667 if (!is_array($arData["ITEMS"]) || count($arData["ITEMS"]) <= 0)
1670 $result = "<table width=\"100%\">";
1671 if (CModule::IncludeModule('catalog
') && CModule::IncludeModule('iblock
'))
1673 $arProductId = array();
1674 $arDataTab = array();
1676 $arSkuParentChildren = array();
1677 $arSkuParentId = array();
1678 $arSkuParent = array();
1680 foreach ($arData["ITEMS"] as $item)
1682 if (!empty($item["CURRENCY"]) && $item["CURRENCY"] != $currency)
1684 if (floatval($item["PRICE"]) > 0)
1685 $item["PRICE"] = CCurrencyRates::ConvertCurrency($item["PRICE"], $item["CURRENCY"], $currency);
1687 if (floatval($item["DISCOUNT_PRICE"]) > 0)
1688 $item["DISCOUNT_PRICE"] = CCurrencyRates::ConvertCurrency($item["DISCOUNT_PRICE"], $item["CURRENCY"], $currency);
1690 $item["CURRENCY"] = $currency;
1694 if ($productProvider = CSaleBasket::GetProductProvider($item))
1696 if (method_exists($productProvider, "GetSetItems"))
1698 $itemInfo = (isset($item['ID
']) ? array('BASKET_ID
' => $item['ID
']) : array());
1699 $arSets = $productProvider::GetSetItems($item["PRODUCT_ID"], CSaleBasket::TYPE_SET, $itemInfo);
1702 if (is_array($arSets))
1704 foreach ($arSets as $arSetData)
1706 foreach ($arSetData["ITEMS"] as $setItem)
1708 $setItem["FUSER_ID"] = $item["FUSER_ID"];
1709 $setItem["LID"] = $item["LID"];
1710 $setItem["MODULE"] = $item["MODULE"];
1711 $setItem["PRODUCT_PROVIDER_CLASS"] = $productProvider;
1712 $setItem["SET_PARENT_ID"] = $item["ID"];
1714 $arSet[$item["PRODUCT_ID"]][] = $setItem;
1721 if ($item["MODULE"] == "catalog")
1723 $arProductId[$item["PRODUCT_ID"]] = $item["PRODUCT_ID"];
1724 $arDataTab[$item["PRODUCT_ID"]] = $item;
1726 $arParent = CCatalogSku::GetProductInfo($item["PRODUCT_ID"]);
1729 $arSkuParentChildren[$item["PRODUCT_ID"]] = $arParent["ID"];
1730 $arSkuParentId[$arParent["ID"]] = $arParent["ID"];
1735 if(!empty($arSkuParentId))
1737 $res = CIBlockElement::GetList(array(), array("ID" => $arSkuParentId), false, false, array("ID", "IBLOCK_ID", "IBLOCK_SECTION_ID", "PREVIEW_PICTURE", "DETAIL_PICTURE", "NAME", "DETAIL_PAGE_URL"));
1738 while ($arItems = $res->GetNext())
1739 $arSkuParent[$arItems["ID"]] = $arItems;
1742 if(!empty($arProductId))
1744 $dbProduct = CIBlockElement::GetList(array(), array("ID" => $arProductId), false, false, array('ID
', 'IBLOCK_ID
', 'IBLOCK_SECTION_ID
', 'DETAIL_PICTURE
', 'PREVIEW_PICTURE
', 'IBLOCK_TYPE_ID
'));
1745 while($arProduct = $dbProduct->Fetch())
1748 $arImgProduct = false;
1752 $arDataTab[$arProduct['ID
']]['IBLOCK_ID
'] = $arProduct['IBLOCK_ID
'];
1753 $arDataTab[$arProduct['ID
']]['IBLOCK_SECTION_ID
'] = $arProduct['IBLOCK_SECTION_ID
'];
1754 $arDataTab[$arProduct['ID
']]['DETAIL_PICTURE
'] = $arProduct['DETAIL_PICTURE
'];
1755 $arDataTab[$arProduct['ID
']]['PREVIEW_PICTURE
'] = $arProduct['PREVIEW_PICTURE
'];
1756 $arDataTab[$arProduct['ID
']]['IBLOCK_TYPE_ID
'] = $arProduct['IBLOCK_TYPE_ID
'];
1757 $item = $arDataTab[$arProduct['ID
']];
1759 if ($item["PREVIEW_PICTURE"] == "" && $item["DETAIL_PICTURE"] == "" && is_set($arSkuParentChildren[$item["PRODUCT_ID"]]))
1761 $idTmp = $arSkuParentChildren[$item["PRODUCT_ID"]];
1762 $item["DETAIL_PICTURE"] = $arSkuParent[$idTmp]["DETAIL_PICTURE"];
1763 $item["PREVIEW_PICTURE"] = $arSkuParent[$idTmp]["PREVIEW_PICTURE"];
1766 if ($item["DETAIL_PICTURE"] > 0)
1767 $imgCode = $item["DETAIL_PICTURE"];
1768 elseif ($item["PREVIEW_PICTURE"] > 0)
1769 $imgCode = $item["PREVIEW_PICTURE"];
1771 $arSkuProperty = CSaleProduct::GetProductSkuProps($item["PRODUCT_ID"], $item["IBLOCK_ID"]);
1773 $item["NAME"] = htmlspecialcharsex($item["NAME"]);
1774 $item["EDIT_PAGE_URL"] = htmlspecialcharsex($item["EDIT_PAGE_URL"]);
1775 $item["CURRENCY"] = htmlspecialcharsex($item["CURRENCY"]);
1779 $arFile = CFile::GetFileArray($imgCode);
1780 $arImgProduct = CFile::ResizeImageGet($arFile, array('width'=>80, 'height'=>80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
1783 if (is_array($arImgProduct))
1785 $imgUrl = $arImgProduct["src"];
1786 $imgProduct = "<a href=\"".$item["EDIT_PAGE_URL"]."\" target=\"_blank\"><img src=\"".$imgUrl."\" alt=\"\" title=\"".$item["NAME"]."\" ></a>";
1789 $imgProduct = "<div class='no_foto
'>".GetMessage('NO_FOTO
')."</div>";
1791 $arCurFormat = CCurrencyLang::GetCurrencyFormat($item["CURRENCY"]);
1792 $priceValutaFormat = str_replace("#", '', $arCurFormat["FORMAT_STRING"]);
1794 $currentTotalPrice = ($item["PRICE"] + $item["DISCOUNT_PRICE"]);
1796 $discountPercent = 0;
1797 if ($item["DISCOUNT_PRICE"] > 0)
1798 $discountPercent = intval(($item["DISCOUNT_PRICE"] * 100) / $currentTotalPrice);
1800 $arProduct = CCatalogProduct::GetByID($item["PRODUCT_ID"]);
1801 $balance = floatval($arProduct["QUANTITY"]);
1803 $result .= "<tr id='more_
".$type."_
".$item["ID
"]."'>
1804 <td class=\"tab_img\" >".$imgProduct."</td>
1805 <td class=\"tab_text\">
1806 <div class=\"order_name\"><a href=\"".$item["EDIT_PAGE_URL"]."\" target=\"_blank\" title=\"".$item["NAME"]."\">".$item["NAME"]."</a></div>
1807 <div class=\"order_price\">
1808 ".GetMessage('NEWO_SUBTAB_PRICE
').": <b>".SaleFormatCurrency($item["PRICE"], $currency)."</b>";
1810 if (!empty($arSet) && array_key_exists($arProduct["ID"], $arSet)) // show/hide set item link
1814 <a
id=
"set_toggle_link_b'.$arProduct["ID
"].'"
1815 href=
"javascript:void(0);"
1816 class=
"dashed-link show-set-link"
1817 title=
"'.GetMessage("SOE_SHOW_SET
").'"
1818 onclick=
"fToggleSetItems(\'b'.$arProduct["ID
"].'\');">
'.GetMessage("SOE_SHOW_SET").'</a>
1822 $result .= "</div>";
1824 $arResult = CSaleProduct::GetProductSku($USER_ID, $LID, $item["PRODUCT_ID"], $item["NAME"], $currency, $arProduct);
1826 if (count($arResult["SKU_ELEMENTS"]) > 0)
1828 foreach ($arResult["SKU_ELEMENTS"] as $key => $val)
1831 foreach ($val as $k => $v)
1835 $arTmp[$arResult["SKU_PROPERTIES"][$k]["NAME"]] = $v;
1838 $arResult["SKU_ELEMENTS"][$key]["SKU_PROPS"] = CUtil::PhpToJSObject($arTmp);
1842 $arResult["POPUP_MESSAGE"] = array(
1843 "PRODUCT_ADD" => GetMessage('NEWO_POPUP_TO_BASKET
'),
1844 "PRODUCT_ORDER" => GetMessage('NEWO_POPUP_TO_ORDER
'),
1845 "PRODUCT_NOT_ADD" => GetMessage('NEWO_POPUP_DONT_CAN_BUY
'),
1846 "PRODUCT_PRICE_FROM" => GetMessage('NEWO_POPUP_FROM
')
1849 if (count($arResult["SKU_ELEMENTS"]) <= 0)
1850 $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBasketMoreProduct('".$type."', ".$item["PRODUCT_ID"].");return false;\"><span></span>".GetMessage('NEWO_SUBTAB_ADD_BASKET
')."</a><br>";
1852 $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBasketMoreProductSku(".CUtil::PhpToJsObject($arResult['SKU_ELEMENTS
']).", ".CUtil::PhpToJsObject($arResult['SKU_PROPERTIES
']).", 'basket
', ".CUtil::PhpToJsObject($arResult["POPUP_MESSAGE"]).");\"><span></span>".GetMessage('NEWO_SUBTAB_ADD_BASKET
')."</a><br>";
1856 if (count($arResult["SKU_ELEMENTS"]) > 0)
1858 $result .= "<a href=\"javascript:void(0);\" class=\"get_new_order\" onClick=\"fAddToBasketMoreProductSku(".CUtil::PhpToJsObject($arResult['SKU_ELEMENTS
']).", ".CUtil::PhpToJsObject($arResult['SKU_PROPERTIES
']).", 'neworder
', ".CUtil::PhpToJsObject($arResult["POPUP_MESSAGE"]).");\"><span></span>".GetMessage('NEWO_SUBTAB_ADD_ORDER
')."</a>";
1862 $cntProd = (floatval($item["QUANTITY"]) > 0) ? floatval($item["QUANTITY"]) : 1;
1863 $url = "/bitrix/admin/sale_order_new.php?lang=".LANGUAGE_ID."&user_id=".$USER_ID."&LID=".$LID."&product[".$item["PRODUCT_ID"]."]=".$cntProd;
1864 $result .= "<a href=\"".$url."\" target=\"_blank\" class=\"get_new_order\"><span></span>".GetMessage('NEWO_SUBTAB_ADD_ORDER
')."</a>";
1868 $result .= "</td></tr>";
1871 if (!empty($arSet) && array_key_exists($arProduct["ID"], $arSet))
1873 foreach ($arSet[$arProduct["ID"]] as $set)
1875 $editUrl = CIBlock::GetAdminElementEditLink($set["IBLOCK_ID"], $set["ITEM_ID"], array(
1876 "find_section_section" => $set["IBLOCK_SECTION_ID"],
1880 if ($set["PREVIEW_PICTURE"] > 0)
1881 $imgCode = $set["PREVIEW_PICTURE"];
1882 elseif ($set["DETAIL_PICTURE"] > 0)
1883 $imgCode = $set["DETAIL_PICTURE"];
1887 $arFile = CFile::GetFileArray($imgCode);
1888 $arImgProduct = CFile::ResizeImageGet($arFile, array('width'=>80, 'height'=>80), BX_RESIZE_IMAGE_PROPORTIONAL, false, false);
1889 if (is_array($arImgProduct))
1891 $imgUrl = $arImgProduct["src"];
1892 $img = '<a href=
"'.$editUrl.'" target=
"_blank"><img src=
"'.$arImgProduct["src
"].'" alt=
"" title=
"'.$set["NAME
"].'" ></a>
';
1896 $img = '<div
class=
"no_foto">
'.GetMessage('SOD_NO_FOTO
')."</div>";
1899 <tr
style=
"display:none" class=
"set_item_b'.$arProduct["ID
"].'">
1900 <td
class=
"tab_img">
'.$img.'</td>
1901 <td
class=
"tab_text">
1902 <div
class=
"order_name">
1903 <a href=
"'.$editUrl.'" style=
"font-style:italic" target=
"_blank" title=
"'.$set["NAME
"].'">
'.$set["NAME"].'</a>
1905 <div
class=
"order_price">
'.GetMessage('NEWO_SUBTAB_PRICE
').': <b>
'.SaleFormatCurrency($set["PRICE"], $currency).'</b></div>
1915 if ($arData["CNT"] > 2 && $arData["CNT"] != count($arData["ITEMS"]))
1917 $result .= "<tr><td colspan='2
' align='right' class=\"more_product\">";
1918 if ($type == "basket")
1919 $result .= "<a href='javascript:void(0);
' onClick='fGetMoreBasket(\
"Y\");' class=\"get_more\">".
GetMessage(
'NEWO_SUBTAB_MORE').
"<span></span></a>";
1921 $result .=
"<a href='javascript:void(0);' onClick='fGetMoreViewed(\"Y\");' class=\"get_more\">".
GetMessage('NEWO_SUBTAB_MORE').
"<span></span></a>";
1923 $result .=
"<a href='javascript:void(0);' onClick='fGetMoreRecom();' class=\"get_more\">".
GetMessage('NEWO_SUBTAB_MORE').
"<span></span></a>";
1934 global $COUNT_RECOM_BASKET_PROD;
1940 $arShoppingCartTmp =
array();
1941 $arProductId =
array();
1942 if (empty($arDelete) ||!is_array($arDelete))
1943 $arDelete =
array();
1945 if (!empty($arShoppingCart) && is_array($arShoppingCart))
1947 foreach($arShoppingCart as
$key =>
$val)
1949 if (!in_array(
$val[
"PRODUCT_ID"], $arDelete))
1951 $arShoppingCartTmp[] =
$val;
1952 $arProductId[] =
$val[
"PRODUCT_ID"];
1957 if (!empty($arShoppingCartTmp))
1959 if (CModule::IncludeModule(
'catalog'))
1963 $arSection =
array();
1964 $res = CIBlockElement::GetList(
array(),
array(
"ID" => $arProductId),
false,
false,
array(
'ID',
'IBLOCK_ID',
'IBLOCK_SECTION_ID',
'IBLOCK_TYPE_ID'));
1965 while ($arSectionTmp =
$res->Fetch())
1966 $arSection[$arSectionTmp[
"ID"]] = $arSectionTmp;
1968 foreach($arShoppingCartTmp as
$key =>
$val)
1970 if (!isset(
$val[
"PRODUCT_ID"]))
1973 if ((!isset(
$val[
"EDIT_PAGE_URL"]) ||
$val[
"EDIT_PAGE_URL"] ==
"") && $arSection[
$val[
"PRODUCT_ID"]][
"IBLOCK_ID"] > 0)
1975 $val[
"EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink($arSection[
$val[
"PRODUCT_ID"]][
"IBLOCK_ID"],
$val[
"PRODUCT_ID"],
array(
1976 "find_section_section" => $arSection[
$val[
"PRODUCT_ID"]][
"IBLOCK_SECTION_ID"],
1983 if (
$i >= $COUNT_RECOM_BASKET_PROD && $showAll ==
"N")
1989 if ($showAll ==
"Y")
2000 foreach ($arProps as &$arData)
2002 if (isset($arData[
"NAME"]) && $arData[
"NAME"] == $propName && $propCode != $arData[
"CODE"])
2012 foreach ($arIblockIDs as &$iblockID)
2014 $str .=
'"'.$arIblockNames[$iblockID].
'", ';
2019 return str_replace(
', #',
'',
$str);
2024 static $propList =
null;
2026 if ($propList ===
null && Loader::includeModule(
'catalog'))
2028 $arIblockIDs =
array();
2029 $arIblockNames =
array();
2031 'select' =>
array(
'IBLOCK_ID',
'NAME' =>
'IBLOCK.NAME'),
2032 'order' =>
array(
'IBLOCK_ID' =>
'ASC')
2037 $arIblockIDs[] =
$catalog[
'IBLOCK_ID'];
2042 if (!empty($arIblockIDs))
2045 $propertyIterator = Iblock\PropertyTable::getList(
array(
2046 'select' =>
array(
'ID',
'CODE',
'NAME',
'IBLOCK_ID'),
2047 'filter' =>
array(
'@IBLOCK_ID' => $arIblockIDs,
'=ACTIVE' =>
'Y'),
2048 'order' =>
array(
'IBLOCK_ID' =>
'ASC',
'SORT' =>
'ASC',
'ID' =>
'ASC')
2050 while ($property = $propertyIterator->fetch())
2052 $property[
'ID'] = (int)$property[
'ID'];
2053 $property[
'IBLOCK_ID'] = (int)$property[
'IBLOCK_ID'];
2054 $property[
'CODE'] = (string)$property[
'CODE'];
2055 if ($property[
'CODE'] ==
'')
2056 $property[
'CODE'] = $property[
'ID'];
2057 if (!isset($arProps[$property[
'CODE']]))
2059 $arProps[$property[
'CODE']] =
array(
2060 'CODE' => $property[
'CODE'],
2061 'TITLE' => $property[
'NAME'].
' ['.$property[
'CODE'].
']',
2062 'ID' =>
array($property[
'ID']),
2063 'IBLOCK_ID' =>
array($property[
'IBLOCK_ID'] => $property[
'IBLOCK_ID']),
2064 'IBLOCK_TITLE' =>
array($property[
'IBLOCK_ID'] => $arIblockNames[$property[
'IBLOCK_ID']]),
2070 $arProps[$property[
'CODE']][
'ID'][] = $property[
'ID'];
2071 $arProps[$property[
'CODE']][
'IBLOCK_ID'][$property[
'IBLOCK_ID']] = $property[
'IBLOCK_ID'];
2072 if ($arProps[$property[
'CODE']][
'COUNT'] < 2)
2073 $arProps[$property[
'CODE']][
'IBLOCK_TITLE'][$property[
'IBLOCK_ID']] = $arIblockNames[$property[
'IBLOCK_ID']];
2074 $arProps[$property[
'CODE']][
'COUNT']++;
2077 unset($property, $propertyIterator, $arIblockNames, $arIblockIDs);
2079 $propList =
array();
2080 foreach ($arProps as &$property)
2083 if ($property[
'COUNT'] > 1)
2085 $iblockList = ($property[
'COUNT'] > 2 ?
' ( ... )' :
' ('.implode(
', ', $property[
'IBLOCK_TITLE']).
')');
2087 $propList[
'PROPERTY_'.$property[
'CODE']] = $property[
'TITLE'].$iblockList;
2089 unset($property, $arProps);
2093 return (empty($propList) ?
array() : $propList);
2101 foreach (
$arFields as $fieldname => $fieldvalue)
2103 if ($fieldvalue <>
'')
2107 if (in_array($fieldname, $arInfo[
"TRIGGER_FIELDS"]))
2110 foreach ($arInfo[
"DATA_FIELDS"] as $field)
2117 "DATA" => serialize($arData),
2118 "DATE_CREATE" =>
$arFields[
"H_DATE_INSERT"],
2119 "DATE_MODIFY" =>
$arFields[
"H_DATE_INSERT"],
2136 $arFile = CFile::GetFileArray($fileId);
2140 $is_image = CFile::IsImage($arFile[
"FILE_NAME"], $arFile[
"CONTENT_TYPE"]);
2142 $resultHTML = CFile::ShowImage($arFile[
"ID"], $arSize[
"WIDTH"], $arSize[
"HEIGHT"],
"border=0",
"",
true);
2144 $resultHTML =
"<a href=\"sale_order_detail.php?ID=".$orderId.
"&download=Y&file_id=".$arFile[
"ID"].
"&".
bitrix_sessid_get().
"\">".$arFile[
"ORIGINAL_NAME"].
"</a>";
2154 if ($propData[
"MULTIPLE"] ==
"Y")
2157 if (!is_array($value))
2159 if (mb_strpos($value,
",") !==
false)
2160 $arVal = explode(
",", $value);
2171 if ($propData[
"PROPERTY_TYPE"] ==
"F")
2190 if ($propData[
"PROPERTY_TYPE"] ==
"F")
2208 $prefix = (
$page ==
"edit") ?
"NEW_" :
"SOD_";
2210 if (
$page !=
"edit")
2211 $bWithStores =
false;
2213 foreach ($arUserColumns as $columnCode => $columnName)
2215 switch ($columnCode)
2217 case "COLUMN_NUMBER":
2219 <td><?=
GetMessage($prefix.
"COLUMN_NUMBER")?></td>
2225 <td><?=
GetMessage($prefix.
"COLUMN_NAME")?></td>
2229 case "COLUMN_IMAGE":
2231 <td><?=
GetMessage($prefix.
"COLUMN_IMAGE")?></td>
2235 case "COLUMN_QUANTITY":
2237 <td><?=
GetMessage($prefix.
"COLUMN_QUANTITY")?></td>
2242 <td><?=
GetMessage(
"SALE_F_STORE_CUR_AMOUNT")?></td>
2243 <td><?=
GetMessage(
"SALE_F_STORE_AMOUNT")?></td>
2244 <td><?=
GetMessage(
"SALE_F_STORE_BARCODE")?></td>
2249 case "COLUMN_REMAINING_QUANTITY":
2251 <td><?=
GetMessage($prefix.
"COLUMN_REMAINING_QUANTITY")?></td>
2255 case "COLUMN_PROPS":
2257 <td><?=
GetMessage($prefix.
"COLUMN_PROPS")?></td>
2261 case "COLUMN_PRICE":
2263 <td><?=
GetMessage($prefix.
"COLUMN_PRICE")?></td>
2269 <td><?=
GetMessage($prefix.
"COLUMN_SUM")?></td>
2275 <td><?=$columnName?></td>
2289 if ($barcodeValue ==
"Y")
2290 $result =
"store_barcode_found_input";
2291 elseif ($barcodeValue ==
"N")
2292 $result =
"store_barcode_not_found";
2301function getProductDataToFillBasket($productId, $quantity,
$userId, $LID, $userColumns, $tmpId =
"")
2303 if (!\
Bitrix\
Main\Loader::includeModule(
"catalog"))
2308 static $proxyIblockElement =
array();
2309 static $proxyCatalogMeasure =
array();
2310 static $proxyParent =
array();
2311 static $proxyIblockProperty =
array();
2312 static $proxyProductData =
array();
2313 static $proxyCatalogProduct =
array();
2314 static $proxyCatalogMeasureRatio =
array();
2317 if ($productId <= 0)
2322 if (!empty($proxyIblockElement[$productId]))
2328 $iblockId = (int)CIBlockElement::GetIBlockByID($productId);
2339 $arSku2Parent =
array();
2340 $arElementId =
array();
2346 if (!empty($proxyParent[$proxyParentKey]) && is_array($proxyParent[$proxyParentKey]))
2348 $arParent = $proxyParent[$proxyParentKey];
2353 $proxyParent[$proxyParentKey] = $arParent;
2359 $arElementId[] = $arParent[
"ID"];
2363 $arPropertyInfo =
array();
2364 $userColumns = (string)$userColumns;
2365 $arUserColumns = ($userColumns !=
'') ? explode(
",", $userColumns) :
array();
2366 foreach ($arUserColumns as
$key => $column)
2368 if (strncmp($column,
'PROPERTY_', 9) != 0)
2370 unset($arUserColumns[
$key]);
2374 $column = mb_strtoupper($column);
2375 $propertyCode = mb_substr($column, 9);
2376 if ($propertyCode ==
'')
2378 unset($arUserColumns[
$key]);
2382 if (!empty($proxyIblockProperty[$propertyCode]) && is_array($proxyIblockProperty[$propertyCode]))
2384 $arPropertyInfo[$column] = $proxyIblockProperty[$propertyCode];
2389 if ($arPropData = $dbres->GetNext())
2391 $arPropertyInfo[$column] = $arPropData;
2392 $proxyIblockProperty[$propertyCode] = $arPropData;
2399 $arSelect = array_merge(
2400 array(
"ID",
"NAME",
"LID",
"IBLOCK_ID",
"IBLOCK_SECTION_ID",
"DETAIL_PICTURE",
"PREVIEW_PICTURE",
"DETAIL_PAGE_URL",
"XML_ID",
"IBLOCK_XML_ID"),
2405 $proxyProductDataKey = md5(join(
'|', $arElementId).
"_".join(
'|', $arSelect));
2406 if (!empty($proxyProductData[$proxyProductDataKey]) && is_array($proxyProductData[$proxyProductDataKey]))
2408 $arProductData = $proxyProductData[$proxyProductDataKey];
2413 $proxyProductData[$proxyProductDataKey] = $arProductData;
2418 if (!empty($arProductData))
2420 $arElementInfo =
array();
2421 foreach ($arProductData as $elemId => &$arElement)
2423 foreach ($arElement as
$key => $value)
2425 if (strncmp(
$key,
'PROPERTY_', 9) == 0 && mb_substr(
$key, -6) ==
"_VALUE")
2427 $columnCode = str_replace(
"_VALUE",
"",
$key);
2428 if (!isset($arPropertyInfo[$columnCode]))
2430 $keyResult =
'PROPERTY_'.$arPropertyInfo[$columnCode][
'CODE'].
'_VALUE';
2432 if ($keyResult !=
$key)
2433 $arElement[$keyResult] = $arElement[
$key];
2440 if (isset($arProductData[$productId]))
2443 if (isset( $arSku2Parent[$productId]))
2444 $arParent = $arProductData[$arSku2Parent[
$productId]];
2446 if (!empty($arSku2Parent))
2448 foreach ($arUserColumns as $field)
2450 $fieldVal = $field.
"_VALUE";
2453 if ((!isset($arElementInfo[$fieldVal]) || (isset($arElementInfo[$fieldVal]) && $arElementInfo[$fieldVal] ==
''))
2454 && (isset($arProductData[$parentId][$fieldVal]) && !empty($arProductData[$parentId][$fieldVal])))
2456 $arElementInfo[$fieldVal] = $arProductData[$parentId][$fieldVal];
2459 if (mb_strpos($arElementInfo[
"~XML_ID"],
'#') ===
false)
2461 $arElementInfo[
"~XML_ID"] = $arParent[
'~XML_ID'].
'#'.$arElementInfo[
"~XML_ID"];
2465 $arElementInfo[
"MODULE"] =
"catalog";
2466 $arElementInfo[
"PRODUCT_PROVIDER_CLASS"] =
"CCatalogProductProvider";
2468 $arElementInfo[
"PRODUCT_ID"] = $arElementInfo[
"ID"];
2470 if ($arElementInfo[
"IBLOCK_ID"] > 0)
2473 "find_section_section" => $arElementInfo[
"IBLOCK_SECTION_ID"],
2483 'CURRENCY' => Sale\
Internals\SiteCurrencyTable::getSiteCurrency($LID),
2484 'PRECISION' => (
int)
Main\
Config\Option::get(
'sale',
'value_precision'),
2485 'USE_DISCOUNTS' =>
true,
2486 'RESULT_WITH_VAT' =>
true
2491 $currentPrice = $arPrice[
'RESULT_PRICE'][
'DISCOUNT_PRICE'];
2492 $arElementInfo[
'PRICE'] = $currentPrice;
2493 $arElementInfo[
'CURRENCY'] = $arPrice[
'RESULT_PRICE'][
'CURRENCY'];
2494 $arElementInfo[
'DISCOUNT_PRICE'] = $arPrice[
'RESULT_PRICE'][
'DISCOUNT'];
2495 $currentTotalPrice = $arPrice[
'RESULT_PRICE'][
'BASE_PRICE'];
2496 $discountPercent = (int)$arPrice[
'RESULT_PRICE'][
'PERCENT'];
2498 $arProduct =
array();
2500 if (!empty($proxyCatalogProduct[$productId]) && is_array($proxyCatalogProduct[$productId]))
2502 $arProduct = $proxyCatalogProduct[
$productId];
2508 array(
'ID' => $productId),
2511 array(
'ID',
'QUANTITY',
'WEIGHT',
'MEASURE',
'TYPE',
'BARCODE_MULTI')
2513 if ($arProduct = $rsProducts->Fetch())
2515 $proxyCatalogProduct[
$productId] = $arProduct;
2519 if (empty($arProduct) || !is_array($arProduct))
2524 $balance = floatval($arProduct[
"QUANTITY"]);
2527 $arSkuData =
array();
2529 "NAME" =>
"Catalog XML_ID",
2530 "CODE" =>
"CATALOG.XML_ID",
2531 "VALUE" => $arElementInfo[
'~IBLOCK_XML_ID']
2534 static $proxySkuProperty =
array();
2536 if (!empty($proxySkuProperty[$productId]) && is_array($proxySkuProperty[$productId]))
2538 $arSkuProperty = $proxySkuProperty[
$productId];
2543 $proxySkuProperty[
$productId] = $arSkuProperty;
2546 if (!empty($arSkuProperty))
2548 foreach ($arSkuProperty as &
$val)
2550 $arSkuData[] =
array(
2551 'NAME' =>
$val[
'NAME'],
2552 'VALUE' =>
$val[
'VALUE'],
2553 'CODE' =>
$val[
'CODE']
2560 $arSkuData[] =
array(
2561 "NAME" =>
"Product XML_ID",
2562 "CODE" =>
"PRODUCT.XML_ID",
2563 "VALUE" => $arElementInfo[
"~XML_ID"]
2568 $priceValutaFormat = str_replace(
"#",
"",
$arCurFormat[
"FORMAT_STRING"]);
2570 $arElementInfo[
"WEIGHT"] = $arProduct[
"WEIGHT"];
2573 $arElementInfo[
"MEASURE_TEXT"] =
"";
2574 $arElementInfo[
"MEASURE_CODE"] = 0;
2575 if ((
int)$arProduct[
"MEASURE"] > 0)
2578 if (!empty($proxyCatalogMeasure[$arProduct[
"MEASURE"]]) && is_array($proxyCatalogMeasure[$arProduct[
"MEASURE"]]))
2580 $arMeasure = $proxyCatalogMeasure[$arProduct[
"MEASURE"]];
2584 $dbMeasure = CCatalogMeasure::GetList(
array(),
array(
"ID" => intval($arProduct[
"MEASURE"])),
false,
false,
array(
"ID",
"SYMBOL_RUS",
"SYMBOL_INTL"));
2585 if ($arMeasure = $dbMeasure->Fetch())
2587 $proxyCatalogMeasure[$arProduct[
"MEASURE"]] = $arMeasure;
2591 if (!empty($arMeasure) && is_array($arMeasure))
2593 $arElementInfo[
"MEASURE_TEXT"] = ($arMeasure[
"SYMBOL_RUS"] !=
'' ? $arMeasure[
"SYMBOL_RUS"] : $arMeasure[
"SYMBOL_INTL"]);
2594 $arElementInfo[
"MEASURE_CODE"] = $arMeasure[
"CODE"];
2597 if ($arElementInfo[
"MEASURE_TEXT"] ==
'')
2599 $arElementInfo[
"MEASURE_TEXT"] = ($defaultMeasure[
"SYMBOL_RUS"] !=
'' ? $defaultMeasure[
"SYMBOL_RUS"] : $defaultMeasure[
"SYMBOL_INTL"]);
2603 $arElementInfo[
"RATIO"] = 1;
2605 if (!empty($proxyCatalogMeasureRatio[$productId]) && is_array($proxyCatalogMeasureRatio[$productId]))
2607 $arRatio = $proxyCatalogMeasureRatio[
$productId];
2611 $dbratio = Catalog\MeasureRatioTable::getList(
array(
2612 'select' =>
array(
'*'),
2613 'filter' =>
array(
'=PRODUCT_ID' => $productId,
'=IS_DEFAULT' =>
'Y')
2615 if ($arRatio = $dbratio->fetch())
2617 $proxyCatalogMeasureRatio[
$productId] = $arRatio;
2622 if (!empty($arRatio) && is_array($arRatio))
2623 $arElementInfo[
"RATIO"] = $arRatio[
"RATIO"];
2628 if ($arElementInfo[
"PREVIEW_PICTURE"] > 0)
2629 $imgCode = $arElementInfo[
"PREVIEW_PICTURE"];
2630 elseif ($arElementInfo[
"DETAIL_PICTURE"] > 0)
2631 $imgCode = $arElementInfo[
"DETAIL_PICTURE"];
2633 if ($imgCode ==
"" &&
count($arParent) > 0)
2635 if ($arParent[
"PREVIEW_PICTURE"] > 0)
2636 $imgCode = $arParent[
"PREVIEW_PICTURE"];
2637 elseif ($arParent[
"DETAIL_PICTURE"] > 0)
2638 $imgCode = $arParent[
"DETAIL_PICTURE"];
2645 if (is_array($arImgProduct))
2646 $imgUrl = $arImgProduct[
"src"];
2649 $arSetInfo =
array();
2650 $arStores =
array();
2658 if (method_exists($productProvider,
"GetSetItems"))
2665 if (!empty($arSets))
2667 foreach ($arSets as $arSetData)
2669 foreach ($arSetData[
"ITEMS"] as $setItem)
2671 $arSetItemParams = getProductDataToFillBasket($setItem[
"PRODUCT_ID"], $setItem[
"QUANTITY"],
$userId, $LID, $userColumns, $tmpId);
2674 $arSetItemParams[
"id"] = $setItem[
"PRODUCT_ID"];
2675 $arSetItemParams[
"name"] = $setItem[
"NAME"];
2676 $arSetItemParams[
"module"] = $setItem[
"MODULE"];
2677 $arSetItemParams[
"productProviderClass"] = $setItem[
"PRODUCT_PROVIDER_CLASS"];
2678 $arSetItemParams[
"url"] = $setItem[
"DETAIL_PAGE_URL"];
2679 $arSetItemParams[
"quantity"] = $setItem[
"QUANTITY"] * $quantity;
2680 $arSetItemParams[
"barcodeMulti"] = $setItem[
"BARCODE_MULTI"];
2681 $arSetItemParams[
"productType"] = $setItem[
"TYPE"];
2682 $arSetItemParams[
"weight"] = $setItem[
"WEIGHT"];
2683 $arSetItemParams[
"vatRate"] = $setItem[
"VAT_RATE"];
2684 $arSetItemParams[
"setItems"] =
"";
2686 $arSetItemParams[
"setParentId"] =
$productId.
"_tmp".$tmpId;
2687 $arSetItemParams[
"isSetItem"] =
"Y";
2688 $arSetItemParams[
"isSetParent"] =
"N";
2690 $arSetInfo[] = $arSetItemParams;
2698 $storeCount = $productProvider::GetStoresCount(
array(
"SITE_ID" => $LID));
2700 if ($storeCount > 0)
2702 if ($arProductStore = $productProvider::GetProductStores(
array(
"PRODUCT_ID" => $productId,
"SITE_ID" => $LID)))
2703 $arStores = $arProductStore;
2707 $currentTotalPrice = (float)$currentTotalPrice;
2710 $arParams[
"name"] = $arElementInfo[
"~NAME"];
2711 $arParams[
"url"] = htmlspecialcharsex($arElementInfo[
"~DETAIL_PAGE_URL"]);
2712 $arParams[
"urlEdit"] = $arElementInfo[
"EDIT_PAGE_URL"];
2714 $arParams[
"price"] = floatval($arElementInfo[
"PRICE"]);
2715 $arParams[
"priceBase"] = $currentTotalPrice;
2718 $arParams[
"valutaFormat"] = $priceValutaFormat;
2719 $arParams[
"dimensions"] = serialize(
array(
"WIDTH" => $arElementInfo[
"WIDTH"],
"HEIGHT" => $arElementInfo[
"HEIGHT"],
"LENGTH" => $arElementInfo[
"LENGTH"]));
2720 $arParams[
"priceDiscount"] = floatval($arElementInfo[
"DISCOUNT_PRICE"]);
2722 $arParams[
"discountPercent"] = $discountPercent;
2725 $arParams[
"module"] = $arElementInfo[
"MODULE"];
2726 $arParams[
"currency"] = $arElementInfo[
"CURRENCY"];
2727 $arParams[
"weight"] = $arElementInfo[
"WEIGHT"];
2728 $arParams[
"vatRate"] = $arPrice[
"PRICE"][
"VAT_RATE"];
2729 $arParams[
"priceType"] = $arPrice[
"PRICE"][
"CATALOG_GROUP_NAME"];
2731 $arParams[
"notes"] = (!empty($arPrice[
"PRICE"][
"CATALOG_GROUP_NAME"]) ? $arPrice[
"PRICE"][
"CATALOG_GROUP_NAME"] :
"");
2732 $arParams[
"catalogXmlID"] = $arElementInfo[
"~IBLOCK_XML_ID"];
2733 $arParams[
"productXmlID"] = $arElementInfo[
"~XML_ID"];
2738 $arParams[
"productProviderClass"] = $arElementInfo[
"PRODUCT_PROVIDER_CLASS"];
2740 $arParams[
"measureText"] = $arElementInfo[
"MEASURE_TEXT"];
2741 $arParams[
"measureCode"] = $arElementInfo[
"MEASURE_CODE"];
2742 $arParams[
"ratio"] = $arElementInfo[
"RATIO"];
2743 $arParams[
"barcodeMulti"] = $arProduct[
"BARCODE_MULTI"];
2750 $arParams[
"isSetParent"] = empty($arSetInfo) ?
"N" :
"Y";
2753 $arParams[
"productPropsValues"] = $arElementInfo;
while($arIBlock=$rsIBlocks->Fetch()) $catalogIterator
change_password_forgot_link login popup forget pas AUTH_GOTO_FORGOT_FORM login btn wrap change_password_button login popup link login popup return auth javascript
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static setConfig(array $config)
static GetProductSkuProps($ID, $IBLOCK_ID='', $getExt=false)
static GetOptimalPrice($intProductID, $quantity=1, $arUserGroups=array(), $renewal="N", $priceList=array(), $siteID=false, $arDiscountCoupons=false)
static ConvertCurrency($valSum, $curFrom, $curTo, $valDate="")
static GetAdminElementEditLink($IBLOCK_ID, $ELEMENT_ID, $arParams=array(), $strAdd="")
static GetList($arOrder=Array(), $arFilter=Array())
static GetProductProvider($arBasketItem)
static isLocationProMigrated()
static StatusOrder($ID, $val)
static CanUserChangeOrderStatus($ID, $statusID, $arUserGroups=false)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetOrderProps($ORDER_ID)
static DoLoadProfiles($userId, $personTypeId=null)
static getDefaultMeasure($getStub=false, $getExt=false)
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetProductInfo($intOfferID, $intIBlockID=0)
static CurrencyFormat($price, $currency, $useTemplate=true)
static GetCurrencyFormat($currency, $lang=LANGUAGE_ID)
static ResizeImageGet($file, $arSize, $resizeType=BX_RESIZE_IMAGE_PROPORTIONAL, $bInitSizes=false, $arFilters=false, $bImmediate=false, $jpgQuality=false)
static GetFileArray($fileId, $uploadDir=false)
static GetList($arOrder=array("SORT"=>"ASC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetByID($primary, $strLang=LANGUAGE_ID)
static GetList($arOrder=array("ID"=>"DESC"), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array(), $arOptions=array())
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static GetList($arOrder=array(), $arFilter=array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
hidden PROPERTY[<?=$propertyIndex?>][CODE]<?=htmlspecialcharsEx( $propertyCode)?> height
bx popup label bx width30 PAGE_NEW_MENU_NAME text width
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(preg_match('/^ else[a-z0-9_]{2}$/i', $siteID)===1)
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
const BX_RESIZE_IMAGE_PROPORTIONAL
htmlspecialcharsbx($string, $flags=ENT_COMPAT, $doubleEncode=true)
GetMessage($name, $aReplace=null)
randString($pass_len=10, $pass_chars=false)
bitrix_sessid_get($varname='sessid')
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
if(empty($signedUserToken)) $key
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
SaleFormatCurrency($fSum, $strCurrency, $OnlyValue=false, $withoutFormat=false)
GetFormatedUserName($userId, $bEnableId=true, $createEditLink=true)
getProductProps($arElementId, $arSelect)
$arLocation['REGION_NAME']
$GLOBALS['_____370096793']
if( $site[ 'SERVER_NAME']==='') if($site['SERVER_NAME']==='') $arProperties