Shopify - Sold out problem for "Don't track inventory" items

We have a problem for items marked with inventory policy “Not tracked by Shopify”. While this allows us to sell custom-made orders without holding inventory (bulk of our products are made to order, and hence technically should not track inventory), this shows up as sold out item in algolia search results and hence out of stock displayed after a single sale.

The reason is, inventory is anyway counted internally in shopify but not displayed. If we change the policy to “Shopify tracks this products inventory”, on a previously inventory not tracked item, we can see that internally it has counted down from 1 and to a negative number depending on sales i.e. if one item was sold, internally stock is zero, and -1 for next and so on, but customers don’t see inventory and can buy as usual.

{Note1: This is not a case of inventory being tracked by Shopify and marked with “Allow customers to purchase this product when it’s out of stock” option. We do that too, and modify the add to cart button to pre-order if that is the case.

Note2: Items marked with “Allow customers to purchase this product when it’s out of stock” option also shows as sold out on search results - no wonder our preorders tanked.}

We have sort of handled it for now by making all items inventory tracked by Shopify, and marking it as 1000 or so, but that is inelegant as well as problematic when we do want to track some items based on inventory. Also if we sell 1000 of something, then it means we have to go back and edit inventory and potentially we might not even notice it.

Any idea how to fix it?

1 Like

Thanks for letting us know! This is definitely not the expected behavior and I definitely apologize for this issue!

I’ve just published a fix (see ChangeLog) to correct this behavior. This would apply if you choose to reinstall us in your theme.
The inventory quantity will continue to go under 0, this is expected (while not perfectly intuitive, I agree :slight_smile: ).
In case you’ve modified our code, the diff will be ultra simple to apply though:

--- a/assets/algolia_instant_search.js.liquid
+++ b/assets/algolia_instant_search.js.liquid
@@ -239,7 +239,11 @@
         transformData: {
           item: function (product) {
-            product.can_order = product.inventory_policy === 'continue' || product.inventory_quantity > 0;
+            product.can_order = (
+              product.inventory_management !== 'shopify' ||
+              product.inventory_policy === 'continue' ||
+              product.inventory_quantity > 0
+            );
             return product;

Trying to implement this fix for non tracked items and gift cards, but it seems to break the page. I’m wondering if I need to update my version. If i reinstall the app in my shopify store, will it retain all the settings in the app? css, metafields, etc when I reinstall with the new version?

Hi @kaine . Would you mind opening a new topic in which we’d be able to discuss more about your specific issue? :slight_smile:
Please include any screenshot and / or code which you believe would be helpful.