Since the categories are listed separately, and are based on IDs, you will need to import them first in a "Taxonomies" import:
On step 2 of the import, choose the "category" element:
On step 3 (the import template), you'll need to save the "id" attribute inside a term meta field named "_category_id":
And, use an IF statement along with a custom PHP function (see documentation) in the "Parent Term" field:
[IF({./@parentId[.!=""]})][my_get_category({./@parentId})][ELSE][ENDIF]
Here's the code for the function:
function my_get_category( $id ) {
$term = get_terms( array(
'taxonomy' => 'product_cat',
'hide_empty' => false,
'meta_query' => array(
array(
'key' => '_category_id',
'value' => $id,
'compare' => '='
)
)
)
);
if ( ! empty( $term ) ) {
return $term[0]->slug;
}
}
After you've imported your taxonomies with these settings, you'll be able to retrieve the category names/slugs using the same function when importing your Products:
[my_get_category({categoryId[1]})]
There are a couple of things to keep in mind when importing the attributes for your products:
- The "param" elements can vary in position on each import record, and they use Cyrillic symbols, so you'll need to query them using the instructions here: Query Cyrillic Attribute Values.
- You'll need to manually map each attribute in the import template. It's not possible to dynamically import a varying amount of attributes per-record.
Свяжитесь со мной пожалуйста Len55555@yandex.ru