Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wisepim.com/llms.txt

Use this file to discover all available pages before exploring further.

Product variables use formulas to compute new values from existing product data. Unlike other variable types, these aren’t static — they recalculate per product based on that product’s fields. Set them up on the Products tab in Settings > Content Logic.

How to use them

  1. Add a variable — Give it a label, key, and formula.
  2. Build the formula — Use {{product.field}} references, arithmetic operators, and math/text functions. Use the Insert Field and Insert Operator buttons, or type {{ for autocomplete.
  3. Check the preview — The live preview shows the formula resolved with sample data.
  4. Reference in content — Use {{product.your_key}} anywhere variables are supported.

Available operators and functions

Arithmetic

+ (add), - (subtract), * (multiply), / (divide), % (modulo), ( ) (grouping)

Math functions

round(), floor(), ceil(), min(,), max(,), abs()

Text functions

concat(,), uppercase(), lowercase() To use an operator as literal text, escape it with a backslash: S\/M\/L renders as “S/M/L”.

Use case examples

1. Price including VAT

Calculate the VAT-inclusive price from the base price. Formula:
round({{product.price}} * 1.21 * 100) / 100
Result: €129.99 → €157.29 Use 1.21 for 21% VAT, 1.09 for 9%, etc. The round(...*100)/100 pattern ensures two decimal places.

2. Profit margin percentage

Calculate and display the margin as a clean percentage. Formula:
round(({{product.price}} - {{product.cost}}) / {{product.price}} * 100)
Result: Price €129.99, Cost €75.00 → 42% Reference as {{product.margin_pct_display}} in internal reports or data quality checks.

3. Price per unit weight

Useful for B2B catalogs where buyers compare price-per-kg or price-per-unit. Formula:
round({{product.price}} / {{product.weight}} * 100) / 100
Result: €2.45 / 0.085 kg → €28.82/kg

4. Display name with SKU and brand

Build a standardized display name for exports and catalogs. Formula:
{{product.brand}} — {{product.name}} ({{product.sku}})
Result: Fischer — Stainless Steel Hex Bolt M10x50 (SS-HB-M1050)

5. Savings amount and percentage for promotions

Calculate the actual discount for products on sale. Formula (savings):
round(({{product.price}} - {{product.special_price}}) * 100) / 100
Result: €30.00 Formula (savings percentage):
round(({{product.price}} - {{product.special_price}}) / {{product.price}} * 100)
Result: 23%

6. Volume / dimensional weight

Calculate the volumetric weight for shipping cost estimation. Formula (volume in cm³):
{{product.length}} * {{product.width}} * {{product.height}}
Result: 50 × 17 × 17 → 14450 cm³ Formula (dimensional weight in kg, using 5000 divisor):
round({{product.length}} * {{product.width}} * {{product.height}} / 5000 * 100) / 100
Result: 2.89 kg

7. Minimum selling price based on target margin

Calculate the floor price that maintains a minimum margin. Formula:
round({{product.cost}} / (1 - 0.30) * 100) / 100
Result: Cost €75.00, Target margin 30% → €107.14 Change 0.30 to your desired minimum margin.

8. Stock value (cost × quantity)

Calculate the inventory value per product for reporting. Formula:
round({{product.cost}} * {{product.stock_quantity}} * 100) / 100
Result: Cost €2.45, Stock 500 → €1225.00

9. Formatted product specifications string

Build a standardized specs line from multiple fields. Formula:
concat({{product.weight}}, " ", {{product.weight_unit}}, " | ", {{product.length}}, "×", {{product.width}}, "×", {{product.height}}, " ", {{product.dimension_unit}})
Result: 0.085 kg | 50×17×17 mm

10. Markup-based selling price from cost

Calculate the selling price by applying a fixed markup to cost. Formula:
round({{product.cost}} * 1.60 * 100) / 100
Result: Cost €75.00, 60% markup → €120.00

Tips

  • The live preview uses sample values to show how your formula will resolve — check it before saving.
  • If a referenced field is empty, the formula resolves to an empty string and math won’t compute. Make sure the fields you reference have values.
  • Use round(...*100)/100 to get clean two-decimal results for pricing formulas.
  • Computed product variables can reference other computed variables, global variables, brand variables, and category variables in their formulas.