Precedence rules delay the display of dimensions until they offer useful refinements of the shopper's navigation state.

The following table summarizes the configurable attributes of precedence rules.

The ECR type precedence-rules-folder is the root of precedence rule configuration for all owners, and is configured as follows:

{
		 "ecr:type": "precedence-rules-folder"
}

All the rules belonging to a particular owner are configured within a precedence-rules-owner-folder object. Each precedence rule is configured as a precedence-rule object; for example:

{
    "ecr:type": "precedence-rules-owner-folder",
    "aspectRatioDigitalCamerasRule": {
        "ecr:type": "precedence-rule",
        "targetDimension": "camera.aspect_ratio",
        "isLeafTrigger": false,
        "triggerDimension": "product.category",
        "triggerDimensionValueSpec": "575"
    },
    "digitalZoomDigitalCamerasRule": {
        "ecr:type": "precedence-rule",
        "targetDimension": "camera.digital_zoom",
        "isLeafTrigger": true,
        "triggerDimension": "product.category",
        "triggerDimensionValueSpec": "600"
    }
}

To configure precedence rules for your application, follow these steps:

  1. On your local file system, create the following directory structure to contain all existing precedence rule configuration, which you will export in the following step:

    where /CustomPrecRuleOwnerName is the folder in which you will create precedence rules for the specific needs of your application. The name of the folder is used as the name of the owner. Do not create more than one folder for a custom owner of precedence rules.

    Do not modify or add to the contents of the /system and /ATG subfolders. If no configuration is exported to these subfolder, you may delete them.

    Configuration is exported to the respective subfolders in ZIP files containing JSON files named _.json.

  2. Export existing precedence rules for your application, by executing the following command:

    where directory is the path to the /precedenceRules folder that you created in the previous step. All existing precedence rule configuration will be exported into the subfolders of /precedenceRules.

  3. Create or modify any existing precedence rule configuration in the /CustomPrecRuleOwnerName folder to meet your application's requirements; for example, the following JSON code defines two precedence rules for the custom owner CustomPrecRuleOwnerName:

    "ecr:type": "precedence-rules-owner-folder",
        "aspectRatioDigitalCamerasRule": {
            "ecr:type": "precedence-rule",
            "targetDimension": "camera.aspect_ratio",
            "isLeafTrigger": false,
            "triggerDimension": "product.category",
            "triggerDimensionValueSpec": "575"
        },
        "digitalZoomDigitalCamerasRule": {
            "ecr:type": "precedence-rule",
            "targetDimension": "camera.digital_zoom",
            "isLeafTrigger": true,
            "triggerDimension": "product.category",
            "triggerDimensionValueSpec": "600"
        }

  4. Import the edited precedence rule configuration, by executing the following command:

    where directory is the path to the /precedenceRules folder that you created in the first step above.


Copyright © Legal Notices