Welcome to the Liquify Community

Updated 3 weeks ago

Line item properties

Hi,
I've just built a jewellery store using Liquify, and I've encountered an issue when populating products - as things like rings can have lots of sizes, I've quickly overflowed the 100 variants limit (3 materials x 3 width x 20 sizes > 100).

I've done some research and found out that since the "Size" option doesn't affect the price / inventory, I can use "line items properties" (https://shopify.dev/docs/api/liquid/objects/line_item#line_item-properties) for this.
I've tested it with Liquid (adding a text input or radio buttons with [name="properties[Size]"]) but I then realised that the "add to cart" form seems to be using the Shopify API rather form submission solution, so this didn't work.

How can this be done, given that we can't really modify default Liquify elements like the product form? I'd also need to display this element in the cart, if possible.

If there's a chance you could build it into the product form, it would be great! Thanks!

Store URL: https://magnurs.myshopify.com/, password: magnurs
j
G
j
13 comments
Hi @Georgy Rakita,
we are currently working on supporting propertys with the liquify cart button. But at the moment you only have the option to replace the liquify add to cart button with a normal submit. Then you can add the input field as you explained.
Sadly that will lead the customer to the cart page and wont open the mini cart.

But we are working on it ๐Ÿ™‚
Hey @jonas.halbstark , thanks for your reply!

Is there any advice on what I can do to get it working with the mini cart now?

I'm handing this one off soon and don't mind just working with the code directly in the Shopify code editor.

If you could give rough guidance on how the current implementation is done and where the code for it is I hope I can chatpgt the solution into working, and manually apply it without the liquify conversion for now.
Alternatively, maybe you could suggest another solution for this?

They are a jewelry store and each of their products have:
2-3 materials (affect the price of the variant)
2-3 item widths (affect the price)
10-30 sizes for each item (don't affect the price, hence my original idea to do it as a line items property).

If all of this is done as options, the total variants count shoots well over 100, so I am looking for a way to pass on Sizes to the order the other way.
Item propertys are the best solution for this.
the add to cart event is in liquify_custom
Thanks Jonas, will try to figure it out.

Hate this thing with no code platforms where you think you are almost done and then a sudden limitations pops up and takes days to solve.
we are working on it! ๐Ÿ™‚
To everyone who might be looking for an answer to this in the future - I got it to work, reach out in this thread if you need help with this, until Liquify ships this natively.
Anything more come of this yet @jonas.halbstark ?
Hi @jason, yes this is already live. We are now deleting the Line Item Key and not the Product id anyore.
Ok, so if you use the attribute โ€˜name=properties[โ€œnameโ€]โ€™ etc it will carry over?

Subsequent question then - with doing this, if you have, for example, a text input marked as required, the add to cart button that is a styled anchor wonโ€™t trigger client side validation.

My solution to this (I believe) is to switch out with my own submit, validate, and then call the add to cart function in the liquify js file that already exists. Or can I just decorate it with an alpine attribute to do the same?
Hi @jason, ah i got it wrong. This feature is still in testing. Sorry
you can vailidate inputs with alpine and only allow adding to cart when the validation is correct. or do it as you suggested it
Add a reply
Sign up and join the conversation on Discord