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.

Issue with add.js dropping properties

Issue with add.js dropping properties

ianjohn27
Tourist
6 0 3

Hi,

We've been having a sporadic issue lately where certain line items will lose their properties after they're in the cart. We cannot fulfill our orders without these properties, so this has been a significant support issue for us.

 

We're using the /cart/add.js script to add the items (and this method words for 99% of all orders).

 

For example a customer adds an item to the cart like so -- to the /cart/add.js endpoint:

 

array (
'type' => 'nl-add-to-cart',
'item' =>
array (
'quantity' => '4',
'id' => '794508781',
'properties' =>
array (
'Typeface' => 'Palm Springs',
'House-numbers' => '4990',
'Orientation' => 'horizontal',
),
)

 

And the script received this back from the endpoint:

 

array (
'items' =>
array (
0 =>
array (
'id' => '794508781',
'properties' =>
array (
'Typeface' => 'Palm Springs',
'House-numbers' => '4990',
'Orientation' => 'horizontal',
),
'quantity' => '4',
'variant_id' => '794508781',
'key' => '794508781:11ec7c81914b6bc7a00e58332e33447e',
'title' => 'Numbers + Letters - 6" / matte black powder coat',
'price' => '3080',
'final_price' => '3080',
'final_line_price' => '12320',

...
etc.

 

That sure LOOKS like a successful transaction to me!

 

But the final order did NOT have these properties:

 

'Typeface' => 'Palm Springs',
'House-numbers' => '4990',
'Orientation' => 'horizontal',

 

Anyone have any ideas why this would be happening? It feels a lot like a bug on shopify's end, mostly because we have hundreds of orders with similar attributes that work fine.

 

thanks!

 

Replies 3 (3)

Jason
Shopify Partner
11206 226 2317

I doubt this is a bug. What apps do you have in place that could alter a cart, or perhaps create a new checkout?

 

Getting a successful response with the AJAX call doesn't mean that is the final cart that is used for the checkout. Things (like apps) can interrupt the default flows.


Sharing a store link and replication steps would go some ways to giving the forum members something tangible to look at.

★ I jump on these forums in my free time to help and share some insights. Not looking to be hired, and not looking for work. http://freakdesign.com.au ★
ianjohn27
Tourist
6 0 3
I wish there was a way to replicate this — but I cannot find a pattern. We get about a thousand orders each month, and of those maybe 4-5 will have this issue. We have no apps that modify the cart contents before or during checkout. I was just hoping to hear if anyone else had ever had this issue since it’s really baffling.
ianjohn27
Tourist
6 0 3
Jason, thanks again for your response. While I cannot provide replication instructions as there aren't any, I can provide a link to the store. https://www.modernhousenumbers.com/products/house-numbers-letters As you can see, the properties (finish, numbers, font) show up in the fly-out cart, and carry over to the shopify-hosted checkout page. There are no opportunities that I'm aware of to modify the properties once they're in the cart -- you can only remove the entire line. The issue is that just about 5 times a month, or about .5% of the time, when we actually open the order in shopify the properties are simply not there. If this was a coding error on our side, you would think it would show up a whole lot more often and predictably. Additionally I've add a post-cart-add hook that records the payload that shopify sends back, and in every case the properties are reflected. So it just really feels like a bug on the shopify end; it's hard to see how browser differences could be a factor.