Price for a newly created variant shows after 10-20 seconds on store

sagarkohli
Shopify Partner
6 0 4

Hi,

 

We have created a public app to help Shopify store owners to allow their customers to buy products and the price is dynamically calculated at the time of the checkout process based on the inputs entered on the page. For this, we use the Shopify public API to create a new variant with the dynamically calculated price. However, we do see that when we create a new variant using API and then to the cart, the price on the cart page shows the price as $0 and no image for up to 10-15 seconds. Then if we refresh that page couple of times, it shows the correct price. It seems like a delay in the system somewhere from the time when the variant is created and when that information is available on the store front end. 

Is there a solution to this or any recommendations?

Replies 26 (26)
SanaMinatozaki
Tourist
5 0 0

But how do you handle cart subtotal? Line item price is still zero so the cart subtotal might not be correct

NagoyaDev
Excursionist
26 1 1

@SanaMinatozaki 

What I do after replacing all the missing prices is to get all the item prices, total them, fix price formatting and replace the original subtotal with the new total using DOM manipulation.


NagoyaDev
Excursionist
26 1 1

Also, when the user goes to actually check out, the car page will hang and load until all of the correct pricing has been completely added to the cart so you will never have an instance where a customer can checkout with a zero-priced item.

sillycube
Shopify Partner
777 17 124

Even I try to use GraphQL (product variant create) to create the new variant. It still takes a long time to show the correct data on the cart page. 

Hope Shopify can improve it. It's the backend issue that app developers cannot control. And it's seriously affecting the conversion rate on the cart page

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
SanaMinatozaki
Tourist
5 0 0

@NagoyaDev In another of your posts, you mentioned that @PaulNewton 's method would work although you didn't try it.

I've read his post but couldn't understand. Can you elaborate on this one?

PaulNewton
Shopify Partner
4878 412 1053

@SanaMinatozaki if you mean my post about a dummy product it's just that, create an unpublish product with placeholder data.

When the custom stuff comes in push that the existing dummy product basically skipping waiting on a roundtrip if you were to create everything at once.

Never seen if it's done in the wild though since its kinda the reverse of what a lot of apps and customizations do: a dummy cart , or loader preventing checkout until the product is ready.

 

Finally Combinable Discounts - EARLY ACCESS ONLY - Use Free Shipping With Other Discounts

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org
Problem Solved? ✔Accept and Like solutions to help future merchants
Confused? Busy? Buy a custom solution paull.newton+shopifyforum@gmail.com
NagoyaDev
Excursionist
26 1 1

@sagarkohli I actually based my app around the functionality of this app and actually yes you do need to wait 10-20 seconds when you use it. 

The app will actually console log how long it takes and the three times I tested it, they all took about 15 seconds