# Element: Advanced Pricing Formula (formerly Variable Math)

# Introduction

The Advanced Pricing Formula element is great for products and services that require you to customize the math of a product or service using variables. For example: $productOne x $productTwo / 30

# Benefits, Features & Use Cases

Shipping Rates - Calculate prices based on the length, width, and height of a shipping item

Mortgage Calculator - Calculate a monthly fee

Loan Calculator - Add an interest (percentage) to the number of days or months the user wants to borrow money

Package Deals - Give your customer a discount based on combing items together. Please take a look at the video below.

Square Footer - Please take a look at the video below.

ROI Calculator - video coming soon

# How to Activate & Use This Feature

To add Advanced Pricing Formula, first click on the "Advanced Pricing Formula" button (formerly Variable Math)

### Settings & Options

First, you can create a title for the element.

Now, let's dive into the interesting stuff... By default, the Advanced Pricing Formula element creates 2 products that you can change or customize easily.

You can change the product's name, value in price, max quantity and a type of front-end element to control this product.

You can also click on the "+Add Item" button to add more products

Now, here it comes the real power of the Advanced Pricing Formula element. With the "Total Calculation" field, you can create math operations (+, -, *, /) to operate with all the products/services you created.

For instance, in the next image we are calculating the shipping cost based on the product dimension (width, height, length)

And we are multiplying each value to get the total calculation:

And this is the end result:

Mind-blowing, huh?

###### Adding Calculation Parameters to the Advanced Pricing Formula Element (input fields)

Direct Addition: Add a Slider, Quantity Input Box, or Checkbox directly to the Advanced Pricing Formula element.

Link Existing Elements: Link any existing element within the cost calculator form to the Advanced Pricing Formula element.

Link Section Totals: Connect to any section total within the form to include its value in the calculation.

In the latest versions of Stylish Cost Calculator, you can link other elements as a variable in Advanced Pricing Formula. The calculated value of the element will be the value returned by the variable. Use the "[+] Link Element" button to add an element as a variable.

You can also add a section's total to the variables list.

Writing Formulas

You can write formulas in a JavaScript like syntax, use * to multiply the variables. Here are some sample formulas.

Input1 * (1.15)

The above code will add 15% to the value of Input1

###### Advanced Options of Advanced Pricing Formula

Default 0 Value: Enabling this option will set the value of variables that have not returned any value set to 0 and will let the formula execute. If not enabled, the formula will not execute until all of the variables becomes available.

We would like to encourage you to try it out. Many users find solutions to complex problems that didn't even occur to us.

# Video Tutorials

Creating Package Deals

Working with Square Footage

Advanced Formula vs Fee & Discount Adjuster

# Frequently Asked Questions

### Q: How do I apply a formula to the quantities selected of items in or linked to the Advanced Pricing Formula?

To apply a formula to the quantities selected in your sliders, follow these steps:

Use the Advanced Pricing Formula element for custom formulas.

Set the price of each product or service to $1 in their respective elements.

Create your formula in the Advanced Pricing Formula element.

For example, if you want to calculate Total Price = (Quantity A x 5) + (Quantity B x 10) + (Quantity C x 15), you would:

Set Product A, B, and C to $1 each in their elements.

In the Advanced Pricing Formula, use:

(Product A x 5) + (Product B x 10) + (Product C x 15)

This way, the "Product" values represent the quantities, not the prices.

Remember: The Advanced Pricing Formula normally uses the total prices of elements. This $1 trick lets you work with quantities instead.

### Q: What's the difference between the Advanced Pricing Formula and the Fee & Discount Adjuster?

A: These two tools help you change prices in different ways:

Advanced Pricing Formula:

Used for complex math with many parts

Good for figuring out the price of one item or service

Can use info (quantities or price) from other parts (items, section totals) of your form

Example: Figuring out shipping cost based on size and weight. Calculating the length x width x height of a fencing project.

Fee & Discount Adjuster:

Used for simple math (+, -, x, %)

Can change the total price or just part of it

Good for adding fees or giving discounts

Can turn on or off based on what people pick

Example: Adding a $100 shipping fee in certain situations. Give a 10% discount to a section of items in your form.

When to use each:

Use Advanced Pricing Formula when you need to do tricky math for one thing

Use Fee & Discount Adjuster when you want to quickly add or take away from the price

Remember, you can use both in the same form if you need to!

# Additional Information

##### Special Notes

You may want to read about our Fee & Discount Adjuster element that is used for triggering fees/discounts, charging base fees, adding percentages to the end of your total, converting totals to monthly pricing, and much more.

##### Related Features

Element: Fee & Discount Adjuster

##### Limitations

WooCommerce Shipping Functionality - SCC will not pay the fee to a shipping option in WooCommerce. We recommend you use the shipping rate functionality of WooCommerce that is built-in.

#### All Elements & Features

Learn more about All Elements

Learn more about All Features

#### Need Support?

Ask a question or request support

Request a feature or give feedback

Updated on: 12/10/2024

Thank you!