Answer the question
In order to leave comments, you need to log in
How to add custom parameter to catalog.element?
Good day!
You need to add your own parameter to catalog.element.
In the catalog component, I add my own parameter to the .parameters.php file
"DISCOUNT_FOR_RECRUITMENT" => Array(
"PARENT" => "DETAIL_SETTINGS",
"NAME" => 'Размер скидки для набора %',
//"VALUE" => '20',
"TYPE" => "STRING",
"DEFAULT" => "20",
),
Answer the question
In order to leave comments, you need to log in
.parameters.php and is needed in order to see the parameters through a visual editor for ease of administration, but the component itself gets the parameters that are passed to the component call (method). Those. it is necessary
- either to resave the component through the visual editor
- or manually add the name and value of the parameter to the component call code.
If the component is complex, then the parameter must be passed to the simple component call code
"DISCOUNT_FOR_RECRUITMENT" => $arParams["DISCOUNT_FOR_RECRUITMENT"]
It is necessary to write
in /aspro_next/components/bitrix/catalog/main/page_blocks/element_5.php
"DISCOUNT_FOR_RECRUITMENT" => $arParams['DISCOUNT_FOR_RECRUITMENT'],
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question