Liquid, JavaScript, themes, sales channels
Hi all!
I need Shopify to put out squaremeters as my orderquantity. Instead of "5 boxes" i need it to put out "25m²". We have coded an individual calculator that lets customers put in their desired squaremeters of flooring and then shows the next best number of prepackaged boxes they would need. I can't use unit prices because we had to use individual metafields. We use an Ecommerce Management System (JTL) that prevents us from using unit prices. Is there a way i can make shopify treat product quanitities like this?this number needs to be the order quantity
Metafields
Hi Robin,
this is not possible as for shopify the quantity is something like 1 Product. So you cant buy just a fraction of a product which is the reason for shopify to work only with int numbers. You could reach your goal by describing the quantity in a different way. So for example a quantity of 1 could be 0.1qm.
Hello, thanks for your reply,
Yes, i am trying to describe a quantity of 1 as 3,955qm, which is why i set up these metafields. How would i go about doing this the right way?
I had a similar problem with my products, as I wanted to sell 0.5m pieces 🙂 I solved it like this: https://www.stoffdorado.de/collections/stoffe-farbe-uni/products/jersey-uni-schwarz
If you want to add a description somewhere near the quantity selector, you can add the text in your product template in between the following block:
{% if section.settings.show_quantity_selector %}
...
...
add and style your description here
{% endif %}
Your solution only shows how to display it in the front end, but it doesnt show up as 50cm in the order, it still uses integer numbers right?
i thought this would work with the unit prices. If i can tell shopify how much quantity there is for a specific price, it should also be able to deduct how much of that quantity the customer has ordered. So my unit price is 3.955m² for 158€. If the customer pays 474€, it should be easy to tell shopify that the order quantity is 11,865m².
There is no 100% clean solution for this issue, because the backend only accepts integers. There's only a dirty solution by calculating with int in the backend and showing a decimal at the frontend. This will work for the cart, but at some point you will have to explain your customer why he sees a quantity of for example 120, although he wanted to order 1.2.
I just learned that this can be done with line item properties to customize a product. I need to test if my management system can read that as order quantity now.
The line item properties is just an array, so i cannot imagine, how this should solve the problem. Good luck though 🙂
I had a similar situation with a flooring provider and their solution was to have the quantity calculated based on the customers required `width` and `length` and then to round it up.
So if a customer needed 3m x 4.5m it would figure out how much they needed based on how much a pack of the flooring would contain, round that value up and set that as the quantity.
In that example there's 2.39m2 in a pack.
3 x 4.5 = 13.5
13.5 / 2.39 = 5.6
Quantity = 6
This doesn't work for everyone but they were happy with that approach and it's been quite successful for them.
User | RANK |
---|---|
38 | |
29 | |
13 | |
12 | |
9 |
On our Shopify Expert Marketplace, you can find many trusted third party developers and fr...
By Arno Nov 27, 2023You've downloaded the Search & Discovery app from the Shopify App store, and as you're ...
By Skye Nov 8, 2023The year-end shopping season is just around the corner. Is a flash sale on your radar? Are...
By Jasonh Nov 6, 2023