14 $storeId = (int)$storeId;
18 if (!isset(self::$storeNames[$storeId]))
20 $storeIterator = CCatalogStore::GetList(
22 array(
'ID' => $storeId),
25 array(
'ID',
'ADDRESS',
'TITLE')
28 if ($store = $storeIterator->Fetch())
30 $store[
'ID'] = (int)$store[
'ID'];
31 $store[
'ADDRESS'] = (string)$store[
'ADDRESS'];
32 $store[
'TITLE'] = (string)$store[
'TITLE'];
33 $storeName = ($store[
'TITLE'] !==
'' ? $store[
'TITLE'].
' ('.$store[
'ADDRESS'].
')' : $store[
'ADDRESS']);
35 unset($store, $storeIterator);
36 self::$storeNames[$storeId] = $storeName;
40 $storeName = self::$storeNames[$storeId];
52 $elementId = (int)$elementId;
56 $dbProduct = CIBlockElement::GetList(
58 array(
"ID" => $elementId),
61 array(
'ID',
'IBLOCK_ID',
'IBLOCK_SECTION_ID',
'DETAIL_PICTURE',
'PREVIEW_PICTURE',
'NAME',
'XML_ID')
63 $arProduct = $dbProduct->GetNext();
65 if (empty($arProduct))
70 if($arProduct[
"IBLOCK_ID"] > 0)
72 $arProduct[
"EDIT_PAGE_URL"] = CIBlock::GetAdminElementEditLink(
73 $arProduct[
"IBLOCK_ID"],
75 [
"find_section_section" => $arProduct[
"IBLOCK_SECTION_ID"]]
80 if($arProduct[
"DETAIL_PICTURE"] > 0)
82 $imgCode = $arProduct[
"DETAIL_PICTURE"];
84 elseif($arProduct[
"PREVIEW_PICTURE"] > 0)
86 $imgCode = $arProduct[
"PREVIEW_PICTURE"];
91 $arFile = CFile::GetFileArray($imgCode);
93 $arProduct[
"IMG_URL"] = $arImgProduct[
'src'];
103 public static function getFields(
string $docType): ?
array
105 if($docType !==
'' && isset(CCatalogDocs::$types[$docType]))
108 $documentClass = CCatalogDocs::$types[$docType];
109 return $documentClass::getFields();
114 public static function getTypeFields(
string $docType): ?
array
116 if ($docType !==
'' && isset(CCatalogDocs::$types[$docType]))
122 'DOCUMENT' => $documentClass::getDocumentFields(),
123 'ELEMENT' => $documentClass::getElementFields(),
138 $numberDisplayedElements = intval($numberDisplayedElements);
139 if($numberDisplayedElements < 1)
140 $numberDisplayedElements = 1;
141 if(is_array($arProduct))
143 foreach($arProduct as
$key => $product)
146 if(
$key >= ($numberDisplayedElements - 1))
148 $strError .=
"\n...".GetMessage(
"CAT_DOC_AND_MORE",
array(
"#COUNT#" => (
count($arProduct) - $numberDisplayedElements)));
160 return $DB->Query(
"SELECT SUM(SP.AMOUNT) as SUM, CP.QUANTITY_RESERVED as RESERVED FROM b_catalog_store_product SP INNER JOIN b_catalog_product CP ON SP.PRODUCT_ID = CP.ID INNER JOIN b_catalog_store CS ON SP.STORE_ID = CS.ID WHERE SP.PRODUCT_ID = ".$productId.
" AND CS.ACTIVE = 'Y' GROUP BY QUANTITY_RESERVED ",
true);
165 $storeId = (int)$storeId;
168 if (isset(self::$storeNames[$storeId]))
169 unset(self::$storeNames[$storeId]);
175 self::$storeNames =
array();
180 $active = ($active ===
true);
181 self::$storeNames =
array();
183 $storeIterator = CCatalogStore::GetList(
188 array(
'ID',
'ADDRESS',
'TITLE')
190 while ($store = $storeIterator->Fetch())
192 $store[
'ID'] = (int)$store[
'ID'];
193 $store[
'ADDRESS'] = (string)$store[
'ADDRESS'];
194 $store[
'TITLE'] = (string)$store[
'TITLE'];
195 self::$storeNames[$store[
'ID']] = ($store[
'TITLE'] !==
'' ? $store[
'TITLE'].
' ('.$store[
'ADDRESS'].
')' : $store[
'ADDRESS']);
197 unset($store, $storeIterator,
$filter);
209 if (empty($fieldList))
215 $requestFields =
$request->getPostList();
216 foreach ($fieldList as $fieldId)
218 if (!is_string($fieldId) || $fieldId ===
'')
222 if (isset($requestFields[$fieldId]) && is_array($requestFields[$fieldId]))
224 foreach ($requestFields[$fieldId] as $rowId => $value)
228 if (preg_match(
'/^[0-9]+$/', $rowId, $parsed))
234 elseif (preg_match(
'/^n[0-9]+$/', $rowId, $parsed))
246 if (is_array($value))
248 $fileRow[
'FILE_UPLOAD'] = \CIBlock::makeFileArray(
252 elseif (is_string($value))
254 if (preg_match(
'/^[0-9]+$/', $value, $parsed))
256 $fileRow[
'FILE_ID'] = (int)$value;
272 $result[$fieldId][$rowId] = $fileRow;
276 $deleteFieldId = $fieldId .
'_del';
277 if (isset($requestFields[$deleteFieldId]) && is_array($requestFields[$deleteFieldId]))
279 foreach ($requestFields[$deleteFieldId] as $rowId => $value)
286 if (!preg_match(
'/^[0-9]+$/', $rowId, $parsed))
290 $rowId = (int)$rowId;
296 isset(
$result[$fieldId][$rowId])
297 && isset(
$result[$fieldId][$rowId][
'FILE_ID'])
300 $result[$fieldId][$rowId][
'DEL'] = $value;
324 if (empty($fieldList))
330 $requestFields =
$request->getPostList();
331 foreach ($fieldList as $fieldId)
333 if (!is_string($fieldId) || $fieldId ===
'')
337 if (isset($requestFields[$fieldId]))
339 $value = $requestFields[$fieldId];
342 if (is_array($value))
344 $fileRow[
'FILE_UPLOAD'] = \CIBlock::makeFileArray(
348 elseif (is_string($value))
351 if (preg_match(
'/^[0-9]+$/', $value, $parsed))
353 $fileRow[
'FILE_ID'] = (int)$value;
357 if (!empty($fileRow))
363 $deleteFieldId = $fieldId .
'_del';
364 if (isset($requestFields[$deleteFieldId]) && $requestFields[$deleteFieldId] ===
'Y')
366 if (isset(
$result[$fieldId]) && isset(
$result[$fieldId][
'FILE_ID']))
368 $result[$fieldId][
'DEL'] =
'Y';
384 if (\
Bitrix\Main\ModuleManager::isModuleInstalled(
'crm'))
389 return \Bitrix\Main\Config\Option::get(
'catalog',
'show_store_shipping_center') ===
'Y';
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
static getProductInfo($elementId)
static getStoreName($storeId)
static getFilesFromPost(\Bitrix\Main\HttpRequest $request, array $fieldList)
static getMultipleFilesFromPost(\Bitrix\Main\HttpRequest $request, array $fieldList)
static clearAllStoreNames()
static showErrorProduct($arProduct, $numberDisplayedElements=10)
static loadAllStoreNames($active=true)
static isAllowShowShippingCenter()
static getQuantityInformation($productId)
static clearStoreName($storeId)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
const BX_RESIZE_IMAGE_PROPORTIONAL
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
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."%"