Hello Shopify community -
We are currently selling internationally and we have two warehouses using Shopify's built-in location-based inventory feature. We are also using Shopify's geolocation app. Everything works well for our logistics (who are using the API to only pull orders they ship to), however one issue we keep running in to is stock availability on the front end.
Obviously the front end is displaying something in stock if the combined inventory between both locations is >0. What we would like to do is to set up rules to show a product as out-of-stock to customers visiting from certain countries, IF that product is out-of-stock in the warehouse location we would ship to them from.
The simplest form of this logic would be:
if [customer] is in [list of countries] then show "add to cart", else show "out of stock".
A more complex/automated version would pull inventory count on a per-location basis (rather than the total inventory) and show the appropriate button, but that would be a bonus not a necessity. I am already aware of an app (GeoIP Blocker) that will hide products based on geoIP rules, however this would hide the product entirely from these visitors including our "back in stock" notification button which we want to avoid.
Is there any way that we can integrate this using JS/Liquid rather than an app/private app? I don't mind having to modify the code regularly to include/exclude specific products in the logic as we don't often run out of stock but it does happen and it would be great if we could set a product as out of stock based on IP when the need arises.
Thanks in advance for your thoughts, and please let me know if you require further explanation!