Formula Builder

Ankit Kothari

Last Update hace 4 días

The app enables bulk price editing using a mathematical formula.


Along with the regular mathematical operations, you can use variables to build the formula.


Example formula:


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


The following variables are allowed:

#Variable NameDescription
1current_priceThe price of the item
2current_compare_priceThe compare price of the item
3 cost_per_itemThe cost price of the item
4item_weightWeight of the item
5shop_metafield_namespace_keyAny 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:

#FunctionExamples
1MOD(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
22
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.

Was this article helpful?

0 out of 0 liked this article