Formula Pricing (Advanced Config Add-On)

Formula pricing requires the Pricesystem Advanced Config Add-On:

  • Composer package: mageb2b/pricesystem-advancedconfig
  • Magento module: MageB2B_PricesystemCoreAdvancedConfig

When Formula Pricing Is Used

Formula pricing is used when the selected strategy is "Individual price formula":

  • globally via pricesystem/price_select_rule/priceselect = 4, or
  • via customer/group override (customer/group UI option "Individual price formula")

Where To Set The Formula

The formula itself is resolved in this order:

  1. Customer attribute price_formula (if set and non-empty)
  2. Customer group column price_formula (if set and non-empty)
  3. System configuration pricesystem/price_select_rule/formula

Variables (Price Codes)

In formulas you reference price codes such as:

  • customer_price
  • pricelist
  • special_price
  • tier_price
  • orig_price

Notes:

  • Both code_with_underscores and codewithunderscores are accepted.
  • orig_price is always available as a reference for fallback and for formulas.
  • If pricesystem/price_calculation/skip_zero_price = Yes, zero or negative prices are ignored for formula inputs.

Supported Functions

The formula engine supports helpers like:

  • low(code) (minimum)
  • high(code) (maximum)
  • avg(code) (average)

and utility functions:

  • min(a, b, ...)
  • max(a, b, ...)
  • round(value, decimals?)
  • abs(value)

Missing Input Behavior

Configure how missing values are handled:

  • Config path: pricesystem/price_select_rule/formula_missing_input_behavior

Typical behaviors:

  • Fail and use fallback strategy (strict)
  • Treat missing values as 0 (lenient)

Formula Error Fallback

If the formula is empty, invalid, or evaluates to a non-positive result, Pricesystem can fall back to a strategy:

  • Config path: pricesystem/price_select_rule/formula_fallback_strategy

Fallback strategies include:

  • Lowest
  • Highest
  • Sort order
  • Original price

Found an issue with this documentation? Let us know