Product Templates - User Created Formulas - Adding a Double side check box

Tyler MacDonald Updated by Tyler MacDonald

This article, builds on the previous one. If you have not done so, please read Product Templates - User Created Formulas

Now that we are using a User Created formula for Area, let's add a Double-sided boolean check box and see how we can affect the price when a user checks it off and on.

From the product, we have created called "Product Templates - User Created Formulas"

  1. Select Modifiers "+Add New Modifier"

  1. Click "+Add New Modifier" type in and select "Double_Sided" and Type "FALSE" for the default value

Double_Sided is a boolean, and a boolean can either be TRUE or FALSE. TRUE is Checked, and FALSE is unchecked.

  1. Next, go to the dropdown menu items, and click the pencil icon beside "Test Banner Material"
  1. Look for the Pricing Attributes Heading from the Edit Dropdown Menu Screen and turn Custom on. Let's edit the formula we have to include the Double_Sided boolean checkbox.

Double_Sided ? ((Width*Height)/144)*2 : (Width*Height)/144 ;

The formula is an IF Statement. Let's break down what the formula is expressing

  • Double_Sided ? : This is asking if Double_Sided is True(Checked) or False(Unchecked)
  • If Double_Sided is TRUE, then calculate the Square Feet and multiply by 2
  • If Double_Sided is FALSE, then calculate the Square Feet and multiply by 1
  • A semicolon ";" is required at the end of all IF Statements

The number of square feet that is calculated is based on the Formula we created (Width*Height)/144 and is multiplied by 2 if Double_sided is checked, or by 1 if Double_Sided is unchecked

Now that the product has been set up for Double_Sided, let's see how it looks in action.

  1. Scroll to the top of the product screen, and select "Check Pricing"
  1. Fill in some details to test the functionality of the product.

  • Product: Product Templates - Using System Formulas
  • Modifiers: Width = 12, Height = 12, Notice how the Total Area of 1 sqft is shown for you
  • Dropdown Menus: Ultraflex 18oz Pole Banner Pro - Double Sided
  • Double_Sided: Check on and Off to see the price change

How did we do?

Product Templates - Using System Formulas

How to Publish Products in shopVOX

Contact