A
A
Alexander2019-11-09 12:15:56
1C-Bitrix
Alexander, 2019-11-09 12:15:56

How to get locations with names?

How to get locations with names in one or more languages ​​using D7 WITHOUT FILTERING by name existence?
An example from here: https://dev.1c-bitrix.ru/learning/course/index.php...
does not fit because it is simply not signed correctly there - there is an example "Getting a list of locations with names in the current language with names in current language...", and I need "Getting a list of locations with names in the current language"

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2019-11-09
Madzhugin @Suntechnic

$cities = \Bitrix\Sale\Location\LocationTable::getList([
    "select" => ["*", 'NAME_RU' => 'RU_LAN.NAME'],
    'runtime' => [
        'RU_LAN' => [
            'data_type' => \Bitrix\Sale\Location\Name\LocationTable::class,
            'reference' => [
                '=this.ID' => 'ref.LOCATION_ID',
                '=ref.LANGUAGE_ID' => new \Bitrix\Main\DB\SqlExpression('?i', 'ru'),
            ],
            ['join_type' => 'LEFT']
        ],
    ]
])->fetchAll();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question