Calculating Price from Attributes Plugin Guide

With “Calculating Price from Attributes Plugin” the store owner can define complex formula using product’s attributes price values, product’s attributes weight values and static values to dynamically calculate the price of the product depending on the product’s attributes chosen by the customer. The following is a quick guide for the plugin and at the end is the link for the DEMO VERSION.


By enabling the plugin, if a formula has been defined by the store owner for a product, the mentioned product’s price would be calculated by the formula and if a product does not have a defined formula, then the product’s price would be determined by the store’s default methods.

Plugin Enable


After enabling the plugin, the store owner defines and relate different attributes with different values to the product.

Calculating-Price-attributes


The store owner can define the “static values” from admin panel > plugins > Formula Static Values. Store owner can use these static values in their formula (only 10 static values can be defined, from s1 to s10).

Calculating-Price-static_page


After defining attributes and static values, the store owner can define the formula by using the “Formula” tab in the product’s edit detail page. A list of available variables is shown under the formula field. The store owner can define the formula using the mathematical operators (+, -, *, /, %) and “IF” statement using the “IF((Condition), (True Part), (False Part))”structures. With “IF” statements the store owner can make complex formulas like IF((a11>a12), (a11*10), (a12-2)).


As a result, the product’s price value would be dynamically calculated by the defined formula depending on the customer’s attribute choosing.

Calculating-Price-productSample

The fowling is a list of supported operators and functions and examples as to how to use them in the formulas.

OperatorUsageExample
+Additiona11+a12
-Subtractiona11-a12
*Multiplicationa11*a12
/Divisiona11/a12
%Modulusa11%a12
<Lesser thanIF ((a11<a12), a1, a2)
>Gtreater thanIF ((a11<a12), a1, a2)
=EqualIF ((a11=a12), a1, a2)
<>Not equalIF ((a11<>a12), a1, a2)
<=Lesser than OR equalIF ((a11<=a12), a1, a2)
>=Grater than OR equalIF ((a11>=a12), a1, a2)
ANDReturnes true if both statements are trueIF (((a11>10) AND (a12<5)), a1, a2)
ORReturns true if one of the statements is trueIF (((a11>10) OR (a12<5)), a1, a2)
NOTReturnes true if statement is flaseIF ((NOT (a11 = 10)), a1, a2)
INVariable is in the valuesIF (((a11) IN (10, 14, 20)), a1, a2)
LIKEVariable matches a patternIF(((Convert(a11, 'System.String')) LIKE ('1%')), a4, a7)
IS [NOT] NULL-IF(((a11) IS [NOT] NULL), a1, a2)



FunctionUsageExample
IFIF statmentIF((a11), a1, a2)
CONVERTConverts a variable type to anotherConvert(total, 'System.Int32')


A demo version of this plugin is available. Please use the information below to enter the admin panel and review the formula settings.


Demo Version

Admin Username: admin@hypernop.com

Admin Password: 123