17 $result = parent::buildDescriptions();
19 return $this->modifyDescriptions($result);
24 $description = parent::getPropertyDescription($property);
27 $description[
'title'] =
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_HEADER_NAME_MORE_PHOTO');
29 $description[
'isEnabledOfferTree'] =
false;
38 foreach ($this->entity->getPropertyCollection() as $property)
70 'VAT_ID',
'VAT_INCLUDED',
71 'SHOW_COUNTER',
'CODE',
'TIMESTAMP_X',
'MODIFIED_BY',
72 'DATE_CREATE',
'XML_ID',
85 $result = parent::getProductFieldHeaders($fields, $defaultWidth);
92 $index = $this->getIndexFieldDescription(
$headers,
'id', static::formatFieldName(
'AVAILABLE'));
98 'TYPE' => Types::CHECKBOX,
101 $row[
'default'] =
true;
120 $headerName = static::getHeaderName(
'PURCHASING_PRICE');
123 'id' => static::formatFieldName(
'PURCHASING_PRICE_FIELD'),
124 'name' => $headerName[
'NAME'],
125 'title' => $headerName[
'TITLE'],
126 'sort' =>
'PURCHASING_PRICE',
132 'TYPE' => Types::MONEY,
133 'CURRENCY_LIST' => CurrencyManager::getSymbolList(),
134 'HTML_ENTITY' =>
true,
138 'width' => $defaultWidth,
148 $iblockInfo = ServiceContainer::getIblockInfo($this->entity->getIblockId());
152 return 'catalog-product-service-grid-' . $iblockInfo->getProductIblockId();
155 return 'catalog-product-service-grid';
161 $result[
'VAT_INCLUDED'] = [
163 static::formatFieldName(
'VAT_ID'),
164 static::formatFieldName(
'VAT_INCLUDED'),
166 'TITLE' =>
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_SETTINGS_TITLE_VAT_INCLUDED'),
167 'DESCRIPTION' =>
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_SETTINGS_DESC_VAT_INCLUDED'),
169 if (AccessController::getCurrent()->check(ActionDictionary::ACTION_PRODUCT_PURCHASE_INFO_VIEW))
171 $result[
'PURCHASING_PRICE_FIELD'] = [
173 static::formatFieldName(
'PURCHASING_PRICE_FIELD'),
175 'TITLE' =>
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_SETTINGS_TITLE_PURCHASING_PRICE'),
176 'DESCRIPTION' =>
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_SETTINGS_DESC_PURCHASING_PRICE'),
188 case 'PURCHASING_PRICE_FIELD':
189 if (AccessController::getCurrent()->check(ActionDictionary::ACTION_PRODUCT_PURCHASE_INFO_VIEW))
192 'PURCHASING_PRICE_FIELD',
206 $id = static::formatFieldName($id);
215 $headerName =
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_HEADER_NAME_' . $code);
216 $headerTitle =
Loc::getMessage(
'CATALOG_SERVICE_CARD_VARIATION_GRID_HEADER_TITLE_' . $code);
219 'NAME' => $headerName,
220 'TITLE' => $headerTitle ?? $headerName,
224 private function modifyDescriptions(array
$descriptions): array
231 private function modifyAvailableDescription(array
$descriptions): array
233 $index = $this->getIndexFieldDescription(
$descriptions,
'originalName',
'AVAILABLE');
238 $row[
'defaultValue'] =
'Y';
245 private function getIndexFieldDescription(array $description,
string $key,
string $fieldName): ?int
249 foreach (array_keys($description) as $index)
251 if ($description[$index][$key] === $fieldName)
static getMessage($code, $replace=null, $language=null)