Shopify / js-buy-sdk

The JS Buy SDK is a lightweight library that allows you to build ecommerce into any website. It is based on Shopify's API and provides the ability to retrieve products and collections from your shop, add products to a cart, and checkout.
https://shopify.github.io/js-buy-sdk
MIT License
987 stars 262 forks source link

Property to indicate an out-of-stock variant for pre-order sale #689

Open rojakcoder opened 5 years ago

rojakcoder commented 5 years ago

I have products that are available for pre-order sales. In my custom frontend, I want to indicate these items as such i.e. this item is for sale, but is for pre-order (meaning the customer has to be prepared to wait).

The JS Buy SDK only returns a available property that indicates whether the variant is available for sale. However, this value returns true if I set "Continue selling when out of stock". There is no indication that there is no stock. It will only return false if I set "Stop selling when out of stock". However, doing so will cause the item to be unable to be purchased during checkout because it is out of stock.

A separate property (e.g. hasStock or preorder) would be useful to indicate that the variant is for pre-order only.

The Admin API does have the API for getting the inventory level but the exact number is not what I'm looking for. To have to provision a different set of API to get this particular "pre-order" feature seems quite a bit of overkill.

I understand that the inventory level is considered a private piece of information which is why it is not in the JS Buy SDK. Is it possible then to expose the "Continue selling when out of stock" property as a different data property of the variant?

morganmccunn commented 5 years ago

Hey @rojakcoder - this is already on our backlog! Something we have heard a few times before, we will keep this in mind. Thank you for the detailed issue!

I will post an update here when we are able to add this functionality.

helmutgranda commented 2 years ago

Hi all,

I am trying to find the backlog to see if this feature was ever worked on or if it is already in flight. Anyone has any idea what has happened to it for the past 3+ years?