• Let’s say I import a series of 3-level categories:

    category1 / category2 / category3a
    category1 / category2 / category3b
    category1 / category2 / category3c
    category1 / category2 / category3d
    

    Result:

    category1
    -category2
    --category3a
    --category3b
    --category3c
    --category3d

    (correct, as expected)

    with slash in name string (converted to html entity)

    category/1 / category/2 / category/3a
    category/1 / category/2 / category/3b
    category/1 / category/2 / category/3c
    category/1 / category/2 / category/3d

    Result:

    category/1
    -category/2
    --category/3a
    -category/3b
    -category/3c
    -category/3d

    (3a has correct parent, 3b-d have grandparent as parent)

    with slash and slug

    category/1$category-1 / category/2$category-2 / category/3a$category-3a
    category/1$category-1 / category/2$category-2 / category/3b$category-3b
    category/1$category-1 / category/2$category-2 / category/3c$category-3c
    category/1$category-1 / category/2$category-2 / category/3d$category-3d

    Result:

    category/1
    -category/2
    --category/3a
    -category/3b
    -category/3c
    -category/3d

    (3a has correct parent, 3b-d have grandparent as parent)

    with ampersand in name string

    category & 1 / category & 2 / category & 3a
    category & 1 / category & 2 / category & 3b
    category & 1 / category & 2 / category & 3c
    category & 1 / category & 2 / category & 3d

    Result:

    category & 1
    -category & 2
    --category & 3a
    -category & 2
    --category & 3b
    -category & 2
    --category & 3c
    -category & 2
    --category & 3d

    (generates multiple categories for 2)

    with ampersand and slug

    category & 1$category-1 / category & 2$category-2 / category & 3a$category-3a
    category & 1$category-1 / category & 2$category-2 / category & 3b$category-3b
    category & 1$category-1 / category & 2$category-2 / category & 3c$category-3c
    category & 1$category-1 / category & 2$category-2 / category & 3d$category-3d

    Result:

    category & 1
    -category & 2
    --category & 3a
    -category & 3b
    -category & 3c
    -category & 3d

    (3a has correct parent, 3b-d have grandparent as parent)

    I can understand the confusion when the slug is not defined. But when the slug is defined, it should be easy to find the correct parent. It looks like we’re just looking for the string after the first slug delimiter instead of the second.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter eric3d

    (@eric3d)

    Note: in example 2 and 3, the entity & #47 ; is used instead of /. (forum is converting it)

    Plugin Author nir0ma

    (@nir0ma)

    Hi @eric3d
    Sorry for that and thank you for the feedback.
    I’m quite busy with other projects by now, but I’ll try to fix this asap (might take some time).
    I’ll let you know when issue is solved !
    Ty again !

    • This reply was modified 5 years, 3 months ago by nir0ma.
    Plugin Contributor Aurovrata Venet

    (@aurovrata)

    here is a fix for this, in file wp-content/plugins/category-import-reloaded/inc/admin/class-admin.php replace line 154 with,

    $split_line = str_getcsv(stripslashes($line), '/','"');

    you can then import categories such as,

    Cooker$cooker/BALAY$balay/”3CGX466B/12″$3cgx466b12

    Plugin Contributor Aurovrata Venet

    (@aurovrata)

    @nir0ma I made these changes along with a few more i a PR on your github repo.

    Plugin Author nir0ma

    (@nir0ma)

    @aurovrata Thank you !
    Merge have been done and you’ve been added to the contributors !
    Really appreciate your help as I’m really busy those times !

    Plugin Contributor Aurovrata Venet

    (@aurovrata)

    @nir0ma my pleasure, you’re most wc.

    I appreciate your effort to continue where Category Import left-off.

    Are you aware that you could have requested to adopt the original plugin. I did this with a plugin which was abandoned and needed some fixing.

    In the example, With ampersand in name string, how multiple categories can be fixed?

    category & 1 / category & 2 / category & 3a
    category & 1 / category & 2 / category & 3b
    category & 1 / category & 2 / category & 3c
    category & 1 / category & 2 / category & 3d
Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Wrong parent selected with some characters’ is closed to new replies.