A
A
Alexey Blagorodov2021-12-17 12:37:16
Bitrix24
Alexey Blagorodov, 2021-12-17 12:37:16

Export of goods to Bitrix - how to display the values ​​of the MORE_PHOTO property in one cell separated by commas?

I have an online store. On the product page, I want to display multiple images using MORE_PHOTO . But at the same time, so that when exporting and importing goods in EXCEL , several lines are not created for each product .

I solved the problem with importing goods to the site as follows:
Before this line in the php file /bitrix/modules/catalog/load_import/csv_new_run.php:

elseif ($arIBlockProperty[$cur_prop_id]["PROPERTY_TYPE"]=="F")


I pasted the following:

elseif ($arIBlockProperty[$cur_prop_id]["PROPERTY_TYPE"]=="F" && $arIBlockProperty[$cur_prop_id]["MULTIPLE"]=="Y")
                            {
                                $files = explode(',', $arRes[$i]);

                                $arFileFields = [];

                                foreach ($files as $file)
                                {
                                    $file = trim($file);

                                    if(preg_match("/^(ftp|ftps|http|https):\\/\\//", $file))
                                        $file = CFile::MakeFileArray($file);
                                    else
                                        $file = CFile::MakeFileArray($io->GetPhysicalName($_SERVER["DOCUMENT_ROOT"].$PATH2IMAGE_FILES.'/'.$file));

                                    $arFileFields[] =  ['VALUE' => $file, 'DESCRIPTION' => ''];
                                }

                                $PROP[$cur_prop_id] = $arFileFields;
                                continue;
                            }


Now, when importing products in a CSV file, I can insert links to images separated by commas in the MORE_PHOTO cell. But when exporting this table, for each product, a separate row is created for each value of this cell:

61bc5a1a79570281491268.jpeg

How can I configure the export so that these values ​​are in one cell, separated by commas?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question