# Calculator Unit Price Calculation

• When Automatically Add Option Values is Checked, the application will add all values for all options within the calculator together and set the products price.

When Automatically Add Option Values is Unchecked, you can write your own custom formula for the calculator. Any option that is part of the calculator, will be available for use in the calculation. The value returned from this calculation will be the unit price of your product.

## Unit Price#

Unit price means the price of a single unit (quantity of 1) of your product.

Shopify prices products on a per UNIT basis, not on a multiple product basis.

This means if you want to sell 1,000 units for \$1,667 total, the unit price of these items would need to be \$1.667.

You cannot price a product for units smaller than 0.01 and the unit price of 1.667 is impossible to achieve. The unit price must be either \$1.66 or \$1.67. That means the final price must be either \$1,660 or \$1,670.

If you want to sell large number of units at a very specific price you should:

• Sell as a bundle with a quantity of 1 and describe the real quantity in a calculator option.
• Price on a Per UNIT basis instead.

## Calculation is Total Price Not Unit Price#

This checkbox tells the calculator you have calculated a total price in the Unit Price Calculator field instead of a Unit Price. You should really avoid doing this whenever possible. Typically, you want to check this box if you have included product_quantity in your unit price calculation field.

When this is checked, the calculator will divide the calculated price by the quantity to determine the actual unit price. The issues described above may occur.

If you do not check “Calculation is Total Price Not Unit Price”, you may find the items added to cart are very expensive compared to what you expect. Each unit will be priced at the value you expected for all units.

## Display Total Price instead of Unit Price#

Typically you will include product_quantity in the Unit Price Calculation because you actually want to display the total price for all units not because you want to actually price each unit this way.

Checking “Display Total Price instead of Unit Price” lets you show the total price and while still calculating the unit price of a product. By calculating the unit price, you have more control over the proper pricing of your product and guarantees that what you display to users is the same as the price actually added to cart.

This is the recommended approach when calculating pricing.

## Mathematical Expressions#

You can use any of the following mathematical expressions in a calculation:

Brackets – First Priority
Exponents – Second Priority
Division – Third Priority
Multiplication – Third Priority
Subtraction – Fourth Priority

Calculation Variables allow you to insert other options, lookup tables and product variables in to the formula.

## Option Variables#

Example column shows how an option named “size” would be included in a calculation or formula.

## Writing a calculation formula#

To write a formula enter a combination of variables, mathematical expressions and your own number inputs.

## Mathematical Arguments#

A calculation formula must use mathematically arguments between each variable. Buttons to add these arguments are included with each calculation / formula field.

The following are example of INVALID calculation:

• product_price dimensions[ length, width ]
• product_quantity 100
• width height

Each of the examples above have multiple variables or constants without any valid mathematical expression between them. The calculator has no idea what you are asking for by this and nor would your grade 9 math teacher. The calculation will fail.

To fix the calculations above add a mathematical argument between the variables:

• product_price + dimensions[ length, width ]
• product_quantity * 100
• width * height