Re: Store availabilities on product variant no longer working

Store availabilities on product variant no longer working

Cavera
Shopify Partner
24 0 10

Shopify support is being no help. Can anyone answer a very simple question?

{% liquid
  assign product_variant = product.selected_or_first_available_variant
  assign pick_up_availabilities = product_variant.store_availabilities
-%}

I can confirm that product variant is returning a valid variant object with all of the expected attributes. I can confirm that the product I'm testing has 1 in stock at a specific location. Why is pick_up_availabilities returning an empty array?

 

Also, it's worth mentioning that this did work at some point and recently it stopped. Nothing has changed in the theme so not sure where to look

Replies 3 (3)

polguixe
Shopify Partner
18 1 5

I am observing the same issue. 

store_availabilities

is no longer present on variants 

https://origen.studio

ctee
Shopify Partner
1 0 0

Has anyone figured this out?  Any input from Shopify?  variant.store_availabilities is still in the Liquid documentation, but I cannot get anything returned for it.  I did read and understand the limitations explained in the documentation.  I have a use-case which requires knowing if a variant is available from a specific location.

JeffN
Shopify Partner
1 0 0

I was able to figure this one out on my own. In my instance, the store using multiple locations for tracking inventory as well as multiple shipping rules. My issues was being caused by the fact that my default inventory location (where the qty was stored) had not been added to the shipping rule responsible for where I was viewing the site from (I was in Canada and the shipping rule for Canada for this store didn't have this inventory location set as a valid fulfilment location).

 

I personally feel that Shopify does need to fix this and instead of not returning a value for the inventory at a specific location, it should have some means of seeing that it is available but just not in your current location. I was able to solve the issue here but just setting that location as available in my country but that may not be a solution for some others. I hope this helps.