Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 4 replies, has 2 voices.

Last updated by ulfN-2 1 year, 9 months ago.

Assisted by: Shekhar Bhandari.

Author Posts
August 28, 2023 at 9:06 am

ulfN-2

Problem with Category terms while importing with WP All Import

August 28, 2023 at 11:09 am
August 28, 2023 at 11:43 am #14300229

ulfN-2

Yes, of course that's ok. Thank you!

August 28, 2023 at 12:19 pm #14300751

Shekhar Bhandari
WPML Supporter since 03/2015

Languages: English (English )

Timezone: Asia/Kathmandu (GMT+05:45)

Hello there,

On the test site, I have followed the below steps:

- Created a category named "ParentCat1"
- Created a category named "Flacherzeugnisse aus nichtrostendem Stahl, mit einer Breite von < 600 mm, warm- oder kaltgewalzt" setting this as parent of "ParentCat1"
- Create a CSV with imported it without WPML, I see it imports it but the category is separately by comma, and multiple categories are created, If I remove the category separator, the category isn't linked.

Further, instead of using category names, I used category slug and they seem to be imported without any issue, so can you please check if using category slug helps in the CSV?

Further, I would also like to know if you have some custom settings performed on the wp all import to import categories without comma seperation.

Look forward to your reply.

Thanks

August 28, 2023 at 2:39 pm #14301641

ulfN-2

Hello,

Thank you for your assistance so far.

Yes, I modified the product import with another seperator than "," – instead I used "´" because it isn't used by any of the sub-categories. The products themself get imported, but they don't get into two different categories which is needed because they differ from each other even though it is just "<" or ">=".

I'll try the import of the products with the slugs soon.

Could you please try if you can import a category named "Flacherzeugnisse aus nichtrostendem Stahl, mit einer Breite von < 600 mm, warm- oder kaltgewalzt" and another named "Flacherzeugnisse aus nichtrostendem Stahl, mit einer Breite von >= 600 mm, warm- oder kaltgewalzt" and if the product import than recognizes where to put the products in?

Thank you, I'm looking forward to your reply.

Best regards

August 29, 2023 at 11:25 pm #14309445

ulfN-2

Hello,

Thanks for your support so far. I've tried the import with the slug and gut the same result but also reproduced the issue in another sandbox without the use oft the WPML-Plugins: hidden link – You can also see how I configured the import of the products over here: hidden link – I now asked the support of WP All Import again, if they know how to fix the issue. Did you find out something new?

Best regards

August 31, 2023 at 2:27 pm #14321573

ulfN-2

Hello,

I've found a solution due to the help of the WP All Import Support. The following PHP-Code helps to solve the issue:

function my_get_term( $term_name ) {
$term = get_term_by( 'name', $term_name, 'product_cat' );
if ( empty( $term ) ) {
return $term_name;
} else {
return $term->slug;
}
}

in combination with the sub-catogories being formated like [my_get_term({warengruppe[1]})].

Thanks for your support!