Formula Builder

The app lets you bulk edit product prices using custom mathematical formulas.

You can combine standard mathematical operations with supported variables to create flexible pricing rules based on your product data.

Example formula

Price = (item_weight * 1.5) + (cost_per_item * 1.8)

In this example, the final price is calculated automatically using the product’s item weight and cost per item.

Supported variables

You can use the following variables when creating your pricing formula:

#

Variable Name

Description

1

current_price

The price of the item

2

current_compare_price

The compare price of the item

3

cost_per_item

The cost price of the item

4

item_weight

Weight of the item

5

shop_metafield_namespace_key

Any shop level metafield.

Example: shop_metafields_metalapp_goldprice

In the example above, the metalapp is the namespace and goldprice is the key having a numeric value.

The following functions are supported:

#

Function

Examples

1

MOD(number, divisor)

Returns the remainder after the number is divided by divisor.

MOD(3,2)

Result: 1

current_price + (9- (MOD(current_price, 10)))

Pricing variables can be used to create custom logic

2

2

RANDOM(min, max)

Returns a random integer between min and max

RANDOM(5, 15)

Result: 11 (or any number between 5 and 15 (inclusive))

current_price + ( current_price * ( RANDOM(15,25)*0.01 ) )

In the example above, each product's price will be adjusted randomly between 15% and 25%.

Additional variables and functions can be added based on request.