• Resolved gossamerzzz

    (@gossamerzzz)


    Hello! I have a xml file consisting of several parts. In the first part you need to load categories. In the second part, you need to download the product in which the categories are marked by id.
    category
    <category id="277" parentId="275">Interior</category>
    offer

    <offer id="21772" available="true" type="vendor.model">
    -<url>
    https://www.posuda.ru/catalog/nabory_posudy_5/21772/
    </url>
    -<name>
    Set of kitchen utensils CALVE, 7 pieces
    </name>
    <price>4890.6</price>
    <oldprice/>
    <rrc>6113.00</rrc>
    <currencyId>RUR</currencyId>
    <categoryId>1010</categoryId>
    -<picture>
    https://www.posuda.ru/upload/partners/PosudaRu/21772_.jpeg
    </picture>
    +<picture></picture>
    <vendor>CALVE</vendor>
    <vendorCode>CL-1879</vendorCode>
    <param name="Material">Нержавеющая сталь</param>
    <param name="Series"/>
    <param name="barcode">4895124471876</param>
    <param name="weight">4196</param>
    -<description>
    <b> Stainless Steel Cookware Set </b> торговой марки <b> CALVE </b>
    </description>
    <country_of_origin>CHINA</country_of_origin>
    <ostatok>1</ostatok>
    </offer>

    Can you please tell me how to download the categories on woocommerce by category id and parentId and download the name of category? And how can I load goods with the category id instead of the name?
    Is it possible to use “Custom Fields” or “Advanced Custom Fields” for this?
    Thank you!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter gossamerzzz

    (@gossamerzzz)

    It is necessary in some way to add 2 fields term_id(categoryId) and parent(parentCategoryId). That would be possible to select the import the name of the category or her id.

    Thread Starter gossamerzzz

    (@gossamerzzz)

    I tried to do it in different ways. Nothing yet does not work. Maybe you can tell me how to implement this task? The matter is that this version of uploading is constantly coming to me in work.
    In general, your plug-in is beautiful and meets all the requirements. Thank you for your efforts.

    Plugin Author WP All Import

    (@wpallimport)

    Hi @gossamerzzz

    There are a couple of ways to do this:

    1) Use our Category Mapping Tool: see screenshot.

    2) Store the ID inside Term Meta when importing the categories, then use our API (see documentation) or a PHP Function (see documentation) when importing the products. Your code will look up the proper category based on the term meta and return the “name” or “slug” for the category.

    Thread Starter gossamerzzz

    (@gossamerzzz)

    Thank you for the answer! But the fact is that I have a multistore project. For each store, entering categories is problematic, considering that there are more than 1000 of them. Perhaps this can be done through component “Custom Fields”. If you enter fields “term_id” and “parent”. But after trying to make the import of these fields, for some reason, it did not work. Perhaps you need additional settings or can it be done through component ACF(Advanced Custom Fields)? So that it would be possible to associate a column in the MySQL database together with the fields of the imported XML file.

    Thread Starter gossamerzzz

    (@gossamerzzz)

    Is there really nothing you can do about it? In our country the main site has the standard of YML and all stores have unloading XML by their standards. In this unloading there is a first unloading of categories.
    category
    <category id="277" parentId="275">Interior</category>
    Then there is an unloading of goods from the category id.

    Thread Starter gossamerzzz

    (@gossamerzzz)

    In this form we export our XML files https://productorg.ru/market.php

    Plugin Author WP All Import

    (@wpallimport)

    Hi @gossamerzzz

    The best way to handle it is option 2 mentioned above – import the categories and store the ID(s) as term meta. That way, you can reference that data later with PHP functions and/or our API.

    Unfortunately, we can’t write the code for this custom solution.

    Thread Starter gossamerzzz

    (@gossamerzzz)

    Hello! Please tell me how to correctly write the functions for import with item “New Import”– “Taxonomies” – “Product categories” for entering data
    category
    <category id="277" parentId="275">Interior</category>
    so that id categories register in the database in the field “term_id(categoryId)”
    And then what function should be written, what would be the import “New Import”– “WooCommerce Products” for entering data
    offer

    <offer id="21772" available="true" type="vendor.model">
    -<url>
    https://www.posuda.ru/catalog/nabory_posudy_5/21772/
    </url>
    -<name>
    Set of kitchen utensils CALVE, 7 pieces
    </name>
    <price>4890.6</price>
    <oldprice/>
    <rrc>6113.00</rrc>
    <currencyId>RUR</currencyId>
    <categoryId>1010</categoryId> ---!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    -<picture>
    https://www.posuda.ru/upload/partners/PosudaRu/21772_.jpeg
    </picture>
    +<picture></picture>
    <vendor>CALVE</vendor>
    <vendorCode>CL-1879</vendorCode>
    <param name="Material">Нержавеющая сталь</param>
    <param name="Series"/>
    <param name="barcode">4895124471876</param>
    <param name="weight">4196</param>
    -<description>
    <b> Stainless Steel Cookware Set </b> торговой марки <b> CALVE </b>
    </description>
    <country_of_origin>CHINA</country_of_origin>
    <ostatok>1</ostatok>
    </offer>

    So that “id” categories “term_id(categoryId)” are associated with already existing categories in the database. Goods at the same time were brought into the database in the required categories, not by the names of the categories, but by their “id” categories “term_id(categoryId)”.

    I can not do it without your help. The question is very important to them all are constantly interested in the forums. As I said in our XML files are only on this sample. Therefore, your answer will help many people at once. Thank you very much for your cooperation.

    • This reply was modified 7 years, 7 months ago by gossamerzzz.
    • This reply was modified 7 years, 7 months ago by gossamerzzz.
    Thread Starter gossamerzzz

    (@gossamerzzz)

    Hello! Everything was repetitive and there was only one option – the functions. Prompt please how to register replacement of an id of a category on its name in the function. I need to do more than 1000 categories, so I need a massive filling option. When I make a replacement one by one is obtained for a long time to register and the replacement itself is very slow during import. Please write an example of the function of mass replacement and where to insert it?

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘wp all import by categoryID’ is closed to new replies.