Unlocking Efficiency: Harnessing System Variables and References to Create a Click Charge

Tyler MacDonald Updated by Tyler MacDonald

In shopVOX, there is a feature that enables the creation of references to system variables, significantly boosting the flexibility and functionality of product creation.

One notable application of this feature is in calculating click charges based on selected materials. During the product creation process, when a material is chosen from a dropdown menu, a reference can be established to access relevant information from another dropdown menu or default item. This capability opens up numerous possibilities for streamlining workflows.

For instance, let's explore a common scenario: creating a product where users can select a material, and the system automatically calculates the required number of sheets for the order, along with associated click charges. By leveraging references, this process becomes seamless and efficient, ensuring accurate calculations based on the single material selection.

Before we begin lets review what the system variable are, and then look at referencing these system variables

System Variables

There are some basics system variables that can be used in your custom formulas

Variable

Description

svLineItem_qty

Returns the Quantity being enter, into the Quantity box of a product

svItem_sheet_width

Returns the Width of a specific material being selected

svItem_sheet_height

Returns the Height of a specific material being selected

Reference_System Variables

Access the sheet width and height of another system variable by leveraging the "Reference" field.

Variable

Description

reference_sheet_width

Returns the Width of a reference material being selected. Simply put a "reference" in front of _sheet_width

reference_sheet_height

Returns the Height of a reference material being selected. Simply put a "reference" in front of _sheet_height

You can find this information and more form the article Product Templates - Custom Formula Logic

Building a Product, that uses references to other materials

  1. Go to settings
  2. From the left hand side choose Products
  3. Click "+Add New Product"
  4. Click "Create Custom Product"
  5. For this example I named it "Click Charge Example Using References" and the interface chosen was "Custom", feel free to use your own name
  6. After you filled in all the required details click "Save Product"
  7. Turn on "Add Product Template"
  8. With the Product Template added we can begin to configure our product.

Configuring a Product, that uses references to other materials

We will now configure our product to use references to calculate a click charge.

  1. Open up the modifiers panel and click "+Add New"
  2. Add a Width modifier, and click "Add New Modifier"
  3. Add a Height modifier, and click "Add New Modifier"
  4. The Modifier Section should look like this, with the Width and Height Modifiers added
  5. Open up the Dropdown Menus panel and click "+Add New"
  6. Lets add a new Material Drop down called "Paper Text", you can follow along with my settings from this image
  7. The "Reference" field, is the place where we input a name, that we will later use to reference this drop down menus material selection.
  8. For this example I will name the reference "papertext". You can use any alphanumeric sequence to name your reference. No special characters or spaces allowed
  9. Turn on the "Custom" button enabling you to input custom code
  10. In the Custom Code field you can input this code to calculate sheet count
    1. Math.ceil(svLineItem_qty/(Math.floor(svItem_sheet_width/Width)*Math.floor(svItem_sheet_height/Height)))
      This line of code computes the number of sheets required based on the input quantity relative to the dimensions of the sheet. It achieves this by dividing the quantity by the result of the product of the ratio of the sheet width to the desired width and the ratio of the sheet height to the desired height, and then rounding up to the nearest whole number.
  11. Click "Add New Drop Down Menu" to save your Drop down
  12. You can see the results here
  13. Lets test by Select "Check Pricing"
  14. In check pricing, open "Pricing Breakdown" to visualize what is going on better. For this example select your materials then enter a width and Height of 5" and change the quantity. You can see the system calculating the number of sheets required
    If you are not seeing the correct results the material must be set up as a sheet, with the proper dimensions and the sell/buy ratio set to 1.

Adding in a Click charge, based of the Material Reference

Now that we have established what material is being used, and have given it a reference of "papertext" we can use that reference to perform other calculations

  1. From the Product Template, open default items, and select "Add New"
  2. For this example I am setting it to a Machine Rate called "Click Charge Color", and I am inserting the same formula as above, but with the reference "papertext" replacing "svItem"
    1. Math.ceil(svLineItem_qty/(Math.floor(papertext_sheet_width/Width)*Math.floor(papertext_sheet_height/Height)))
  3. Click "Add New Default Item"
  4. Lets test by Select "Check Pricing"
  5. In check pricing, open "Pricing Breakdown" to visualize what is going on better. For this example select your materials then enter a width and Height of 5" and change the quantity. You can see the system calculating the number of sheets required, as well as the click charge simultaneously.
    If you are not seeing the correct results the Click charge must be set up with a Production Rate of 1 Unit per Unit

The utilization of system variables and references within shopVOX offers a powerful toolset for enhancing product creation processes. By harnessing these features, users can efficiently calculate click charges based on selected materials, leading to streamlined workflows and accurate cost estimations. Through a step-by-step guide, we've explored how to configure products to leverage references, enabling seamless calculations of sheet counts and click charges. This functionality not only improves efficiency but also ensures precision in pricing, contributing to overall operational effectiveness within shopVOX. As users continue to leverage these capabilities, they can expect to optimize their workflows and achieve greater accuracy in their product offerings.

How did we do?

Mastering the Use of *, /, +, -, >, <, >=, <=, % in Ternary Operations

Undertanding Sell/Buy Ratio in shopVOX

Contact