Shopify / mobile-buy-sdk-ios

Shopify’s Mobile Buy SDK makes it simple to sell physical products inside your mobile app. With a few lines of code, you can connect your app with the Shopify platform and let your users buy your products using Apple Pay or their credit card.
MIT License
452 stars 199 forks source link

Filter out "Out Of Stock" products. #988

Closed MVakas closed 5 years ago

MVakas commented 5 years ago

Is there any possibility that I can query and only get the available products. I don't want the 'Out of stock' products?

morganmccunn commented 5 years ago

Hi @MVakas - On the Product object there is an availableForSale field that you can use. See help docs for details. If a product is out of stock, then it is not available for sale. Hope that helps!

MVakas commented 5 years ago

I am aware of avaialableForSale, with this field I have to filter out after I have fetched all the products including the one not available for sale. I want to fetch only the available products.

MVakas commented 5 years ago

The problem is that I’m getting too many products which are of stock.

rebeccajfriedman commented 5 years ago

As per the API documentation, you can filter your products by availableForSale using the query filter parameter.

MVakas commented 5 years ago

Thanks I'm able to filter out the products using available_for_sale

Komal2905 commented 4 years ago

@MVakas Can you specify how you able to filter out products which are out of stock ?

MVakas commented 4 years ago

available_for_sale Use this tag.

Komal2905 commented 4 years ago

@MVakas but I am not sure how to use that tag. should I create custom collection which this condition ? if you could provide sample query for it , then that will be so useful