You have installed WordPress and WooCommerce, found a beautiful looking theme for your future website and is ready to add printing products. Reasonable questions” “what should I use for my online printing business? What is the right tool for that? How to create custom options for my WooCommerce products and configure price calculation so it will take into account width and length and thickness and plenty of other extra options?” I will not be beating around the bush and quickly answer you – use “WooCommerce Product Options and Price Calculation Formulas” plugin. No doubt this is a perfect WC extension for any online printing businesses. I am going to show you how to use it.

“What should I use for my online printing business?” – UniCPO is the answer!

Let’s assume our product is Foamex Banner. I am going to briefly describe options we are about to implement to this product. We want to let customers choose the size (width and height) and, what is even more critical, we would like to give them a possibility to pick a measurement unit of their choice. Measurement units are: mm, cm, m, ft, in and yd. Enough, right? ðŸ™‚ Also, we have thickness option: 3mm, 5mm and 10mm. Each thickness option has its base price per sq. m. and this value is different and depends on the area of an ordered item. Let’s also add “Laminate” option with these choices: none, matt laminated, gloss laminated. The latter two should add 50% to the price calculated by multiplying the base price per sq. m. to area calculated based on width and height provided by a customer. Finally, we would add Cutting Method option with two options: Square Cut Edges and Rounded Corners. Although this option does not impact the product price, we would let the customer choose a size of rounding with possible values from 5 to 25 mm. Of course, this additional input must be shown only if Rounded Corners option is selected. That’s all.

Ok, let’s start making our product configuration. We will have three steps. Step 1 is adding options. Step 2 is configuring proper price calculation. Step 3 – add fields conditional logic to “Size of Rounding” option.

First, create a product and set its price to something. Value ‘1’ works perfectly well. It could be anything, but do not leave it empty, so WC will not treat it as a free item. Second, go to CPO visual builder and start adding modules.

A new Row is added, and Column inside this Row is created automatically. Then Text input option is added. Now let’s configure this first option. This option is “Width”. Then duplicate the first option, so creating “Height” is no time procedure. Then add “Measurement Unit”.

It is essential to keep slugs for suboptions as shown. Please, read more about this here.

Now add a new column (because we need to style our options nicely a bit later and it is better to add a new column now) and add a Select option for “Thickness”. Its suboptions are shown in the screenshot. Please, notice values for ‘Price/Rate’ settings. The mentioned above is an integral part of our configuration, and it will be discussed a bit later.

These are suboptions for “Laminate” option. Again, please notice values of ‘Price/Rate’ settings.

Finally, add “Cutting Method” Select and “Size of Rounding” Text Input options.

Now go to General Settings and enable the first two settings and save them. This step allows for displaying custom options and product price calculation.

This is how our form looks like on a single product page:

Some validation messages overlap some labels as well as it feels like a bit unstyled. But our powerful visual builder allows us to style the form much much better and we will do that later for sure.

We are going to use non-option variables (NOV) to achieve our product configuration goal. So, open NOV settings modal window from the builder panel, enable this feature and add the first two NOVs. These are our width and height values but converted to meters and area calculated in sq.m. Why? Because our base prices are in square meters, so we have to calculate the area in sq.m. However, we also let customers choose in which measurement units they want to add the desired width and height. So, we use measurement units conversion feature of the plugin for our needs! This action lets the script know which unit we want to convert our values to.

However, this is not enough because the script has to know somehow which unit our width and height are inputted in. Open Dimensions settings modal window and choose only one parameter – Measurement unit and save. This action lets the script know which unit we want to convert our values from.

Now let’s add another one NOV and name it ‘base price’ and use matrix functionality. This functionality makes it possible to create a table of prices based on one or two options. Our first parameter is area and the second parameter is thickness. I am going to use a completely fake data to give an understanding of how it works.

Matrix functionality makes it possible to create a table of prices based on one or two options.

Let’s assume our prices are as following:

- if the thickness is 3 mm: 3.11 if area less than or equal 1 sq.m., 3.07 if the area from 1 to 5 sq.m., 3.03 if the area larger than 5 sq.m.
- if the thickness is 5 mm: 5.11 if area less than or equal 1 sq.m., 5.07 if the area from 1 to 5 sq.m., 5.03 if the area larger than 5 sq.m.
- if the thickness is 10 mm: 10.11 if area less than or equal 1 sq.m., 10.07 if the area from 1 to 5 sq.m., 10.03 if the area larger than 5 sq.m.

You have noticed that I used this value for ‘# in cols’ setting: “1|1.0001|5|5.0001”. The reason is that my area values are not discreet; they are in ranges. So, I simulated ranges. The second and the third row in the table have the same pairs of values. It means that if the area is anything between 1.0001 and 5, the value 3.07 will be chosen for 3 mm thickness and so on.

Now we are ready to add our price calculation formula. Open Main Formula & Formulas Conditional Logic modal window and add the maths formula:

Our formula is: {uni_nov_cpo_base_price}*{uni_nov_cpo_area}+{uni_nov_cpo_base_price}*{uni_nov_cpo_area}*{uni_cpo_foamex_laminate}

It consists of two parts:

- we multiply the base price by the area
- optionally, we add the cost of laminating; do you remember “price/rate” settings values? The first was 0, so if “No” is chosen, then the value of this part of the formula will be equal to 0; if either “Matt” or “Gloss” is selected base price will be multiplied by the area and multiplied by 0.5.

Cool! The product price calculation works!

In this part, we are going to style our form more and enable fields conditional logic for “Size of Rounding” option, so it will be shown only if “Rounded Corners” is chosen.

Open “Size of Rounding” option settings modal window, go to ‘Conditional’ tab and configure the logic:

Important to click “Fetch the rule” after any changes in logic builder are made!

I have also styled the form a bit in this what I have now:

This is a link to the product on our demo site. You can log in with demo/demo credentials and try to create your own product. This is a link to the export file for this product. If you use UniCPO 4 PRO already, you are able to import it (unzip first ðŸ™‚ ) and have a completely configured product on your site.

In case you have any question, please, feel free to ask it by contacting us via the form on this page.

Â© 2022 MooMoo Web Studio. All rights reserved. -
Privacy Policy

[…] Also, check this article about how to easily start your online printing business with WooCommerce and Uni CPO […]