Additional cart item properties available in Shopify's AJAX API response
API
Effective July 08, 2019
We've added new properties on cart items listed in the JSON response of Shopify's AJAX API. Each cart item listed in the items
array has the following additional properties.
-
featured_image
: an object with the varaint image'salt text
,aspect_ratio
andurl
. options_with_values
: an array of objects with each product option'sname
andvalue
.product_has_only_default_variant
: a boolean describing if the product only has a default variant.
This gives theme developers more information about cart items when working with the AJAX API to build storefront designs.
To learn more about interacting with the cart through AJAX calls, read about the Shopify's AJAX API in the Shopify Help Center.
You can also read about these new properties' Liquid equivalent in the line_item
object in the Shopify Help Center.