How to fade out image on SOLD OUT items - Dawn

Solved

How to fade out image on SOLD OUT items - Dawn

JP1704
Explorer
63 0 17

Hi does anyone know the code so I can make SOLD OUT product images fade out on collection pages? Im using Dawn theme. TIA 🙂

Accepted Solutions (2)

Lucid_Polygon
Shopify Partner
349 63 96

This is an accepted solution.

@JP1704  YOu can achieve it with a little bit of coding.

  • Go to theme code Online Store > Themes > Actions > Edit Code 
  • Find Assets > base.css
  • At the bottom add the following three lines
.fade_img{
  opacity: 0.5;
}
  • Find Snippets > card-product.liquid 
  •  Find the line
<div class="card__media">
  • And replace it with
<div class="card__media {%- if card_product.selected_or_first_available_variant.available -%} {% else %} fade_img {%- endif -%} ">

 

Find attached screenshots for reference

 

Screen Shot 2022-10-04 at 2.57.11 PM.pngScreen Shot 2022-10-04 at 2.52.26 PM.pngScreen Shot 2022-10-04 at 2.51.18 PM.png

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

View solution in original post

Lucid_Polygon
Shopify Partner
349 63 96

This is an accepted solution.

@JP1704 Did the solution, I posted above work for you?

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution

View solution in original post

Replies 6 (6)

Lucid_Polygon
Shopify Partner
349 63 96

This is an accepted solution.

@JP1704  YOu can achieve it with a little bit of coding.

  • Go to theme code Online Store > Themes > Actions > Edit Code 
  • Find Assets > base.css
  • At the bottom add the following three lines
.fade_img{
  opacity: 0.5;
}
  • Find Snippets > card-product.liquid 
  •  Find the line
<div class="card__media">
  • And replace it with
<div class="card__media {%- if card_product.selected_or_first_available_variant.available -%} {% else %} fade_img {%- endif -%} ">

 

Find attached screenshots for reference

 

Screen Shot 2022-10-04 at 2.57.11 PM.pngScreen Shot 2022-10-04 at 2.52.26 PM.pngScreen Shot 2022-10-04 at 2.51.18 PM.png

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
bayouglassarts
Visitor
1 0 0

I love this! Could you modify it for the Story theme? We've been looking for a way to do this for awhile now. Thank you!

BGA

KetanKumar
Shopify Partner
37595 3668 12156

@JP1704 

can you please share store url so i will check and let you know 

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing
Lucid_Polygon
Shopify Partner
349 63 96

This is an accepted solution.

@JP1704 Did the solution, I posted above work for you?

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Click Accept as Solution
DippingMyToe
Tourist
4 0 2

hi mate, i tried just now and didn't work for Dawn12.0.

I'll keep looking. thank you though

KetanKumar
Shopify Partner
37595 3668 12156

@DippingMyToe 

oh sorry for that issue 

can you please share your store url and issue image

If helpful then please Like and Accept Solution. Partnership of your ️ Coffee Tips and my code can bring miracles.
Want to modify or custom changes on store Hire Me.
- Feel free to contact me on bamaniyaketan.sky@gmail.com regarding any help Shopify Partner | Skype : bamaniya.sky
PSD to Shopify | Shopify Design Changes | Shopify Custom Theme Development and Desing | Custom Modifications In to Shopify Theme | SEO & Digital Marketing