Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

BUG: Line Item Properties in liquid is broken

Solved

BUG: Line Item Properties in liquid is broken

AV_SL
Shopify Partner
39 4 11

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.

Screen Shot 2024-08-06 at 10.31.31 am.pngScreen Shot 2024-08-06 at 10.32.38 am (1).png

Biscuits Bundles App - Create beautiful mix and match bundles using native Shopify bundles functionality.
Accepted Solution (1)

Liam
Community Manager
3108 344 891

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

View solution in original post

Replies 8 (8)

Zet
Shopify Partner
5 0 8

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.

AV_SL
Shopify Partner
39 4 11

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.

Biscuits Bundles App - Create beautiful mix and match bundles using native Shopify bundles functionality.
Zet
Shopify Partner
5 0 8

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.

fl-am
Shopify Partner
1 0 1

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.

Liam
Community Manager
3108 344 891

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

Liam
Community Manager
3108 344 891

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

AV_SL
Shopify Partner
39 4 11

Thanks @Liam!

Biscuits Bundles App - Create beautiful mix and match bundles using native Shopify bundles functionality.
Race
Shopify Partner
5 0 4

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?

Screenshot 2024-08-07 at 9.13.21 AM.png