Shopify Liquid store_availability is empty

theheartypixel
Tourist
7 0 2

Product JSON data also yields nothing as far as store availability:

 

{
   "id":2093386236000,
   "title":"Mint Chocolate \u0026 Almonds Holiday Gift Box",
   "handle":"mint-chocolate-almonds-holiday-gift-box",
   "description":"\u003cp\u003eThis delightful gift has a combination of sweet and salty treats and will be a hit with anyone on your list! \u003c\/p\u003e\n\u003cp\u003eHand-packed in a tasteful green gift box, each gift includes the following: \u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eone pound bag of Milk Chocolate covered almonds\u003c\/li\u003e\n\u003cli\u003eone pound bag of Mint Chocolate covered almonds\u003c\/li\u003e\n\u003cli\u003eone 6 oz can of Wasabi \u0026amp; Soy Sauce almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Roasted Salted almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Honey Roasted Chipotle almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Salted Caramel almonds\u003c\/li\u003e\n\u003cli\u003ethree 1 oz foil packets of Smokehouse almonds\u003c\/li\u003e\n\u003c\/ul\u003e",
   "published_at":"2019-04-18T14:45:14-07:00",
   "created_at":"2019-04-18T14:45:16-07:00",
   "vendor":"BDG",
   "type":"Sweets and Specialty Items",
   "tags":[
      "gift",
      "gift box",
      "gift pack",
      "type:Jordan Almonds",
      "type:Lemon"
   ],
   "price":4795,
   "price_min":4795,
   "price_max":4795,
   "available":true,
   "price_varies":false,
   "compare_at_price":null,
   "compare_at_price_min":0,
   "compare_at_price_max":0,
   "compare_at_price_varies":false,
   "variants":[
      {
         "id":37268036845729,
         "title":"Small",
         "option1":"Small",
         "option2":null,
         "option3":null,
         "sku":"2026",
         "requires_shipping":true,
         "taxable":false,
         "featured_image":null,
         "available":true,
         "name":"Mint Chocolate \u0026 Almonds Holiday Gift Box - Small",
         "public_title":"Small",
         "options":[
            "Small"
         ],
         "price":4795,
         "weight":2268,
         "compare_at_price":null,
         "inventory_management":"shopify",
         "barcode":"",
         "requires_selling_plan":false,
         "selling_plan_allocations":[
            
         ]
      }
   ],
   "images":[
      "\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_inner.jpg?v=1555623916",
      "\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_outer.jpg?v=1555623916"
   ],
   "featured_image":"\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_inner.jpg?v=1555623916",
   "options":[
      "Size"
   ],
   "media":[
      {
         "alt":null,
         "id":1667585998944,
         "position":1,
         "preview_image":{
            "aspect_ratio":1.0,
            "height":851,
            "width":851,
            "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_inner.jpg?v=1569218684"
         },
         "aspect_ratio":1.0,
         "height":851,
         "media_type":"image",
         "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_inner.jpg?v=1569218684",
         "width":851
      },
      {
         "alt":null,
         "id":1667586031712,
         "position":2,
         "preview_image":{
            "aspect_ratio":1.0,
            "height":664,
            "width":664,
            "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_outer.jpg?v=1569218684"
         },
         "aspect_ratio":1.0,
         "height":664,
         "media_type":"image",
         "src":"https:\/\/cdn.shopify.com\/s\/files\/1\/0094\/5730\/3648\/products\/mint_box_outer.jpg?v=1569218684",
         "width":664
      }
   ],
   "requires_selling_plan":false,
   "selling_plan_groups":[
      
   ],
   "content":"\u003cp\u003eThis delightful gift has a combination of sweet and salty treats and will be a hit with anyone on your list! \u003c\/p\u003e\n\u003cp\u003eHand-packed in a tasteful green gift box, each gift includes the following: \u003c\/p\u003e\n\u003cul\u003e\n\u003cli\u003eone pound bag of Milk Chocolate covered almonds\u003c\/li\u003e\n\u003cli\u003eone pound bag of Mint Chocolate covered almonds\u003c\/li\u003e\n\u003cli\u003eone 6 oz can of Wasabi \u0026amp; Soy Sauce almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Roasted Salted almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Honey Roasted Chipotle almonds\u003c\/li\u003e\n\u003cli\u003e\n\u003cspan\u003eone \u003c\/span\u003e6 oz can of Salted Caramel almonds\u003c\/li\u003e\n\u003cli\u003ethree 1 oz foil packets of Smokehouse almonds\u003c\/li\u003e\n\u003c\/ul\u003e"
}

 

