A space to discuss online store customization, theme development, and Liquid templating.
It looks like the structure of line item properties in liquid abruptly changed this morning, breaking our app functionality for many merchants and some functionality for other merchants we service where line item properties are in heavy use.
This does not appear to be an issue for all merchants - we've checked a few stores manually and they appear to be unchanged.
Could we get some confirmation on whether this is an intended breaking change please?
EDIT: Based on the posts below, and some further testing. This issue appears to happen to line items that are touched by Functions (ie. line items that are targets for Expand, or Merge). Regular line items (not Functions related) still have properties in the expected format and are not broken.
We experience this with line item properties that are passed through to Functions (a bundle parent product), other Partners (below) experience this when adding line item properties within Functions.
Solved! Go to the solution
This is an accepted solution.
Hi again AV_SL,
We've shipped a fix for this, the line items should be appearing as expected now.
Thanks again for flagging and appreciate your patience on this!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
I just noticed that as well. Thought I was going crazy because I left a piece of code on the properties in a working state last night.
I noticed that the AJAX added properties (if you add them yourself with /cart/add.js let's say) are fine but ones added from a cart transform function are not, so I'm guessing it's something from the functions. We're using the 2024-07 stable version by the way, so it shouldn't be an issue of running the unstable/release candidate.
I hope we get a fast turnaround.
Interesting...
Our properties are added with appended inputs on the product form on the product page. The response when adding to cart is correct, the response from add.js is also showing properties correctly - it's just when trying to output the properties in liquid that is completely broken (you can see it easily in /cart.json)
Functions are still functioning fine for us.
EDIT: could be related to functions as we are running Cart Transform Expand operations on the pictured line item. The properties themselves are not being added in Functions though.
Function output is perfectly fine for us as well, but when you go to display them in the /cart.js they appear as the complex objects like in your post instead of the normal
{"key": "value"}
format we're used to.
Example function output:
{
"operations": [
{ "merge": {
"attributes": [
{ "key": "_id",
"value": "1722954345312" } ],
...
Example value in cart.js
{
"fields": [
{
"key": "_id",
"value": {
"null_value": "NULL_VALUE",
"integer_value": 0,
"number_value": 0,
"string_value": "1722954345312",
"bool_value": false,
"struct_value": null,
"list_value": null,
"signed_integer_value": 0
}
}
]
}
EDIT: you might be right and it might just be because the function "touched" them, because in our case we actually do add the attributes in the function.
We're also experiencing this issue. We're adding the attributes in the function.
When looking at the abandoned checkout, the properties look ok in the UI, and are simple strings in JSON.
Hi AV_SL,
Thanks for flagging this - investigating this issue with our team now.
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
This is an accepted solution.
Hi again AV_SL,
We've shipped a fix for this, the line items should be appearing as expected now.
Thanks again for flagging and appreciate your patience on this!
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thanks @Liam!
Hi Liam! I want to try my luck and ask a related question here. I'm happy to create a new thread however. Would the issues above also be connected to not being able to see the items that comprise a cart transformed line inside the cart json?
I want to render the new items I merged/expanded, however I would have to do a hard-reload to access the liquid values instead of just using the response from the cart/add event.
Thoughts?