Dynamic Categories

Dynamic Categories

Dynamic categories allow you to specify dynamic expressions that control the products that belong to them.

For example, you want to create a category that contains all products that have been in your catalog for 30 days or less. You can create a dynamic category that specifies to include all products that have been in your catalog for 30 days or less.

Refer to Categories for more general information about categories and the different category types that you can create.

Dynamic Category Types

There are two types of dynamic categories:

  • Dynamic precomputed—The product membership is calculated when products are indexed in the catalog.
  • Dynamic realtime—The product membership is calculated in realtime and on demand when a shopper navigates to the realtime category page.

Refer to the following table for more information about the differences between the two types of dynamic categories:

Precomputed Categories

The product membership of precomputed categories is calculated when products are indexed in the catalog, such as when products are added, updated, or deleted from the catalog, and also when the categories themselves are updated, such as when their expressions change.

For example, you have a precomputed category that includes all products that have a property of red, and you currently have a blue gloves in your catalog. This blue gloves is included in your precomputed category; however, if you removed the property of red from the gloves and saved the change, this glove would be removed from the precomputed category when you save the change.

Note:  Precomputed categories can reference other precomputed categories; however, Kibo eCommerce recommends limiting the amount of precomputed categories the parent precomputed category references.

Realtime Categories

The product membership of realtime categories is calculated in realtime and on demand when a shopper navigates to the realtime category. When the shopper navigates to the realtime category, Kibo eCommerce performs a query for products in the catalog that should be included in the category. This allows Kibo eCommerce to evaluate dynamic product fields such as product pricing after discounts have been applied.

For example, you have a realtime category that includes all products that have a discounted sale price, and you currently have a discount on all gloves. When a shopper navigates to this realtime category, Kibo eCommerce performs a query to identify the products that have a discounted sale price, and it finds the gloves that are discounted. These gloves then appear on the realtime category page.

Note:  You cannot target realtime categories for discounts.

Specify Dynamic Category Type

The Product Membership field controls whether the dynamic category is precomputed or realtime.

To specify a precomputed dynmaic category, set the Product Membership field to Precomputed.

To specify a realtime dynmaic category, set the Product Membership field to Realtime.

Dynamic Category Expressions

The dynamic category expression controls the product membership of the dynamic category. You can find the expression of a dynamic category in the Expression section on a dynamic category page.

You can create and edit the dynamic category expression either using the visual expression builder or the advanced expression editor. If you choose to use the visual expression builder, you’ll need to create containers and filters using dialog boxes in Admin. If you choose to use the advanced expression editor to create and edit the expression you’ll need to write either a JSON styled tree, or write a plain text string.

Refer to following sections for more information about either manually writing the dynamic category expressions, or using the visual expression builder:

  • Visual Expression Builder
  • Advanced Expression Editor

Visual Expression Builder

The visual expression builder allows you to visually create groups and conditions that specify the details of your expression. A group specifies whether any or all of the conditions within it need to evaluate as True in order for products to be added to the dynamic category. A condition contains an expression field, an operator, and a value, for example Product code is equal to AAMV.

Add a Group

To add a group:

  1. Under the Expression section, click the More Actions button and select Add Group.
  2. Specify whether Any or All of the conditions in the container must be True by clicking the More Actions button next to the group and selecting Edit.
Tip:  Any acts like an or, and All acts like an and. For example, you have a condition that includes the categories Ammex and Gloves. If you specify Any, any products that belong to the AMMEX or the Disposable Gloves category will be included in the dynamic category. However, if you specify All, only products that belong to both the AMMEX and Disposable Gloves categories will be included in the dynamic category.

For example, you add a group that includes four conditions and allow any of the conditions to be True.

Add a Condition

To add a condition:

  1. Under the Expression section, click the More Actions button for the applicable group and select Add Condition.
  2. Select a condition Field.
  3. Select an Operator.
  4. Specify a Value.

For example, you want the dynamic category to include any product with a list price of $50. To accomplish this, you create a condition that states List price is equal to $50.

Note:  Some fields allow for null, or no values. The asterisk on the Value drop-down menu determines whether the selected field requires a value. For example, you can create a condition that states Sale price has no value..

Add an Existing Condition to a Group

To add an already existing condition to a group:

  1. Click and drag the condition into the desired group.

Advanced Expression Editor

The advanced expression editor allows you to manually write either JSON equivalent text or plain text to create the expression.

To create or edit an expression manually:

  1. In the Expression section, click Advanced.
  2. In the Advanced Edit Expression window, select either the JSON view or the Text view to write your expression.

Preview the Expression Results

Before saving the dynamic category, you can preview the results of the expression. This gives you the opportunity to view the products that will be included in the dynamic category before saving the category.

When previewing the results of the expression, you can specify the site and either the Live or Staged version of the site.

Note:  If your product publishing settings are set to Live for a catalog, you can only preview the live matching results. To view both the live and staged matching results, you need to set your product publishing settings to Staged. Refer to Publishing Settings for more information about setting your product publishing settings.
Note:  Only products that appear on your storefront are returned in the preview expression results. If, for whatever reason, including out of stock, a product does not appear on your storefront either currently or on the staged preview date then it will not appear in either the live or staged preview expression results. Product ranking rules do not affect the preview expression results.

To preview the results of an expression:

  1. Under the Expression section, click the Preview button.
  2. In the Preview Expression modal, the results of the expression are shown in the Preview grid on the right.
  3. Select the Site you wish to preview products for as well as the site’s State.
