A
A
Alexey2019-02-14 15:20:22
opencart
Alexey, 2019-02-14 15:20:22

Importing OpenCart products from tools.by?

Good afternoon!
Maybe someone faced such a problem:
On the site tools.by there is an opportunity to export goods yml.
I installed the opencart module "Import YML". When I try to import products, everything imports fine EXCEPT the categories.
It gives the following error:
5c655c006ca0a800996952.png
In fact, there are only 2 errors (red and blue), but the red one pops up 1 time, and the blue one for each product.
Code lines:
214)

foreach ($categories->category as $category) {
        $categoriesList[ (string)$category['id'] ] = array(
            'parent_id'   => (int)$category['parentId'],
            'name'        => trim((string)$category)
        );
    }

381)
$data = array(
        'product_description' => $product_description,
        'product_special' => array (),
        'product_store' => array(0),
        'main_category_id' => $id_category,
        'product_category' => array (
          $id_category,
        ),

Thank you all in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Z
zoozag, 2019-02-15
@zoozag

1. Log $categories->category, or better just $categories. There it will be clear what is wrong with the categories.
2. You are using an undeclared $id_category variable. Perhaps the first mistake will solve this issue. If not. Just look where you can get the id of the product category and substitute it into the array.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question