Modifying an order's attributes on Thank You page

Modifying an order's attributes on Thank You page

AlexF_
Shopify Partner
17 0 21

Hi,

Is there a way to modify the attributes of an order on its Thank you page ? We can add liquid and JS on this page but I didn't see any way of doing it, the AJAX API allows to edit the cart attributes, but it's not usable anymore once the order is placed.

In last resort I will probably create a GCP Cloud Function that will call the Admin API when I AJAX something to it, but I would like to use a more native Shopify way if there is one.

Replies 3 (3)

Jason
Shopify Partner
11207 226 2319

No. By the time you are on the Thankyou page the order has been created so you’d be left with API options.

Why can’t the attribute be added before checkout? Knowing a bit of context into why you need it could reveal other approaches.

★ 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 ★
AlexF_
Shopify Partner
17 0 21

This is an unusual demand but the circumstances are unusual as well. We're actually setting the cart attributes before the checkout, but we're using the Mondial Relay official app, which happens to dynamically set its own order attributes after it's placed (the customer has to chose the relay point on the Thank You page with their script). The only problem being that when they update the order's attributes, they erase all the previous attributes set, which is a terrible behavior. Their customer support say that it's because they can't afford to make one more API call to retrieve existing attributes because of their huge clients and the API rate limit, but I'm sure there would be many other ways for them not to break this system.

So I basically need a way to set back the attributes they remove after the client chose their relay point. 

(Btw, is there a way to report this kind of practice to Shopify market place ? This behavior is obviously not mentioned in their documentation)

Jason
Shopify Partner
11207 226 2319

I'd be questioning or at least challenging on the API call rate. Get the view on how many calls they actually need today. Even if on the smaller plan giving 2 calls per second that's still quite a lot for a lot of merchants when it comes to the amount of orders being created and updating a property afterwards. You might find it's not really a problem at all to make a call to get latest data set.

There's also the option of storing the attribute current externally if there was a super strong desire to avoid an API call. So order is created with attributes in place, that info can flow to a DB via webhook, and you pull the data from that db instead of making an request to get it. 

Are attributes the right place for this to live? Perhaps you might get them as attributes to start with but for the final choice perhaps you update a metafield instead. It's an API call either way.

★ 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 ★