trying to get an opaque overlay on my products that are sold out with and without variants in the Narrative theme. Any ideas? I’ve tried the few things that seem to be posted on here regarding the code:
but it doesn’t seem to be working.
trying to get an opaque overlay on my products that are sold out with and without variants in the Narrative theme. Any ideas? I’ve tried the few things that seem to be posted on here regarding the code:
but it doesn’t seem to be working.
Hi @jennamiotke ,
Please share your store URL and if your store is password protected then please provide password too.
You can take a picture of the place you want to edit.
So that we can help you.
Sorry you are facing this issue, it would be my pleasure to help you.
Welcome to the Shopify community! ![]()
Thanks for your good question.
Please share your site URL,
I will check out the issue and provide you a solution here.
Hi, thank you! My site is www.crystallovetreasures.com
Hi, thank you! My site is www.crystallovetreasures.com
Photos would be many of every page as I want it to happen automatically for anything that is sold out including variants.
Hi, thank you! My site is www.crystallovetreasures.com is there any way to get some help regarding this?
Hi, thank you! My site is www.crystallovetreasures.com there is no password. I need an overlay to be able to be placed on top of any item that is sold out.
pleas share example
For example the one on the left is sold out and has an opaque overlay over the photo compared to the one beside it.
thanks i have just confirm if sold out item overlay compare store item do you need its can be done some customization code
Yes please if you have some custom code I can put it that would be great! Thank you..
yes, please send product cart or product item or card item snippets file so i will check and update
yes, please add this code and let me know after i will give you one more code
{% if product.featured_media %}
{% include 'card-image', type: product.featured_media.preview_image, grid_style: grid_style %}
{% endif %}
{% if section.settings.show_vendor %}
{{ product.vendor }}
{% endif %}
### {{ product.title }}
{% if product.available %}
{%- assign variant = product.selected_or_first_available_variant %}
{% if product.compare_at_price > product.price %}
{% comment %}
Product is on sale
{% endcomment %}
{% if product.price_varies %}
{% assign sale_price = product.price | money_without_trailing_zeros %}
{{ 'products.product.price' | t }}
{{ 'products.product.on_sale_from_html' | t: price: sale_price }}
{% else %}
{{ 'products.product.sale_price' | t }}
{{ product.price | money_without_trailing_zeros }}
{{ 'products.product.regular_price' | t }}
{{ product.compare_at_price | money_without_trailing_zeros }}
{%- if variant.available and variant.unit_price_measurement -%}
{% include 'product-unit-price', variant: variant %}
{% endif %}
{% endif %}
{% else %}
{% comment %}
Not on sale, but could still have varying prices
{% endcomment %}
{% if product.price_varies %}
{% assign price = product.price | money_without_trailing_zeros %}
{{ 'products.product.from_text_html' | t: price: price }}
{% else %}
{{ product.price | money_without_trailing_zeros }}
{%- if variant.available and variant.unit_price_measurement -%}
{% include 'product-unit-price', variant: variant %}
{% endif %}
{% endif %}
{% endif %}
{% else %}
{{ 'products.product.sold_out' | t }}
{% endif %}
{% if product.compare_at_price > product.price %}
{% assign sale_text_length = 'products.product.on_sale' | t | size %}
{{ 'products.product.on_sale' | t }}
{% endif %}
I added that code to the product-card.liquid file in Snippets but it then duplicated all the products that had variants.