Skip to content

Building Category facet on Shopify

In Shopify we have four modes for building the category facet

It should be noted in advance that when using the first mode, a collection facet will be built, while in the other modes a category facet will be built. The first facet is non-hierarchical, while the second one is.

  • CategoryHierarchy: shopify - these are regular Shopify collections. In the facet, it appears as a one-level list of store collections. There is no category structure in Shopify; collections cannot be nested within each other directly without workarounds like metafields or similar hacks to link them together.

  • CategoryHierarchy: turn14 - these are only Turn14 categories, which are pulled from the _turn14 index by Vendor + SKU. Turn14 has a category structure, which means we get a category and subcategory. A tree-like facet is built from this data. In Turn14, there can only be two levels of categories.

    Additionally, we check the names of all store collections for similarity with Turn14 categories by name, which is useful for the case when in the store collections are named the same as in Turn14, even if for some reason it’s not possible to get data from the index. In this case, it’s still necessary to build a category tree in our facet from store collections because we have data on what the trees look like in Turn14. In general, an attempt to make categories from collections with data from Turn14.

  • CategoryHierarchy: turn14_shopify - the default method for creating the category facet, a mix of Turn14 categories + Shopify collections. All the same is done as in the regular turn14 plus complemented with Shopify collections whose names are not similar to Turn14 categories.

  • CategoryHierarchy: nav_menu - facet replicates the structure of the specified store’s Navigation Menu. Only those menu items to which collections are assigned are taken from the navigation menu. More details here on how this is set up in the store. The names of facet values correspond to menu item names, not collection names.

    The menu name is specified by the second setting: CategoryHierarchy_menu: menu_name.