3namespace Bitrix\Catalog\Component;
5use Bitrix\Catalog\Config\State;
6use Bitrix\Catalog\v2\Property\Property;
7use Bitrix\Currency\CurrencyManager;
8use Bitrix\Main\Component\ParameterSigner;
9use Bitrix\Main\Localization\Loc;
24 $controllers = parent::getControllers();
27 'name' =>
'VARIATION_GRID_CONTROLLER',
28 'type' =>
'variation_grid',
30 'reloadUrl' =>
'/bitrix/components/bitrix/catalog.productcard.variation.grid/list.ajax.php',
36 'name' =>
'IBLOCK_SECTION_CONTROLLER',
37 'type' =>
'iblock_section',
46 $description = parent::getPropertyDescription($property);
48 $propertyFeatureOfferTree = $property->getPropertyFeatureCollection()->findByFeatureId(
'OFFER_TREE');
49 $offerTreeParams = $propertyFeatureOfferTree ? $propertyFeatureOfferTree->getSettings() :
null;
53 $description[
'isEnabledOfferTree'] = $offerTreeParams[
'IS_ENABLED'] ===
'Y';
61 $config = parent::collectFieldConfigs();
63 $config[
'right'][
'elements'][] = [
64 'name' =>
'variation_grid',
65 'title' =>
'Variation grid',
66 'type' =>
'included_area',
68 'isRemovable' =>
false,
69 'type' =>
'component',
71 'action' =>
'getProductGrid',
73 'signedParametersName' =>
'VARIATION_GRID_SIGNED_PARAMETERS',
83 return 'bitrix:catalog.productcard.variation.grid';
88 $variationIdList =
null;
89 $variationId = $this->params[
'VARIATION_ID'] ??
null;
90 if (!empty($variationId))
92 $variationIdList = [$this->params[
'VARIATION_ID']];
96 'IBLOCK_ID' => $this->params[
'IBLOCK_ID'] ??
null,
97 'PRODUCT_ID' => $this->params[
'PRODUCT_ID'] ??
null,
98 'VARIATION_ID_LIST' => $variationIdList,
99 'COPY_PRODUCT_ID' => $this->params[
'COPY_PRODUCT_ID'] ??
null,
100 'EXTERNAL_FIELDS' => $this->params[
'EXTERNAL_FIELDS'] ??
null,
101 'PATH_TO' => $this->params[
'PATH_TO'] ?? [],
107 return ParameterSigner::signParameters(
131 parent::buildDescriptions(),
147 $title = !empty($priceType[
'NAME_LANG']) ? $priceType[
'NAME_LANG'] : $priceType[
'NAME'];
151 'NAME' => $priceFieldName.
'_FIELD',
152 'TYPE_ID' => (
int)$priceType[
'ID'],
154 'PRICE_FIELD' => $priceFieldName,
160 $purchasingPriceFieldName = static::formatFieldName(
'PURCHASING_PRICE');
164 'NAME' => $purchasingPriceFieldName.
'_FIELD',
165 'TYPE_ID' =>
'PURCHASING_PRICE',
166 'TITLE' => Loc::getMessage(
'CATALOG_C_F_VARIATION_SETTINGS_PURCHASING_PRICE_FIELD_TITLE'),
167 'PRICE_FIELD' => $purchasingPriceFieldName,
168 'CURRENCY_FIELD' => static::formatFieldName(
'PURCHASING_CURRENCY'),
171 if (State::isUsedInventoryManagement())
173 $purchasingPriceDescription[
'editable'] =
false;
189 'priceTypeId' =>
$fields[
'TYPE_ID'],
192 'affectedFields' => [
197 'name' =>
$fields[
'CURRENCY_FIELD'],
200 'amount' => $fields[
'PRICE_FIELD'],
201 'formatted' =>
'FORMATTED_'.$fields[
'PRICE_FIELD'].
'_PRICE',
202 'formattedWithCurrency' =>
'FORMATTED_'.$fields[
'PRICE_FIELD'].
'_WITH_CURRENCY',
211 'entity' =>
'measure_ratio',
212 'name' => static::formatFieldName(
'MEASURE_RATIO'),
213 'title' => Loc::getMessage(
'CATALOG_C_F_VARIATION_SETTINGS_MEASURE_RATIO_TITLE'),
224 if ($field[
'entity'] ===
'price')
229 if ($field[
'entity'] ===
'currency')
234 if ($field[
'entity'] ===
'measure_ratio')
239 return parent::getFieldValue($field);
244 return [self::MORE_PHOTO];
249 if ($field[
'priceTypeId'] ===
'PURCHASING_PRICE')
251 return $this->entity->getField(
'PURCHASING_PRICE');
254 $price = $this->entity
255 ->getPriceCollection()
256 ->findByGroupId($field[
'priceTypeId'])
259 return $price ? $price->getPrice() :
null;
266 if ($field[
'priceTypeId'] ===
'PURCHASING_PRICE')
268 $currency = $this->entity->getField(
'PURCHASING_CURRENCY');
272 $price = $this->entity
273 ->getPriceCollection()
274 ->findByGroupId($field[
'priceTypeId'])
282 return $currency ?: (string)CurrencyManager::getBaseCurrency();
287 $measureRatio = $this->entity
288 ->getMeasureRatioCollection()
292 return $measureRatio ? $measureRatio->getRatio() :
null;
297 $additionalValues = parent::getAdditionalValues($values,
$descriptions);
306 $additionalValues[$descriptionData[
'currency'][
'name']] =
$currency;
307 $additionalValues[$descriptionData[
'amount']] =
$amount;
308 $additionalValues[$descriptionData[
'formatted']] = \CCurrencyLang::CurrencyFormat(
$amount,
$currency,
false);
309 $additionalValues[$descriptionData[
'formattedWithCurrency']] = \CCurrencyLang::CurrencyFormat(
$amount,
$currency,
true);
315 return $additionalValues;
320 $fieldList = parent::getCatalogProductFieldsList();
321 $fieldList[] =
'AVAILABLE';
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
if(!function_exists("bx_hmac")) $amount
if(!empty($XML_DATA['PRICE'])) $priceTypeList