Hi,
I’m attempting to set up some items for pre-order on my store. I need to alter the product badge to say “pre-order” instead of “Sold out” like it currently does, but ONLY on products that are tagged with ‘preorder’.
Customers should be able to add these carts to usual and check out as if there were an inventory quantity of =>1.
It’s been a LONG time since I’ve done any code myself, but I attempted this with the code I’ve pasted below into the following files, although this has not worked and I don’t know where I’ve gone wrong.
I’m using the “Refresh” Theme in V14.0.0
Anyone able to help point me in the right direction and get this working?
Thanks
- Bel
Added to Snippets - card-product.liquid
{%- if card_product.available == false and product.tags == “preorder” -%}
<span
id=“NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}”
class=“badge badge–bottom-left color-{{ settings.sold_out_badge_color_scheme }}”
>
{{- ‘products.product.pre_order’ | t -}}
{%- endif -%}
{%- if card_product.available == false and product.tags != “preorder” -%}
<span
id=“NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}”
class=“badge badge–bottom-left color-{{ settings.sold_out_badge_color_scheme }}”
>
{{- ‘products.product.sold_out’ | t -}}
{%- elsif card_product.compare_at_price > card_product.price and card_product.available -%}
<span
id=“NoMediaStandardBadge-{{ section_id }}-{{ card_product.id }}”
class=“badge badge–bottom-left color-{{ settings.sale_badge_color_scheme }}”
>
{{- ‘products.product.on_sale’ | t -}}
{%- endif -%}
also added to the layouts - theme.liquid file:
preOrder: ‘{{ ‘products.product.pre_order’ | t }}’
also to Locales - en.default.json:
“pre_order”: “Pre Order”,