0 Likes

I have problems here too. It worked to the last days and I got at least the correct information back. But after I changed some location configuration (I added/enabled one) I only get one stalled information about availability at one location that is already zero and there is no inventory available anymore. On the other hand the other two locations which have inventory are not even showing up.

0 Likes
DionSmith
Excursionist
13 0 4

I really don't understand Shopify sometimes. This is clearly a liquid object issue and they keep trying to tell me it has to do with a theme and that I should get some help from the Shopify Experts. I don't need a shopify expert to tell me what I already know.

Here is Shopify's response.

 

I was just double checking with our team if this was anything that could be looked at. From my end there is nothing that I can further do for you on this, I recommend reaching out to a Shopify Experts to see if there is anything that they can take a look at or see if anything can be changed to get this working properly for you!

0 Likes

I think the main problem here is, that it is obviously not a publicly documenter "Ajax API" (yet), besides the blog post and some bits and pieces here and there it is not clearly documented. For our customer the reference/test implementation just stopped working last week, before that everything was fine. Now the returned response is not empty or anything, its just wrong, not up-to-date and reflecting the current inventory situation.

Now the customer cannot test this in detail and we have to postpone it.

The only other solution would be to implement it on the Warehouse and let it populate some metafields, which just does not make sense if we (theoretically) already have this information available.

0 Likes
teifidigital
New Member
1 0 0

Hello everyone!

This has been bothering me for weeks! But I figured out how to fix the issue. Essentially, I think shopify changed some rules where the availability object required in-store pick up to actually be enabled for those locations it wont work properly. 

I had imported my entire catalogue and had items stocked in only certain locations with picked up enabled. Then I disabled pick up and added new products and stocked new products in new location but this was not showing on the front end of the site. After I re enabled pick up for all products and waited a few days the availability object had been populated for all 100K of my client's products.

0 Likes
DionSmith
Excursionist
13 0 4

Does anyone have an example of this working on how to use it in the product or product template page?

0 Likes
expandagency
New Member
1 0 0

Also coming up blank on this.

Tested this in a sandbox site

Theme: Debut
File: product-template.liquid
Issue: variant.store_availabilities ( Nothing is returned - EMPTY - 4 locations setup all with stock)

<h1>TESTING</h1>	
<hr>
product.variant.available: {{ product.variant.available }}
<br>
{% for variant in product.variants %}
    <!-- Returns TRUE -->
    variant.available: {{ variant.available }}
    <br>
    <!-- Returns with Qty -->
		variant.inventory_quantity: {{ variant.inventory_quantity }}
		<br>
    <!-- RETURNS EMPTY, NO DATA -->
    variant.store_availabilities: {{ variant.store_availabilities }}
		<br>
{% endfor %}

 

0 Likes
potabox
Tourist
3 0 0

@expandagency Did you enable Pick Up for any location yet?

If not, try it: Go to Settings -> Shipping and Delivery -> In the Local pickup section, select Manage one in the list -> Check to This location offers local delivery

And remember, make sure the variant param in the URL must be present, eg. ?variant=34999421862043

0 Likes
DionSmith
Excursionist
13 0 4

I have tried that and still get no info returning. The info for adding the store info to the page is here but when I use variant.store_availablity.location or available no data is returned.

https://rock-shop-test-account.myshopify.com/collections/men/products/campus-crew-vintage-blue-t-shi...

            <h1>TESTING</h1>
<hr>
product.variant.available: {{ product.variant.available }}
<br>
{% for variant in product.variants %}
    <!-- Returns TRUE -->
    variant.available: {{ variant.available }}
    <br>
    <!-- Returns with Qty -->
variant.inventory_quantity: {{ variant.inventory_quantity }}
<br>
    <!-- RETURNS EMPTY, NO DATA -->
    variant.store_availabilities: {{variant.store_availability.available }}<br>
{{variant.store_availability.location              }}<BR>
                  {{variant.store_availability.available              }}
<br>
{% endfor %}
0 Likes