Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
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.
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:
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.
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
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 %}
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.
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.
Starting a B2B store is a big undertaking that requires careful planning and execution. W...
By JasonH Sep 23, 2024By investing 30 minutes of your time, you can unlock the potential for increased sales,...
By Jacqui Sep 11, 2024We appreciate the diverse ways you participate in and engage with the Shopify Communi...
By JasonH Sep 9, 2024