Solved

Attribute Data Recently Stopped Coming Through On Orders

joe-adelie
Shopify Partner
7 0 6

I've added the following two fields to a snippet that is being called from the product-template.liquid file:

<p>
Start Date:<br>
<input class="datepicker" id="from" name="attributes[Rental Start Date]" type="text" value="{{ cart.attributes["Rental Start Date"] }}">
</p>

<p>
End Date:<br>
<input class="datepicker" id="to" name="attributes[Rental End Date]" type="text" value="{{ cart.attributes["Rental End Date"] }}">
</p>

 

These are required fields and necessary for us to check inventory and process the order after it has come through. Everything has always worked up until about 3-4 days ago when the data stopped coming  through and now doesn't show up in the Additional Details section of the admin shopify order view.

 

Just curious if anyone else has experienced this recently or if there is something obvious about the way I've implemented the attribute property into the input field that is causing this?

Accepted Solution (1)
Jesse_Meyers
Shopify Expert
20 1 9

This is an accepted solution.

Hi @joe-adelie I looked at the site and the code on the product pages will not work. The simplest solution would be remove the rental date fields from the product page and add them to the cart. If you wanted to set the value from the product page you would need a developer to create a custom solution.

The cart page attribute example that you shared is kinda working but it not setup correctly. I would recommend using this tool from Shopify  to create your cart attribute fields. The element you appear to be missing is the Liquid tag to display the saved "Customer Notes" value. That tag is added correctly if you use the tool linked above.

In the attached, you can see that the test value I entered has been saved but after clicking the "Update Cart" button it stops displaying because the Liquid tag I mentioned above is missing.

 

Screenshot 2023-06-22 at 2.04.41 AM.png

 

You can also verify the cart attributes are saving correctly by viewing the cart.json file by simply appending .json to the end of the cart URL. See attached image.

Screenshot 2023-06-22 at 2.06.57 AM.png

 

You're also going to need to update or remove the script you have running on the checkout button. Simplest solution would be to make the cart attributes required and enable form validation (here's an example).

View solution in original post

Replies 17 (17)

JaredM
Shopify Partner
2 0 0

This seems to be an issue on Shopifys end. Many apps relying on tagging and attributes have completely broken. Hopefully, there is a fix in the coming days.

ice-ASAP
Visitor
2 0 0

Do you know which apps specifically? Or is this just affecting all shopify users across the board?

ice-ASAP
Visitor
2 0 0

I'm having a similar problem. Are you using any apps for your site's checkout?

joe-adelie
Shopify Partner
7 0 6

Yeah still an issue for me. 5 orders today and none of them have the attribute data. 1 of 2 orders on Saturday had the attribute data. Seems to be completely random. Am using an app at checkout that handles shipping calculation but that's it. All the orders that have come in today are store pickup orders though and not calculated deliveries. Really hope they can figure this out soon. 

samZapiet
Shopify Partner
12 0 4

Hey @joe-adelie  we also have the issue! We have a ticket open with Shopify Partner support, ticket number 39167890. We have not had an update in over 5 days, we had a placeholder response yesterday but no real resolution to the issue! Are you still seeing the issue occur on your stores?

Zapiet builds industry-leading pickup and delivery apps empowering 3000+ Shopify merchants in over 80 countries!
joe-adelie
Shopify Partner
7 0 6

Hey @samZapiet yeah still not coming through even today. Super frustrating. Would you please let me know if/when you hear anything from your support ticket? Wondering if it has something to do with the pickup and delivery piece of our applications as our code hits that piece of Shopify's api as well?

samZapiet
Shopify Partner
12 0 4

Hey @joe-adelie ,

 

Unfortunately we have not had any meaningful updates. In our tests we actually used stores without our applications or code installed and were able to replicate the bug! But the only response that we have gained from Partner Support so far was completely unrelated and non-useful. As a final step to try and accelerate the resolution process here, we are now directing all of our Merchants with the issue to contact Shopify support, quoting our ticket number 39167890. Does your team have a separate ticket number open? Maybe if we're to join forces, we can add some pressure to get a resolution a little faster! 

Zapiet builds industry-leading pickup and delivery apps empowering 3000+ Shopify merchants in over 80 countries!

Jesse_Meyers
Shopify Expert
20 1 9

This example code is not valid because you have quotes inside of quotes. Is this the actual code in use? Can you update your code as shown below and test?

original:

