- Модуль: catalog
- Путь к файлу: ~/bitrix/modules/catalog/lib/component/variationform.php
- Класс: BitrixCatalogComponentVariationForm
- Вызов: VariationForm::getPriceDescriptions
protected function getPriceDescriptions(): array
{
$descriptions = [];
$priceTypeList = CatalogGroupTable::getTypeList();
if (!empty($priceTypeList))
{
foreach ($priceTypeList as $priceType)
{
$title = !empty($priceType['NAME_LANG']) ? $priceType['NAME_LANG'] : $priceType['NAME'];
$priceFieldName = static::formatFieldName(BaseForm::PRICE_FIELD_PREFIX.$priceType['ID']);
$descriptions[] = $this->preparePriceDescription([
'NAME' => $priceFieldName.'_FIELD',
'TYPE_ID' => (int)$priceType['ID'],
'TITLE' => $title,
'PRICE_FIELD' => $priceFieldName,
'CURRENCY_FIELD' => static::formatFieldName(BaseForm::CURRENCY_FIELD_PREFIX.$priceType['ID']),
]);
}
}
$purchasingPriceFieldName = static::formatFieldName('PURCHASING_PRICE');
if ($this->isPurchasingPriceAllowed())
{
$purchasingPriceDescription = $this->preparePriceDescription([
'NAME' => $purchasingPriceFieldName.'_FIELD',
'TYPE_ID' => 'PURCHASING_PRICE',
'TITLE' => Loc::getMessage('CATALOG_C_F_VARIATION_SETTINGS_PURCHASING_PRICE_FIELD_TITLE'),
'PRICE_FIELD' => $purchasingPriceFieldName,
'CURRENCY_FIELD' => static::formatFieldName('PURCHASING_CURRENCY'),
]);
if (State::isUsedInventoryManagement())
{
$purchasingPriceDescription['editable'] = false;
}
$descriptions[] = $purchasingPriceDescription;
}
return $descriptions;
}