IPrice minimart user guide

Using formulas

VKontakte
You can use formula for calculating price and weight of the item. You can set formula for item price and weight on category editing page: Backend->Iprice minimart->Categories: select category and open for editing.
If you set fomulas in subcategory, then the subcategory formulas overrides the category formulas.

You can use the following predefined variables in formula:
  • 'price' - basic price of the item;
  • 'qty' - quantity of the item selected by the user;
  • 'weight' - item weight;
  • 'dropdown' - additional cost of the basic property of the item;

In addition You can use the following predefined variables in formula for Items with type "Shipping and etc":

  • 'totalorderamount' - total amount of order items;
  • 'totalorderweight' - total weight of order items;

You must enclose all variables in single quotes

Use custom fields in formulas

You can use custom item fields in formulas if the custom item field contains numeric data.
For using custom fields in formulas make the following:

  • Add custom field in 'Item fields' section of the component admin panel. Set the name of the custom field and other attributes. Name of the custom field must contain latin symbols only and symbol '_'.
  • Set values of this custom field for each item on item editing page.
  • Set formulas for necessary categories of the items.
See more details about custom fields of the item in chapter "Administration - Item fields".

For example:

  • You add custom field 'p_length' means the lenght of the item.
  • The length of 1 meter of the item cost $100. You should set the basic price of the item of 100.
  • Then you should set formula for item price:

    'p_length'*'price'

    (You can set formula on item category editing page)

Use condition 'if...else...'

You can use the following sintax for using 'if.. else..' condition in formulas:

(expression ? value if true : value if false)

For example:

('qty'>5 ? 'price'*0.8 : 'price')

This example means that the user get the 20% discount on item price if he select quantity of the item more than 5.

You can use nested expressions. For example:

('qty'>10 ? 'price'*0.5 : ('qty'>5 ? 'price'*0.8 : 'price'))

This example means that the user get the 20% discount on item price if he selected quantity of the item more than 5, and the user get the 50% discount on item price if he selected quantity of the item more than 10.

 

 

 

Subscribe



Subscribe to our newsletter and social networks to be updated with the latest updates.

Login