value="{{ cart.attributes["Rental End Date"] }}"

 

Updated:

value="{{ cart.attributes['Rental End Date'] }}"

 

 

joe-adelie
Shopify Partner
7 0 6

Thanks for the response Jesse. While this is true, it is not the solution to this problem unfortunately. This value property was added after the order details stopped coming through in hopes of fixing the problem. Even after changing to single quotes within the property value the details are still not coming through on new orders. This has to be something that has changed on Shopify's end.

Jesse_Meyers
Shopify Expert
20 1 9

Ah, you're right. Since the quotes are inside of a Liquid statement they don't break the syntax. My bad, I was viewing on a phone and didn't notice that. I'm on my computer now and better able to read the original question. It looks like you are trying to use cart attributes from the product page but they only work when they are inside of a cart form. To capture data like this on a product form you'd need to use line item properties. Can you share the site so I can take a look?

joe-adelie
Shopify Partner
7 0 6

Ah good call. I read that somewhere as well but wasn't sure about it since it was working before and just suddenly stopped working. The problem with line item properties is that I want this particular data to apply to the whole order and not just the individual items... however, the most logical spot to put the inputs is on the product pages because we need the dates in order to check inventory before they try to add the product to their cart. The code I pasted in the question is inside the product form but I have another instance of an input with this same format that is inside the cart form on the cart page that also isn't passing in data. The liquid for that is 

 

<form id="cart-form">
<!-- your cart page -->
<div>
<label for="new-attribute" >Any Special Requests?</label>
<textarea rows="5" type="text" name="attributes[Customer Notes]" id="new-attribute"></textarea>
</div>
<!-- more of your cart page -->
</form>


The website is https://www.perfectpartyplace.ca/

 

Appreciate the help!

Jesse_Meyers
Shopify Expert
20 1 9

This is an accepted solution.

Hi @joe-adelie I looked at the site and the code on the product pages will not work. The simplest solution would be remove the rental date fields from the product page and add them to the cart. If you wanted to set the value from the product page you would need a developer to create a custom solution.

The cart page attribute example that you shared is kinda working but it not setup correctly. I would recommend using this tool from Shopify  to create your cart attribute fields. The element you appear to be missing is the Liquid tag to display the saved "Customer Notes" value. That tag is added correctly if you use the tool linked above.

In the attached, you can see that the test value I entered has been saved but after clicking the "Update Cart" button it stops displaying because the Liquid tag I mentioned above is missing.

 

Screenshot 2023-06-22 at 2.04.41 AM.png

 

You can also verify the cart attributes are saving correctly by viewing the cart.json file by simply appending .json to the end of the cart URL. See attached image.

Screenshot 2023-06-22 at 2.06.57 AM.png

 

You're also going to need to update or remove the script you have running on the checkout button. Simplest solution would be to make the cart attributes required and enable form validation (here's an example).

joe-adelie
Shopify Partner
7 0 6

@Jesse_Meyers This was the answer! We were already saving the values on the product page to local storage so just needed to add the inputs to the cart page as hidden fields and populate them with the saved dates. The .json trick is super helpful as well! Appreciate the help. Order has already come through and contains the needed info.

dorforman23
Tourist
5 0 3

Hi, for all of those who still facing some really really weird issues with the attributes.
A great workaround solution I found is the following -
1) Remove the name="attributes[someId]" field, not needed at all.
2) Add an onchange=addAttribute(this.value, 'attributeId'); on each <input> or <textarea>
3) Inside the addAttribute -
  function addAttribute(value, attributeName) {
      jQuery.post('/cart/update.js', `attributes[${attributeName}]=${value}`)
   }

So everytime there's a change in the input / textarea you'll invoke this function that adds / updates the that specific attribute's value.

Hope it helps anyone who came across this one.

numo
Shopify Partner
2 0 2

Great Advice!

Obviously, standard HTML rules apply. You still require the name attribute (name="whatever") on specific inputs like radio types to ensure only one selection is chosen. Only name attribute isn't relied on for attribute form-data.

Thank you @dorforman23  - I'd say this is the best answer available.

badprogrammer
Shopify Partner
1 0 0

This worked! Been stuck on this problem for a whole day. Thanks!! XD

Rotomart
Visitor
1 0 0

I want to attempt this workaround but I'm really new to this stuff and don't know exactly where each section goes. I notice you are using JS but I don't know exactly where to put everything. Would you be able to show this in action on an example?