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);
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'] ?? [],
131 parent::buildDescriptions(),
141 $priceTypeList = Catalog\GroupTable::getTypeList();
143 if (!empty($priceTypeList))
145 foreach ($priceTypeList as $priceType)
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;
185 'name' => $fields[
'NAME'],
186 'title' => $fields[
'TITLE'],
189 'priceTypeId' => $fields[
'TYPE_ID'],
192 'affectedFields' => [
193 $fields[
'PRICE_FIELD'],
194 $fields[
'CURRENCY_FIELD'],
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);
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'])
278 $currency = $price->getCurrency();
283 return $currency ?: CurrencyManager::getBaseCurrency();
288 $measureRatio = $this->entity
289 ->getMeasureRatioCollection()
293 return $measureRatio ? $measureRatio->getRatio() :
null;
298 $additionalValues = parent::getAdditionalValues($values,
$descriptions);
301 if ($description[
'entity'] ===
'money' && \
Bitrix\Main\Loader::includeModule(
'currency'))
306 $descriptionData = $description[
'data'];
307 $additionalValues[$descriptionData[
'currency'][
'name']] = $currency;
308 $additionalValues[$descriptionData[
'amount']] = $amount;
309 $additionalValues[$descriptionData[
'formatted']] = \CCurrencyLang::CurrencyFormat($amount, $currency,
false);
310 $additionalValues[$descriptionData[
'formattedWithCurrency']] = \CCurrencyLang::CurrencyFormat($amount, $currency,
true);
316 return $additionalValues;
321 $fieldList = parent::getCatalogProductFieldsList();
322 $fieldList[] =
'AVAILABLE';
getPropertyFeatureCollection()
static signParameters($componentName, $parameters)
static getMessage($code, $replace=null, $language=null)