44 if(!static::$jsInited)
46 \Bitrix\Main\Page\Asset::getInstance()->addJs(
"/bitrix/js/sale/admin/order_basket.js");
47 \Bitrix\Main\Page\Asset::getInstance()->addJs(
"/bitrix/js/sale/admin/discount_preset_basket.js");
48 static::$jsInited =
true;
51 $langPhrases = array(
"SALE_ORDER_BASKET_TURN",
"SALE_ORDER_BASKET_EXPAND",
"SALE_ORDER_BASKET_UP_RATIO",
52 "SALE_ORDER_BASKET_PROD_EDIT",
"SALE_ORDER_BASKET_DOWN_RATIO",
"SALE_ORDER_BASKET_PROD_COUNT",
53 "SALE_ORDER_BASKET_NO_PICTURE",
"SALE_ORDER_BASKET_PROD_CREATE",
"SALE_ORDER_BASKET_ROW_SETTINGS",
54 "SALE_ORDER_BASKET_PROD_MENU_EDIT",
"SALE_ORDER_BASKET_PROD_MENU_DELETE",
"SALE_ORDER_BASKET_BASE_CATALOG_PRICE",
55 "SALE_ORDER_BASKET_PROD_EDIT_ITEM_SAVE",
"SALE_ORDER_BASKET_KG",
"SALE_ORDER_BASKET_COUPON",
56 "SALE_ORDER_BASKET_COUPON_STATUS",
"SALE_ORDER_BASKET_COUPON_APPLY",
"SALE_ORDER_BASKET_COUPON_DELETE",
57 "SALE_ORDER_BASKET_POSITION_EXISTS",
"SALE_ORDER_BASKET_ADD_COUPON_ERROR"
59 $result =
'<script type="text/javascript">';
61 foreach($langPhrases as $phrase)
62 $result .=
' BX.message({'.$phrase.
': "'.\CUtil::jsEscape(
Loc::getMessage($phrase)).
'"});';
65 $data = static::prepareData();
70 tableId: "'.$this->idPrefix.
'sale_order_edit_product_table",
71 idPrefix: "'.$this->idPrefix.
'",
72 visibleColumns: '.\CUtil::phpToJSObject($this->visibleColumns).
',
73 objName: "'.$this->jsObjName.
'",
74 createProductBasement: '.($this->createProductBasement ?
'true' :
'false').
',
75 columnsCount: '.count($this->visibleColumns).
',
76 createBasketBottom: false,
77 isShowXmlId: '.($this->isShowXmlId ?
'true' :
'false').
',
79 unRemovableFields: [],
80 formatQuantity: "'.Option::get(
'sale',
'format_quantity',
'AUTO').
'",
81 weightUnit: "'.$this->weightUnit.
'"
87 obParams.productsOrder = '.\CUtil::phpToJSObject(
$data[
"ITEMS_ORDER"]).
';
88 obParams.products = '.\CUtil::phpToJSObject(
$data[
"ITEMS"]).
';
89 obParams.iblocksSkuParams = '.\CUtil::phpToJSObject(
$data[
"IBLOCKS_SKU_PARAMS"]).
';
90 obParams.iblocksSkuParamsOrder = '.\CUtil::phpToJSObject(
$data[
"IBLOCKS_SKU_PARAMS_ORDER"]).
';
91 obParams.productsOffersSkuParams = '.\CUtil::phpToJSObject(
$data[
"PRODUCTS_OFFERS_SKU"]).
';';
95 $this->jsObjName.
'= new BX.Sale.Admin.PresetBasket(obParams);
96 BX.Sale.Admin.OrderEditPage.registerFieldsUpdaters( '.$this->jsObjName.
'.getFieldsUpdaters() );
99 $result .= $this->settingsDialog->getScripts();
101 $result .=
'</script>';
108 <div class="adm-s-gray-title" style="padding-right: 2px;">
109 '.Loc::getMessage(
"SALE_ORDER_BASKET_COMPOSITION").
'
110 <div class="adm-s-gray-title-btn-container">
112 class="adm-btn adm-btn-green adm-btn-add"
113 onClick="'.$this->jsObjName.
'.addProductSearch({lang: \''.LANGUAGE_ID.
'\', siteId: \
''.$this->order->getSiteId().
'\', orderId:
'.intval($this->order->getId()).'});
"
115 Loc::getMessage("SALE_ORDER_BASKET_PRODUCT_ADD
").
118 <div class="clb
"></div>
122 <div class="adm-s-order-table-ddi
">
123 <table class="adm-s-order-table-ddi-table
" style="width: 100%;
" id="'.$this->idPrefix.'sale_order_edit_product_table
">
124 <thead style="text-align: left;
">
129 foreach($this->visibleColumns as $name)
130 $result .= "<td>
".htmlspecialcharsbx($name)."</td>
";
138 <tbody style="border: 1px solid rgb(221, 221, 221);
" id="'.$this->idPrefix.'sale-adm-order-basket-loading-row
">
140 <td colspan="'.(count($this->visibleColumns)+1).'" style="padding: 20px;
">
141 <img src="/
bitrix/images/sale/admin-loader.gif
"/>
148 <tbody style="border: 1px solid rgb(221, 221, 221);
'.($defTails ? ' display:none;
' : '').'" id="'.$this->idPrefix.'sale-adm-order-edit-basket-empty-row
">
150 <td colspan="'.(count($this->visibleColumns)+1).'" style="padding: 20px;
">
151 '.Loc::getMessage("SALE_ORDER_BASKET_EMPTY_ROW
").'.
159 <div class="adm-s-gray-title
" style="padding-right: 2px;
">
160 <div class="adm-s-gray-title-btn-container
">';
163 class="adm-btn adm-btn-green adm-btn-add
"
164 onClick="'.$this->jsObjName.'.addProductSearch({lang: \
''.LANGUAGE_ID.
'\', siteId: \
''.$this->order->getSiteId().
'\', index: 1, orderId:
'.intval($this->order->getId()).'});
"
166 Loc::getMessage("SALE_ORDER_BASKET_PRODUCT_ADD
").
169 <div class="clb
"></div>
171 <input type="hidden
" name="BASKET[ID_PREFIX]
" value="'.$this->idPrefix.'">
172 <div class="adm-s-result-container
">';
176 <div class="clb
"></div>';