Calculator functions in rules can be used to adjust numeric values in your feed. For example, you can add a markup or discount to your product's prices, or adjust quantity values.
Calculator Function rules can only be applied to numeric fields. Learn more about data types.
How to create a calculator function
- In the feed's 'Rules' page, click the blue '+' button to create a new rule
- Name the rule
- In the SET section, input the feed field you would like to adjust with this rule
- In the TO section you will create a calculation, here's how:
- Start the formula with two opening brackets
[[
- Select the product field from your product catalog that contains the numeric values you want to adjust with this rule (example: [P].[quantity] or [P].[price])
- Use any common operator in your formula, such as:
- Subtraction
- - Addition
+ - Multiplication
* - Division
/
- Subtraction
- Close the formula with two closing brackets
]]
- Start the formula with two opening brackets
- WHERE for all products or some products conditionally
- Save the rule
Common calculator rules
Review the common calculator rules below. Follow these templates to perform similar calculator functions in your feeds:
Static Text you enter into blank fields: Orange, Product Fields: Blue
Add 20% to price for a markup
[[ [P].[price] + ( [P].[price] * .2 ) ]]
Multiply Price by .7 to discount price by 30%
[[ [P].[price] * .7 ]]
Subtract 2 from Quantity to create a buffer
[[ [P].[quantity] - 2 ]]
Select pre-built rule templates from FeedPilot
If you need a reference point to jumpstart your calculation rules, check out FeedPilot rules that modify fields like price and quantity.
- Click the FeedPilot button in the Rule list to launch the FeedPilot modal to view, select, and apply rules
- Search for quantity rules, select to apply to your feed, make any changes, and save
Comments
0 comments
Please sign in to leave a comment.