- Модуль: catalog
- Путь к файлу: ~/bitrix/modules/catalog/lib/component/gridvariationform.php
- Класс: BitrixCatalogComponentGridVariationForm
- Вызов: GridVariationForm::getValues
public function getValues(bool $allowDefaultValues = true, array $descriptions = null): array
{
$values = $this->getShowedValues($allowDefaultValues);
foreach ($this->getDescriptions() as $description)
{
$name = $description['name'];
if (!isset($values[$name]))
{
continue;
}
switch ($description['type'])
{
case 'custom':
$values[$name] = $values[$description['data']['view']];
break;
case 'money':
$descriptionData = $description['data'];
$values[$name] = [
'PRICE' => [
'NAME' => $descriptionData['amount'],
'VALUE' => $values[$descriptionData['amount']],
],
'CURRENCY' => [
'NAME' => $descriptionData['currency']['name'],
'VALUE' => $values[$descriptionData['currency']['name']],
],
];
break;
case 'boolean':
$descriptionData = $description['data'] ?? [];
$variants = $descriptionData['items'] ?? [];
foreach ($variants as $variant)
{
if ($values[$name] === $variant['ID'])
{
$values[$name] = $variant['NAME'];
break;
}
}
break;
}
}
return $values;
}