Multiple conditions

  1. To build a rule with multiple conditions, click Add condition.
    A rule can have up to ten conditions. The logical operator that joins two conditions is based on the current Match setting. By default, Match is All and the logical operator is AND.

  2. Select the second condition and enter the required query text.

  3. To change the logic of the rule, change the Match setting to determine how closely the shopper’s search criteria must match the query condition. Set Match to one of the following:

    • Any - (Default) All logical operators in the rule are set to OR and the results appear in the test pane.
    • All - All logical operators in the rule are set to AND and the results appear in the test pane.

    The Match value determines the logical operator that is used to join multiple conditions. Changing the Match setting changes all logical operators in the rule. It is not possible to combine AND and OR in the same rule.

    In this example, rather than searching for “yoga pants”, there are two separate queries that search for “yoga” or “pants”. This rule is less specific and is triggered more often in the storefront than the other.

    Rules - Match

  4. To add another condition, click Add condition and repeat the process.

Intelligent ranking

Intelligent ranking combines user behaviors and site statistics to determine product ranking.
Store owners can set up the following types of ranking strategies:

Rules - Match

  • Most purchased: This ranks products by total purchases per SKU in the previous 7 days.
  • Most added to cart - Ranks in order of total “Add to Cart” activities in the previous 7 days.
  • Most viewed: Ranks the total views per SKU in the previous 7 days.
  • Recommended for you - Uses the viewed-viewed data point - Shoppers who viewed this SKU also looked at these other SKUs.
  • Trending: Looks back at page view events over the past 72 hours for background events and 24 hours for foreground events.
  • None: Products are ordered by Relevance.

Select the type of strategy for the rule. The Test your rule window displays the expected results.

Caveats

  • Apostrophes and quotes in queries may lead to some minor issues with ranking and relevance in some languages.

  • To ensure the intelligent ranking works correctly, make sure that the Search Weight for any product attributes that are used for search or filtering (facets) is 5 or less. To find this setting in the Commerce Admin:

    1. Select Stores > Attributes > Product.

    2. Search for the attribute, such as “name”.

    3. In the Attribute Information > Storefront Properties page, set the search weight to be less than or equal to 5.

      Product - Search Weight