Shopify themes, liquid, logos, and UX
So I currently have some code that puts a message on products that are supplier order only. Which is like this:
{% if product.vendor contains "Ohlins" and current_variant.inventory_quantity == 0 %}
<br>
<p style="color:#FF0000";> This product is special order with Ohlins. Orders normally arrive within 1 week if in stock with our supplier, please call us on 01977 520852 if you require an ETA </p>
</body>
<br>
{% endif %}
so what I’m wanting to do. Is put those products into a separate location. So I have 2 locations, one for the store and one for warehouse stock.
what I need help with is how I get it to put a similar message for products that are only in stock at one of the locations which is warehouse stock.
Hi @CykelHouse
Steps to Follow:
{% assign warehouse_location = "Warehouse" %}
{% assign store_stock = false %}
{% assign warehouse_stock = false %}
{% for inventory in product.variants.first.inventory %}
{% if inventory.location.name == warehouse_location and inventory.available %}
{% assign warehouse_stock = true %}
{% else %}
{% assign store_stock = true %}
{% endif %}
{% endfor %}
{% if warehouse_stock and product.vendor contains "Ohlins" and store_stock == false %}
<p style="color:#FF0000";>
This product is only in our warehouse and may take a week to arrive.
Call 01977 520852 for details.
</p>
{% endif %}
Let me know if you need help! 😊
Thank you
Hey. Thanks for sending that.
I have applied it to the same place I have my other banners on the product.liquid. But it doesn’t seem to be working. I have changed warehouse location to Cykel House Warehouse. But the banner doesn’t come up.
also is there a way to make it so it does it for any vendor that’s in the warehouse and not just Ohlins.
thanks again for your help and look forward to your response.
Regards
Gavin
In Canada, payment processors, like those that provide payment processing services t...
By Jacqui Mar 14, 2025Unlock the potential of marketing on your business growth with Shopify Academy's late...
By Shopify Mar 12, 2025Learn how to increase conversion rates in every stage of the customer journey by enroll...
By Shopify Mar 5, 2025