B
B
Boris2021-04-12 02:59:36
Python
Boris, 2021-04-12 02:59:36

How to push goods into Bitrix (store) with minimal effort?

How to fill a fresh (empty) Bitrix store with available products using Python? It is possible directly to the database, but I did not find the description of the tables (in the docks they want all APIs to be used, but everything is confusing there). I saw a lib for Bitrix24, but I didn’t find it for the usual one. Is there anything as convenient as for WooCommerce? In order not to dive deep and not understand php. And what other solution can you advise from experience ...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Ex1st, 2021-04-12
@Ex1st

Import products via XML/CSV?

E
Egor, 2021-04-12
@failure_knight

It is better to really access the database through the API. Bitrixoids were directly banned by some fraud. That is, you will connect to the database, but you won’t be able to make requests from python.
Through the API, in fact, it is done in a few lines:
To begin with, inherit the class that will make requests from Entity\DataManager.
Then, in the constructor write:

$connect = Application::getConnection();
        $this->connect = $connect;
        $sqlHelper = $connect->getSqlHelper();

This will create a DB object.
Done, now you can make requests.
$sql = "ВАШ ЗАПРОС;";
$recordset = $this->connect->query($sql);

If you want to get the results of the query and somehow change or use them, then here:
while ($record = $recordset->fetch(\Bitrix\Main\Text\Converter::getHtmlConverter()))
        {
            $data[] = $record;
        }

In this piece, information is written to the $data array.
The instruction, of course, is for PHP, but all this joy can be performed in python, here I advise you to just google it. For example, something like this: https://ruphp.com/python-php-3.html
Or, as described here: https://askdev.ru/q/vypolnenie-php-koda-v-python-1. ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question