How to hide image placeholder if no image is uploaded on debut

tesstesting
Explorer
97 0 7

Hi,

 

Short: I have some products that do not have images. I need to find a way to hide the image placeholder "no image" if no image is uploaded to the product. Using debut - thanks.

 

Long: I'm currently uploading a .png of my background color to products I don't want to have images. Problem is that even though the image appears "empty", my whole product is moved down really far from other products with images because there is technically still an image there. I need a way to remove the container all together if the product doesn't have an associated image.

Replies 7 (7)

KetanKumar
Shopify Partner
36843 3636 11978

Hello, @tesstesting 

Please share your site URL,
So I will check and provide a solution here.

If helpful then please Like and Accept Solution.
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
tesstesting
Explorer
97 0 7

@KetanKumar 

 

Hi thanks for helping. My site isn't live yet and its disorganized at the moment, could you help me without me providing my shop URL? I'm looking for a general solution to this problem.

tesstesting
Explorer
97 0 7

For anyone wondering, I solved this by using the following code on the product card list:

 

{% if product.images.size > 0 %}
<img class="list-view-item__image" src="ur text" alt="ur text">			
  <br>
  {% endif %}

So I'm saying, "If product images are greater than 0, show this image"...it is implied that if product images are not greater than 0, the image does not show.

WLee99
Visitor
2 0 1

Thank you. I have been looking for a solution and I'm an novice...

 

Can you provide more specific instructions as to where exactly the code should be added? Will this be impacted by future shopify updates? What needs to be done from a maintenance perspective?

KetanKumar
Shopify Partner
36843 3636 11978

@WLee99 

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.

If helpful then please Like and Accept Solution.
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
WLee99
Visitor
2 0 1

I'm setting it up now. It's not active.

omniTech
Visitor
1 0 0

Where did you add this code to? The config files? @tesstesting