All things Shopify and commerce
Hello,
I am using Storefront API to get the order history of the users, then I list the different line_items. But some line_items have the variants object to null, I need this object because it contains several information.
Do you know why some line_item have the variants object to null?
Thank you.
Fair to assume that the items missing no longer exist in the shop? So the reference being nullified would be a reflection of that.
Hello Jason,
Thank you for your answer but this is not the case for all products. Some old products are no longer available, but others recent products are still available but with an empty object variant.
Any news on this? I'm having exactly the same problem
Items exists in the shop, status is set to active.
But the variants field returns null.
Also - if it was a reflection of the item missing or no longer existing howcome its returning valid data for title etc?
According to Shopify docs:
Deleted objects are not available in the API. The product variant ID is the only detail you can get when a product variant is deleted. Other details are not available.
https://help.shopify.com/en/manual/shopify-flow/reference/triggers/product-variant-deleted#api-detai...
I see that REST API returns the variantid but other details are null. whereas GraphQL returns variant null
We also are seeing this when using the checkoutCreate storefront mutation, no errors no issues, but this is what is returned for the checkout lineItems:
"lineItems": {
"nodes": [
{
"title": "Personalized Cartoon Phone Case",
"quantity": 1,
"variant": null
}
]
}
Any ideas? The product is available in the custom app's sales channel.
We can also query this ProductVariant node from the storefront api with no issues as well.
This only happens with random variants and we can't seem to figure out why.
Portrait of Stephen positioned next to an image of planet Earth, with the Stephen's World ...
By JasonH Mar 18, 2024Digital marketers and app developers have tracked activity in apps and websites for yea...
By Ollie Mar 13, 2024February was an exciting month with Shopify Editions, informative webinars, and more! F...
By JasonH Mar 7, 2024