Tip:  If you select Staged as the site’s state, you can specify the date you wish to preview. This allows you to preview the products that will be included in the dynamic category on the specified date.
  1. If the product results do not match your desired results, you can edit the expression using the Expression frame on the left.
  2. If you edit the expression in the Preview Expression modal and you wish to save your changes, click Done. Otherwise, click Cancel to disregard any changes and close the Preview Expression modal.
Tip:  The total matched results are shown in the bottom-right corner of the Preview grid. You can use this total to quickly determine whether your expression meets your desired criteria.

Expression Fields

When you write a dynamic category expression, you define values for the supported fields in order to build out the expression.

Refer to the following table for the supported expression fields and their operators:

Precomputed and Realtime Categories

Realtime Categories Only

Sale Type Values

The realtime sale type field has three different values that each apply to a product’s various sale types: Catalog Sale Price, Discounted List Price, and Discounted Catalog Sale Price. Refer to the following table for more information about each of these values and their relationship to a product’s various sale prices.

Expression Examples

Example 1

The following example shows a precomputed dynamic category expression that includes all products that have been in the catalog for 30 days or less:

Visual Expression Builder

Advanced Editor: Tree View

Advanced Editor: Text View

Example 2

The following example shows a precomputed dynamic category expression that includes all products with the property color set to red:

Visual Expression Builder

Advanced Editor: Tree View

Advanced Editor: Text View

Example 3

The following example shows a precomputed dynamic category expression that includes all products with the property color set to red and are in the apparel category.

Visual Expression Builder

Advanced Editor: Tree View

Advanced Editor: Text View

Example 4

The following example shows a realtime dynamic category expression that includes all products with a discounted sale price and are in the apparel category.

Note:  You must set the Product Membership drop-down menu to Realtime in order to access the dynamic realtime fields.

Visual Expression Builder

Advanced Editor: Tree View

Advanced Editor: Text View

Create Dynamic Categories

To create a new dynamic category:

    1. Go to Main > Catalog > Categories.
    2. Select Create New Category > Dynamic Category.
    3. Enter a Category Name.
      This name will display on your storefront.
    4. Complete the Description field and Category Image.
      The description field is not visible to your shoppers initially; however, you can make it visible depending on your theme. Use these fields to help a user understand what products they’ll find in this category.
    5. Determine whether to hide the category on your storefront with the Hide category on store front checkbox.
      This is useful if you have a seasonal category that should only display at certain times of the year.
    6. Determine whether the dynamic category is precomputed or realtime using the Product Membership drop-down menu.
      The Product Membership drop-down menu controls the dynamic category type and its behaviors. Refer to Dynamic Category Types for more information about the two types of dynamic categories.
    7. Create an expression to define the product membership of the category.
      You can either manually create the expression, or use the visual expression builder to create the expression. Refer to Dynamic Category Expressions for more information about manually or visually creating dynamic category expressions.
    8. Use the available fields to enter SEO information:
    9. Click Save
      Note:  If you view the dynamic category on your Staged site, the default sort order may be different than the default sort order on your Live site. This is because the Staged site may be using a different default sort by value than your Live site. Your Live site’s default sort by value is determined by your theme. You can confirm the products that are included in both the Staged and Live versions of the dynamic category using the Preview button under the Expression section. Refer to Preview the Expression Results for more information about previewing the dynamic category expression results.

Duplicate Dynamic Categories

You can duplicate categories to quickly create new categories that are based on existing ones.

To duplicate a category:

  1. Go to Main > Catalog > Categories.
  2. Click the More Actions button next to a category.
  3. Select Duplicate.

    You can then edit the duplicated category to meet your needs.

Disable Dynamic Categories

You can temporarily or permanently disable categories so that they can’t be used in various contexts and are filtered out of default views within Admin.

To disable a category:

  1. Go to Main > Catalog > Categories.
  2. Select the applicable category you want to disable.
  3. In the Status drop-down menu, select Disabled:

    Keep the following in mind when you disable a category:

    • The category disappears from the default view in the Category grid in Admin.
    • Subcategories—Subcategories of the disabled category are also disabled. When creating child categories, if you select a disabled category as the child category’s parent, then the child category is disabled and is read-only until you either set the parent category as active or remove the parent category from the child category.
    • Storefront—If the disabled category was previously shown on the storefront, the category is automatically removed from storefront navigation. Navigating directly to the category URL is subject to your existing URL routes and/or URL redirects. If you don’t have any routes or redirects defined, then navigating to the category URL either in your live storefront or staging preview returns a 404 error code.
    • Discounts—If the disabled category was previously targeted by a discount, the products in it are no longer eligible for the discount.
    • Admin Category PickersDisabled categories are displayed in category pickers in Admin, but are marked as Disabled.
    • Dynamic Categories—If you disable a dynamic category, the previewing the dynamic expression results still displays associated products correctly. If you reference a disabled category in a dynamic expression, the expression evaluates as if the disabled category does not exist.

Preview Dynamic Categories

You can preview a category page in Site Builder before publishing it to your live site. Previewing a category page is handy if you want to view how the category displays your site and how the products assigned to the category, whether statically or dynamically, appear on the category page.

Note:  You can only preview category pages (which determine the look and feel of categories), not the categories themselves. When you create or edit a category, the changes take effect immediately, meaning that you can’t stage category data or edit categories and preview them before the product data is updated.

To preview a category:

  1. Go to Main > Catalog > Categories.
  2. Click the More Actions button next to a category.
  3. Select View Staged > Site.

Was this article helpful?

Related Articles

Leave A Comment?