Show inventory from specific location for logged in customers

Show inventory from specific location for logged in customers

Saba13
Shopify Partner
23 2 5

Good day

 

Hope everyone is doing well!

 

I want to show inventory from my location 'Main Warehouse' for customers who are logged in and have the tag 'wholesale'. If they buy something, it should subtract inventory from that location only (some products are available in warehouse and other locations at the same time).

 

I'm using an app for wholesale sign up form and tagging customers automatically. This is working but how do I set up that these customers only buy from the warehouse and not from the other locations.

 

Any help will be greatly appreciated. App-solution will also be accepted.

Replies 2 (2)

PageFly-Amelia
Shopify Partner
576 162 232

This is Amelia from PageFly - Landing Page Builder App

To ensure that wholesale customers tagged with ‘wholesale’ only see and purchase inventory from your ‘Main Warehouse’ location, you can follow these steps:

  1. Create a Custom App or Script: You might need a custom app or script to handle this specific requirement. This app can check if a logged-in customer has the ‘wholesale’ tag and then adjust the inventory location accordingly.

  2. Use Shopify’s Locations API: Shopify’s Locations API allows you to manage inventory across multiple locations. You can use this API to ensure that orders from wholesale customers are fulfilled from the ‘Main Warehouse’ only

  3. Modify the Theme Code: You can modify your theme’s code to filter products based on the customer’s tag. This involves using Liquid code to check if the customer is tagged as ‘wholesale’ and then displaying only the inventory from the ‘Main Warehouse’.

    Example:

    {% if customer.tags contains 'wholesale' %}
      {% assign location_id = 'main_warehouse_location_id' %}
      {% for variant in product.variants %}
        {% if variant.inventory_management == 'shopify' and variant.inventory_policy == 'continue' %}
          {% assign inventory_quantity = variant.inventory_quantity %}
          {% if inventory_quantity > 0 %}
            <!-- Display variant -->
          {% endif %}
        {% endif %}
      {% endfor %}
    {% endif %}
  4. Custom Fulfillment Logic: Implement custom fulfillment logic in your Shopify admin or through an app. This logic can ensure that orders from wholesale customers are always fulfilled from the ‘Main Warehouse’.

Hope that my solution works for you.

Best regards,

Amelia | PageFly

Please let me know if it works by giving it a Like or marking it as a solution!


➜ Optimize your Shopify store with PageFly Page Builder (Free plan available) 
➜ Weekly updated Shopify tutorials on YouTube 


All features are available from Free plan. Live Chat Support is available 24/7.

Saba13
Shopify Partner
23 2 5

Hi Amelia,

 

Thank you so much for your response!

 

I just wanted to clarify one thing: how do I go about implementing custom fulfilment logic?

 

I was under the impression that when a location is set as the default/primary location on Shopify, it automatically subtracts product quantity from that location for shipping. Since we don't offer pick-up, this shouldn't be an issue for us.