How to Add a Formula-Based Custom Price for Products within Shopify: A Guide to Calculate Custom Prices

How to Add a Formula-Based Custom Price for Products within Shopify: A Guide to Calculate Custom Prices


Pricing products can be one of the most crucial factors for the success of your online store. How often have you come across a scenario where you needed a dynamic pricing model, one that varies based on specific dimensions or configurations? This feature not only provides flexibility to store owners but also offers a tailored shopping experience for customers, enabling them to get precise price quotes based on their preferences.



Step 1 -Download the App and Complete the Onboarding Process:
Transform your Shopify store by integrating the live product options app. Click here to download the app. The setup is as intuitive as creating a social media profile.

Shopify app - Live Product Options

Step 2 - Product Selection Process:
Dive into the 'New Product' option highlighted with a Plus sign. Choose single or multiple products as per your inventory needs. Confirm your selection by clicking on 'Select Product' with the search icon.

Step 3 - Delving into Product Options:
The next phase involves venturing into product configurations. Once inside the product dashboard, you'll find an option labeled 'Add Options', complemented with a Plus sign. Engage with this feature to uncover the underlying configurational aspects of your product.

Step 4 - Detailing Dimensions:
In the realm of customization, detailing is key. As soon as you choose 'Add Options', a dropdown will present various types. For our framing example, opt for 'dimension'. This will pave the way for a setup where you label it as 'frame area='. The two primary dimensions here are X and Y, symbolizing width and height respectively. Emphasizing clarity, both these dimensions are marked in inches ('In'). By default, they're initialized at a 2-inch value, offering a baseline for your formula.

Step 5 - Embracing Advanced Settings:
Dive deeper into customization by activating the 'advance' tab. Here, you're empowered to define minimum and maximum values for X and Y dimensions. In our framing scenario, the boundaries are set between 2 to 30 inches. However, these can be adjusted as per your product's requirements. To enhance customer comprehension, a visual representation, or a text template, showcases the area calculation as ({x}x{y}={area}

Step 6 - Unveiling the Pricing Formula:
This stage is where the pricing magic unfolds. Depending on the defined area in square meters, the formula derives prices as follows:


// Default square price
var squarePrice = 10;

// Adjusting square price based on area
if (area >= 750) {
squarePrice = 6;
} else if (area >= 600) {
squarePrice = 7;
} else if (area >= 450) {
squarePrice = 8;
} else if (area >= 300) {
squarePrice = 9;
} else if (area >= 150) {
squarePrice = 10;

// Calculate total price
var price = squarePrice * area;

// Return the calculated price
return price;

Up to 150m²: $10/sqm
150-300m²: $9/sqm
300-450m²: $8/sqm
450-600m²: $7/sqm
600-750m²: $6/sqm
750m² and above: $6/sqm

For individuals who aren't programming experts, there's no need to worry. Take Help of AI like chatGPT to create it for you, just use this formula for reference

Step 7 - User Experience Enhancements:
To elevate the user experience, a set of options is available. These are:

-show price on option
- show price on label
- show selection on level

Step 8 - Versatility of the Formula:
The adaptability of this formula goes beyond just frames. Whether it's fabric merchants selling by length, carpenters offering custom furniture, or any other product requiring dimensional pricing, this method is universally applicable.

Step 9 - Delving Further into Advanced Settings:
For Shopify store owners craving even more control, a suite of advanced settings awaits. These options enable further refinement of the pricing model, ensuring maximum flexibility.

Step 10 - Design Customization:
Beyond pricing, aesthetics play a monumental role in user engagement. The platform offers both out-of-the-box design solutions and options to embed custom CSS. This ensures your pricing widget not only functions optimally but looks fantastic.

Step 11 - Continuous Support:
Embarking on a new feature integration can be daunting. But fret not, a dedicated support team stands ready to assist. Whether it's refining your pricing strategy or navigating the app, expert help is just a click away. Moreover, comprehensive documentation offers deeper insights and troubleshooting tips.



The digital realm of e-commerce demands flexibility and precision. With our Shopify app, "live product options", you're not just adding a tool but integrating a solution that's easier, faster, and incredibly reliable. Elevate your Shopify store's product customization with our app. Dive into the world of dynamic pricing and experience our app today. Transform your store into a dynamic marketplace, because with Shopify, the possibilities are endless

About Live Product Options

Use Live Product Options to create a custom personalized shopping experience with unlimited product options and a live preview of the product.

Super easy installation

No theme modifications are required.

The App does not add any liquid to your theme and can be installed and uninstalled without the risk of messing up your theme code.

Personalize products

Personalize your products with custom text inputs and image file uploads. Show a live updating preview of the product image with the customers inputs.

Perfect for print on demand products like canvas, posters, picture framing, monogram or text engraving.

Unlimited Product Options

Extend the 100 variant limit by adding unlimited custom product options:

  • text (single / multi line)
  • select dropdown
  • radio / checkbox
  • swatches (button / images / colors)
  • color picker
  • file upload (with Ajax support)
  • HTML

Conditional Logic

Show product options with conditional logic based what the customer has selected.

Live preview

Show a live preview of the product options that updates in real time when the customer changes an option.

Live preview can consist of multiple layers to build a preview image:

  • overlay (image with transparent parts)
  • mask (crop preview with a provided mask or shape e.g. circle)
  • text
  • upload

In-App Editor

Create custom product configurations with the simple to use visual editor inside the app. Configure specific areas for customers to add text or image uploads.

Order Archive & Export

The app archives each order with all the products and their custom options. Export a ZIP file with all the file uploads and CSV containing the options and custom text inputs.

View in Shopify App store
Back to blog