store_availabilities only returning the default store?

store_availabilities only returning the default store?

StephenK
Shopify Partner
81 7 46

I'm trying to add in store pickup for a client, they currently have two stores.

Screenshot 2022-01-17 at 19.59.12.png

I have a product with stock at both locations

Screenshot 2022-01-17 at 19.59.48.png

Then added some debug code to the theme I'm working on based on the Liquid docs and stuff in the Dawn theme repo.

{%- assign current_variant = product.selected_or_first_available_variant -%}
      {{ current_variant.store_availabilities.size | json }}
      {% for store_avail in current_variant.store_availabilities %}
      {{ store_avail.available | json }}
      {{ store_avail.location.name | json }}
      {{ store_avail.pick_up_enabled | json }}
      {{ store_avail.pick_up_time | json }}
      {% endfor %}
      
      
  	{%- assign pick_up_availabilities = current_variant.store_availabilities | where: 'pick_up_enabled', true -%}
      {{ pick_up_availabilities.size | json }}

 However only one of the stores gets output.

Screenshot 2022-01-17 at 20.00.05.png

 

Anyone else have this issue, or is there something I've missed?

 

 

 

Some Shopify/Ecommerce related articles - https://medium.com/@stephenkeable
Reply 1 (1)

jayzambrano
Shopify Partner
1 0 0

Confirm your addresses are verified.
Go to Admin > Settings > Locations.

Edit the location that's not coming up in your store_availabilities data.
Make sure you're not getting the following message when you edit an address.

 

jayzambrano_0-1664208921675.png


Use the address autocomplete field so Shopify can help you add your address in the correct format, Save your location.

After this you should see your location in the store_availabilities data.