Show inventory exclusive to location selected by customer

Show inventory exclusive to location selected by customer

jiajiowdjioajwi
Shopify Partner
1 0 0

Hello!

 

As mentioned in the subject, I am trying to figure out how to display inventory available specific to a location based on customer's input

 

jiajiowdjioajwi_0-1723085388823.png

 

Hopefully this image gives you an idea of what I'm trying to accomplish. For example, if Blueberry Ice has 5 available in St. Catharines and 0 available in Brampton then the following should occur. If the customer selects St. Catharines, they should be able to add it to their cart and if the customer selects Brampton it should show as sold out.

 

I put a Custom Liquid block in the Default Page template (all our products currently use Default Page template) with the following code to create the dropdown shown in the image above:

 

<style>
.myDiv {
  text-align: center;
}
#area {
  text-align: center;
}
</style>
 
<div class="myDiv">
 
<label for="delivery area">Delivery Area:</label>
 
<select class="select-area" id="area">
  <option value="brampton">Brampton</option>
  <option value="st catharines">St. Catharines</option>
</select>
 
</div>

 

From my understanding, I'd need to use jQuery to get the options selected by the customer, then I'd need logic like if select = Brampton then show inventory for Brampton (which I have no idea how to do), and then jQuery again to force reload the page.

 

Any and ALL help is appreciated!

 

Current theme is Dawn 13.0.1

 

Thank you

Reply 1 (1)

LuffyOnePiece
Shopify Partner
642 93 116

Hi @jiajiowdjioajwi 

 

Thanks for posting. I hope your day is going well!

 

While posting your location inventory on your site isn't a native option, you can easily achieve this with an app like Product Inventory Information.

 

This app provides you the ability to show your customers your inventory by location on the product and cart pages. Please note, this is a third party app developed outside of Shopify. As such, any specific questions should be directed to the developer listed on the app listing.

 

In the meantime, I'd love if you could provide your store's URL so I can take a look and provide any relative feedback.

 

Thank you

Sandeep Pangeni
Need help with your store? sandeeppangeni17@gmail.com
For quick response, Contact In WhatsApp +9779867521184