New variants show as free ($0.00) when added to the cart.

BoxUp
Shopify Partner
38 1 14

Hi everyone,

Has anyone had experience with this? New variants created right before adding to the cart are, most of the time, shown as free products for 20-30 seconds.

If you keep refreshing, eventually the image and correct price show. Until then, only the variant title is correct.

Unsure why the price and image would be unavailable straight away, since as the API returns all the correct information immediately?

Replies 7 (7)
BStubbs
Shopify Partner
130 14 53

Hey @BoxUp , yes! I have had this issue.

The best I could do was assume that while the variant number that is being added to the cart is valid, the Product object has not been updated with the data yet. So when the cart goes to find the information it isn't there, and subsequently, the cart's cache stores blank information for a period of time. This is my working theory, and happy (hopeful!) to be corrected about this. 

I was able to work around this, I used setInterval() to regularly query the Product object and when the new Variant id was present, then added it to the cart. A bit hackish I suppose, but it works in the real world.

I'm really keen to hear from anyone else who has faced this issue.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
BoxUp
Shopify Partner
38 1 14

Hi @BStubbs 

Yeah, that's what we've ended up with for now. I don't imagine there's going to be much that can be done.

Thanks for your reply.

sillycube
Shopify Partner
559 14 86

@BStubbs 

It works but it's too slow. If the customers have to wait for 15s, they will probably leave before the result is returned, assuming that something is out of order

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
BStubbs
Shopify Partner
130 14 53

@sillycube I guess it depends on your use case. Did you find a better way?

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
sillycube
Shopify Partner
559 14 86

@BStubbs 

Currently, I am also using a spinner to wait for Shopify. My use case is using new variants to adjust prices. I'm researching whether I can use a discount instead.

The current way is just too buggy but there is no way to improve it. And I get user complaints every day 

 

BYOB - Build Your Own Bundles, SPO - SEO App to research keywords & edit social link preview
BStubbs
Shopify Partner
130 14 53

@sillycube well of course you would use a spinner, otherwise your problem is just UX. I was wondering if you found a better way to do this programmatically with the API. But doesn't seem like it. 

How long are your intervals set for? 15 seconds seems like a really long time.

Was this helpful? Press like!
Did it fix the problem? Mark it as the solution for others!
Buy me a beer? Well, sure!
sillycube
Shopify Partner
559 14 86

@BStubbs 

Yes, this methodology works but has defects. Therefore, I can only look for another way to do the same thing. This API issue has been existing for a while. I don't think Shopify is willing to solve it in the near future.

Also, I've to set the inventory policy to CONTINUE when creating the variants. This is not desirable but I have no choice. 

I am using ~8s, 15s is safe but not tolerable IMO. You can try to redirect the customers to the checkout page. Just another UX hack

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