Calling Developers!
We are reenergizing our code contribution process! Learn More

Can we have multi-parent-category in Spryker?

Options
Volodymyr Lischer
Volodymyr Lischer Posts: 7 🧑🏻‍🚀 - Cadet

Hey-hey, Sprykees.

Can we have several parent categories in Spryker? For example: "New Year Tree" belongs to "Garden" parent category and to "Holiday Decorations" parent category at the same moment.

But I have no idea how to do it with Spryker. Is it possible? Is it too complex task? Maybe, somebody did it yet and has a list of steps how to implement this?

Thank you in advance.

Answers

  • victor.vanherpt
    victor.vanherpt Spryker Solution Partner Posts: 32 ✨ - Novice
    Options

    not directly resolving your question, but I'm wondering if this would help you out with the problem that you want to solve:

    but you could have a product assigned to multiple product 'lists' and have specific landing pages for them?
    https://docs.spryker.com/docs/pbc/all/content-management-system/202311.0/base-shop/manage-in-the-back-office/content-items/create-abstract-product-list-content-items.html#reference-information-abstract-product-list-content-item-widget
    Or do you want to leverage filters and such? (in which case an alternate route could be attributes).

  • Volodymyr Lischer
    Volodymyr Lischer Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    No, it's not I was thinking about:(

  • vasily.rodin
    vasily.rodin Freelance Spryker Developer Spryker Solution Partner Posts: 24 ✨ - Novice
    Options

    Hi Volodymyr!

    This is not possible in Spryker, each category can only have one parent.

    I would not advice changing how categories are stored in Spryker: the logic of saving categories and building trees is quite complicated.

    I think in your example you could create two "New Year Tree" categories, first with "Garden" parent, second with "Holiday Decorations" parent. You can assign the same products to each of "New Year Tree" categories.

    You could even put this "duplication" logic right in your import process. Let's say in your PIM (or any other source of data) you have just one "New Year Tree" category with 2 parents. When you import this data to Spryker, you can automatically create 2 duplicates of the "New Year Tree" category (with the same "alias", you could add a new field into spy_category), and later also automatically assign all required products to all duplicates of the category.

  • Volodymyr Lischer
    Volodymyr Lischer Posts: 7 🧑🏻‍🚀 - Cadet
    Options

    Thank you for your answer. Probably, will do so.