I would like to add “Remote Storage” insted of “In stock” or “Out of stock” on my product page. I can’t just change that in “default theme content” because that would obveusly change every product. I would like to be able to tick a box to apply for exactly the items that are in remote storage.
Kind of like you can under the Inventory section on the product edit page. “Track quantity” and “Continue selling when out of stock”. Under those boxes I think it would be cool to have an “Remote storage” box.
Does someone here know how to get the coding right? Thanks
If this is pattern is only for one product, you could create an alternative JSON template that is only applied to the product and create a matching new alternative main-product.liquid section file where you’re replacing the out of stock message with your custom one. Then this section file would be included in the alternative product template file, and you could assign this product on the admin to use this template.
This might be the easiest approach, if it’s just one product that would follow this pattern, but it also could be worth looking into using metafields too if there’s plans on more?
Would you be able to apply product tags to the products which should say “Remote storage”? If so you could keep the same product section and not use alt templates but set up some logic with Liquid so that a different message is displayed for out of stock.
A model for this could be:
{% if product.available == false %}
{% if product.tags contains 'special' %}
Remote Storage
{% else %}
Out of stock
{% endif %}
{% endif %}