All things Shopify and commerce
Hey all,
I'm struggling a bit to engineer a solution for this one. Any insight or advice would be appreciated.
Right now I'm working on an online store for 11 retail stores. We only need local pickup and delivery, no shipping whatsoever. The main problem is order validation. There's no built-in or third party method that I can find which will allow users to select a location, build an order based on the inventory for that location, and seamlessly take that order through checkout with pickup/delivery for that location.
Right now, customers have to hope (and ideally check first) that all the items they want are available at a single location. If not (which I foresee being a common occurrence) then the checkout page will bug out and never fully load. There's not even an error message. 🤦
From what I can tell this is because the Shopify API doesn't allow software to pull data regarding product/variant inventory levels by location, but rather just total inventory.
I'm wracking my brain for a way to achieve this goal but I don't see any easy solution for this. I'm so perplexed; does Shopify not use/test its own platform? I assume that this lack of functionality is a dealbreaker for many businesses. Additionally, API access to location-specific inventory seems like it would be a great idea as it would allow large businesses to much more easily connect their Shopify inventory to third-party delivery apps.
Thanks in advance y'all.
Solved! Go to the solution
This is an accepted solution.
Hmmm. I feel like maybe something like having an API retrieve all your warehouse locations then display the inventory of each location on the product page instead of just 1 inventory could work. Then you would need to then handle the inventory adjustment once a person purchases with another call. You would probably want some kind of reminder of which address to pick up at in the checkout as well. If your locations are pretty close together I would also probably only show the user 3 of the closest locations with inventory. I was digging around in the documentation earlier and playing with some ideas. I know it can be done but would require some app development. It is wild that this is even a thing. Seems like this is something that needs to be out of the box already available. If I do come up with a solution I will pass it along but might take some time to figure out. Throw any ideas my way.
Check out these guys: https://www.zapiet.com/shopify/store-pickup-delivery
Looks like they do validation for inventory based on geolocation.
I will keep thinking of some possible free solutions. If these people can create an app that does what you need, there has got to be a way.
I've looked at this app! I'm not sure if geolocation will be ideal for us since all of our stores are generally in the same area of one city... but I'll give it a shot!
This is an accepted solution.
Hmmm. I feel like maybe something like having an API retrieve all your warehouse locations then display the inventory of each location on the product page instead of just 1 inventory could work. Then you would need to then handle the inventory adjustment once a person purchases with another call. You would probably want some kind of reminder of which address to pick up at in the checkout as well. If your locations are pretty close together I would also probably only show the user 3 of the closest locations with inventory. I was digging around in the documentation earlier and playing with some ideas. I know it can be done but would require some app development. It is wild that this is even a thing. Seems like this is something that needs to be out of the box already available. If I do come up with a solution I will pass it along but might take some time to figure out. Throw any ideas my way.
Zapiet ended up working up well enough with one of their more premium plans. Thanks!
Hi Ryan,
It sounds like what you're looking for is a way to:
If so, then a solution might be possible. However, it would be complex, and have several moving parts:
1. Allowing users to select one of your store locations
You can probably create a custom Liquid page template, with a list of all your store locations. When the user selects a location, you can store its ID as a cart attribute for later reference.
You might consider also editing the product page template, to disable the add to cart button if the customer hasn't selected a location.
2. Determine which products are unavailable at the current location.
This would be the hardest part.
The `location` object in Liquid doesn't have a way to check inventory levels AFAIK: https://shopify.dev/docs/api/liquid/objects/location
However, the Admin GraphQL API `Location` object has an `inventoryLevel()` property you can use to check the inventory level of a specific item at that location: https://shopify.dev/docs/api/admin-graphql/2023-10/objects/Location#field-location-inventorylevel
The hard part would be to communicate between the GraphQL API and your pages. You might need an app (either a custom app or a public app) that gets called in an AJAX request in the next steps.
It's not as clean as pure Liquid, unfortunately.
3. Prevent customers from seeing unavailable products on collection pages.
If you do an AJAX call as mentioned above, you can then dynamically apply CSS styles to hide unavailable products on the site.
For example, you could use `display: none` to hide them entirely. Or if that's too jarring/janky, you can gray out the images for unavailable products, and display a badge/banner saying "Unavailable at this location."
4. Also, prevent customers from adding unavailable products to their cart.
You would need to edit the product page template to also add an AJAX call. If the product is unavailable at the current location, you can dynamically disable the "Add to cart" button and add a message to it.
If you are on Shopify Plus, then you can go one step further and use the Cart/Checkout Validation Functions API to prevent customers from checking out entirely, if they have an unavailable item in their cart.
If so, then I recommend:
---
Let me know if this sounds like it would meet your needs. I'm always looking for opportunities to build new public Shopify apps.
And if you build this functionality in-house, then I hope the information I provided has been useful.
- Tobe
Update: You might be able to use an app proxy to make it easier to communicate with the theme and your API:
https://shopify.dev/docs/apps/online-store/app-proxies
Thanks for sharing your insights on managing store location selections and inventory visibility in Shopify. It sounds like a complex but feasible solution you're outlining!
I wanted to add that I recently developed an app called MultiLocation Stock info which addresses similar challenges. Created it to not to only display location inventory but allows customers to choose their fulfillment location directly on the frontend. Additionally, it provides a warning message if any items in the cart cannot be shipped from the single location.
Would love to hear about your thoughts.
Hey Community! As we jump into 2025, we want to give a big shout-out to all of you wh...
By JasonH Jan 7, 2025Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024