[ { "version": 1, "label": "Set Product discount based on the quantity", "trigger_type": [ "product_updated" ], "object_type": "product", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product.collections", "settings": { "multiple": "any", "operator": "equals", "value": "All Notebooks", "long_value": "", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "trigger_child_workflow", "settings": { "target_path": "product.variants", "exported_workflow": { "version": 1, "label": "Variant subworkflow", "trigger_type": [ "manual" ], "object_type": "product_variant", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": { "1": { "field": "product_variant.option1", "settings": { "operator": "equals", "value": "recertified", "long_value": "", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "product_variant.inventory_quantity", "settings": { "operator": "lte", "value": "5", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_variant_discount", "settings": { "wait": "0", "custom_wait": "", "discount": "0", "discount_type": "percent", "reverse": 0, "reverse_safe": 0, "once": 0, "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } }, "2": { "conditions": { "1": { "field": "product_variant.option1", "settings": { "operator": "equals", "value": "recertified", "long_value": "", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "product_variant.inventory_quantity", "settings": { "operator": "gt", "value": "5", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "3": { "field": "product_variant.inventory_quantity", "settings": { "operator": "lte", "value": "10", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_variant_discount", "settings": { "wait": "0", "custom_wait": "", "discount": "20", "discount_type": "percent", "reverse": 0, "reverse_safe": 0, "once": 0, "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } }, "3": { "conditions": { "1": { "field": "product_variant.option1", "settings": { "operator": "equals", "value": "recertified", "long_value": "", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "product_variant.inventory_quantity", "settings": { "operator": "gt", "value": "10", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "3": { "field": "product_variant.inventory_quantity", "settings": { "operator": "lte", "value": "15", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_variant_discount", "settings": { "wait": "0", "custom_wait": "", "discount": "35", "discount_type": "percent", "reverse": 0, "reverse_safe": 0, "once": 0, "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } }, "4": { "conditions": { "1": { "field": "product_variant.option1", "settings": { "operator": "equals", "value": "recertified", "long_value": "", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 }, "2": { "field": "product_variant.inventory_quantity", "settings": { "operator": "gt", "value": "15", "token_browser": "{{ Browse Tokens }}", "token_object_type": "product_variant", "condition_type": "AND" }, "weight": 999 } }, "actions": { "1": { "type": "product_variant_discount", "settings": { "wait": "0", "custom_wait": "", "discount": "45", "discount_type": "percent", "reverse": 0, "reverse_safe": 0, "once": 0, "token_object_type": "product_variant" }, "weight": 999, "target_key": "product_variant" } } } } } } }, "weight": 999, "target_key": "product" } } } } }, "description": "This automation discounts a product's price based on the quantity available. It increases the discount when the stock level is higher and reduces the discount when stock levels go down. " } ]