D
D
Dmitry2017-08-15 14:49:06
PHP
Dmitry, 2017-08-15 14:49:06

How to unload the title of the element instead of the title in 1C Bitrix in uploading a catalog to Yandex.market?

There was such a problem. In Bitrix, in the unloading module in Yandex.Market, the "name" property is unloaded as the name of the product, and we need to make sure that the "element title" property is displayed from the SEO tab
https://yadi.sk/i/0L7n80663M2fEq
In the template, in which displays the product card, it is possible to access this property via $arResult['IPROPERTY_VALUES']['ELEMENT_PAGE_TITLE']
But the ELEMENT_PAGE_TITLE key does not exist in the market handler.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Sidorov, 2017-08-24
@serjazz

The easiest way is to customize the upload file, they are located along the path /bitrix/php_interface/include/catalog_export/yandex_run.php|yandex_setup.php (if you use the standard upload). Customize both files (name differently, but be sure to save the postfix files: _run.php _setup.php).
The unloading code is contained in yandex_run.php. (the file will contain the include file from the kernel, find it, and copy the code of its contents in full to your customized <yourname>_run.php file) . The code for obtaining the properties of a particular product is as follows

$ipropValues = new \Bitrix\Iblock\InheritedProperty\ElementValues(
                        $arCurElem["IBLOCK_ID"], // ID инфоблока
                        $arCurElem["ID"] // ID элемента
                    );
$arElMetaProp = $ipropValues->getValues();

You need to insert it inside the cycle passing through the found goods and pass the required values. (Please note that depending on whether the catalog uses sales offers or not, the place where this code is inserted is determined). I didn’t do it myself, maybe there are more direct ways, without subqueries, but this is the first thing that comes to mind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question