stock_level property not available on variant level products on category page
I'm attempting to build a toggle on the category page that will toggle in stock items only. So, when toggle on, it will show in stock items only, when toggled off, it will show all products. My plan was to get the {{stock_level}} of each product within the product card component, and basically just hiding that element if the stock_level is zero.
The issue I'm having is that if inventory is tracked at the variant level, it won't give me a stock_level value for this product. Ideally, I would be able to just get a total stock_level of all variants, and if it's over 0, then show this product. However, I don't see anything regarding variant inventory in the product object.
Any help/ideas on this would be greatly appreciated.



