• Resolved robbybobble

    (@robbybobble)


    Dear community ??

    is there a way to deactivate the “primary categorie” function so our product URLs won’t change? Or an option that the Product URLs wont change ofter I activated the plugin? To change or redirect thousends of Products seems not very suitable.

    Thank you very much ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The primary category is automatically determined like WordPress would if not selected. So, not setting one shouldn’t affect the output.

    But, in TSF v5.0, I refactored how this is treated, though the determining should be unchanged.

    Are you facing trouble with this? Did you come from TSF v4.2.8 or earlier, and are you using TSF v5.0.1 now?

    There’s a filter that I can provide, but I’d much rather resolve a bug so it’s right for everyone forever ??

    Thread Starter robbybobble

    (@robbybobble)

    Hi Sysbre,

    I imported the content from an existing store that uses SEOPress.
    I’m using the newest version of the plugin but I’m not really sure which version I had when I imported the content one month ago.

    TSF choose the categorie under the base categorie (/categorie-one/) as primary for every product. The URL is something like:
    /shop-base/category-one/productname/

    When I deactivated TSF its like it should be and how it was in the old shop:
    /shop-base/category-one/nested-categorie/more-categories/productname/

    Right now I just deleted line 19 of?https://github.com/sybrew/the-seo-framework/blob/9a5e555431f84a07e58ba7e67894dedc30ec494b/inc/compat/plugin-woocommerce.php#L19 and the URLs are as I need them.

    Thanks

    Plugin Author Sybre Waaijer

    (@cybr)

    Hi Robby,

    Thank you. I was able to replicate the issue.

    1. Create nested categories. Nested categories are usually created later, so their ID is higher.
    2. Create a product with nested categories assigned.
    3. Activate TSF and the assigned term changes.

    I’ll see if I can reintroduce default nested behavior into the plugin. This may be a WooCommerce-only issue, but I still have to test that.

    You can keep line 19 deleted/commented out for now. There’s no harm in doing that, though primary product category selection will have no effect.

    I’ll keep you posted on my progress with this.

    Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    Upon further investigation, I found this issue specific to WooCommerce.

    TSF sorts the categories as WordPress would (take one with the lowest ID), whereas WooCommerce rightly sorts the “child” categories and picks the latest child.

    I agree with WooCommerce’s approach and will change our sorting algorithm akin to theirs. However, this may cause links to break, so I’ll have to conduct more testing.

    If everything goes well, you may see it adjusted in tonight’s v5.0.2 patch.

    Plugin Author Sybre Waaijer

    (@cybr)

    Good news: TSF will act like WooCommerce does when sorting primary terms in the next update, v5.0.2.

    Unlike WooCommerce, please note that if a term isn’t selected in a parent-child chain, the term before the missing selection will be chosen instead — e.g.:
    – parent (selected)
    – child-1 (selected, this will be chosen)
    – child-1.1 (not selected)
    – child-1.1.1 (selected, but can’t reach)

    I did this to prevent database lookups: we’ll count from the parent down to the latest child. Still, all of this can be addressed via the interface.

    Thread Starter robbybobble

    (@robbybobble)

    Its working! Thank you very much ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Deactivate primary categories woocommerce’ is closed to new replies.