Custom product calculator

Hello everyone,

I sell tablecloths and because people all want different sizes, I want to have a kind of customization calculator for a number of products on the website.

Via Elfsight I managed to create the code that needs to be in the website.
But unfortunately I don’t know anything about it myself, and after a lot of struggling I can’t get it into my website. Who can help me with this?

The intention is that, in addition to the standard tablecloth sizes, people can now also order a custom-made tablecloth with this formula on the product page.

This is the code:

3 Likes
  1. Access the page: Go to the page where they want to add the calculator (like a product page or custom page).

  2. Add the Code: Copy and paste this code into an HTML section or widget on the page:

    html

    Copy

  3. Save and Publish: After pasting the code, save and publish the page.

  4. Test: Visit the page to ensure the calculator works properly.

That’s it! It will now show up as a customization calculator on the website.

Thank you.

Do I need to paste it on a specific point? On top or at the bottom?

I bet your theme has a “Custom code” or “Custom liquid” section/block – you can add it wherever you like and paste the code into setting input field.

However, the more complex question is how you can make it change the product price…

Have you checked the Shopify App store for something similar?

Hey Tim, with this formula customers could shift the slides of the length and width. Or do you think this will not work?

Of course, it will update the amount text in browser, but then you’d need a way to update your product price in cart so that proper amount will be charged on checkout and this is a more complex task.

In Shopify you add a variant to your cart which has a price predefined in back-end and this, together with quantity defines the amount to be charged.

Popular way to approach flexible price was adding a base product accompanied by a number of $1 addon products.

Another approach is to use draft orders where you can manipulate price, or use Shopify functions to amend price at checkout.

Anyway you’d need an app to do actual price manipulation.

That’s why i suggested you look at “product options” or “product builder” apps – they will have it sorted out.

Thank you. I have looked at i but didn’t find something that would fit.
But maybe I didn’t enter the right words. I will search again, thank you.

Hi @Bamar

I recommend using Easify Product Options – it’s perfect for custom products like your tablecloths. You can easily set your own formula, and the price will automatically update based on the dimensions your customer fills in. Super easy to set up, no coding needed at all. Here’s how it works:

  • This is the result:

  • This is the app setting:

You can add price based on dimension with your own calculation, and it will appear right on your product page.

This app is simple to set up, and I hope you check it out. Let me know or reach out to Easify if you need any support! :hugs:

1 Like

Hey Bamar :waving_hand:

That’s a great idea — having a custom size calculator directly on your product page really improves the buying experience, especially for made-to-measure products like tablecloths.

If you already have the Elfsight code snippet, you’ll just need to embed it correctly in your Shopify theme:

  1. From your Shopify admin, go to Online Store → Themes → Edit code.

  2. Open the product template file (usually something like product.liquid or main-product.liquid).

  3. Paste your Elfsight script below the product description or wherever you want the calculator to appear.

  4. Click Save, then refresh your store page to test it.

If it still doesn’t show up, double-check that your Elfsight widget is set to “Public” and that the script tag isn’t being blocked by your theme or an app.

Once that’s working, you can even style it a bit with custom CSS to match your store’s branding.

Hope that helps — you’re definitely on the right track! :rocket:

If you want customers to enter custom dimensions and instantly see the updated price on the product page, the easiest way to handle this (without coding struggles) is to use a Shopify custom Price Calculator app, especially one designed for dimension-based or made-to-measure products.
Instead of embedding external code from Elfsight, which can break or conflict with your theme, a dedicated Shopify price calculator app will do wonders for you.

Hey,

That’s a nice calculator you have built with our app. I really hope you ended up by successfully putting it on the website.

We have a support team that can help you overcome any issues when embedding the code, also here is a guide article for adding our widgets and apps to Shopify: Adding Elfsight Widget to Shopify Website - Elfsight Help Center

Please, never hesitate to contact us :slight_smile:

All the best,

Elfsight Team