Collection placeholder images - Spotlight theme

Collection placeholder images - Spotlight theme

Shopify Partner
9 0 1

If anyone can help, that would be very appreciated.
I am building a store on the Spotlight theme and have the challenge that not all products having images.
So on collections, I want to make it so that if a product has no image there is a placeholder image that gets displayed instead.
In the product-card.liquid file the section that generates the product card, there's a check for the product's featured image



{%- if card_product.featured_media -%}


.... Display featured image....


{% endif %}​


So I wedged a {% else %} in and copied all the code from the first if into the else statement.
under the else I used 


{% assign placeholder = "product_placeholder.png" %}​


and then replaced all the 'featured_image' references with {{ placeholder | asset_img_url: width: x }} 
when inspecting, the image seems to pull through to the code correctly, but it still does not display?

Not sure how to check why the image is not showing, but would love some input that may help me resolve this


Replies 4 (4)

Shopify Partner
536 107 108

Hello @Nardu_M 

Its Artzen Technologies! We will be happy to help you today.

PLease send me your store url, if applicable, the Password too.

If helpful, please Like and Accept this Solution to help others
Artzen Technologies | A Shopify Development Agency
WhatsApp - 9877983930

Book FREE CONSULTATION who want to migrate to Shopify or want to start an eCommerce business with Shopify
Shopify Partner
9 0 1

Hi Artzen, here are the details for the store.
Store url:
password: rolexes

The file I've been editing is ../snippets/card_product.liquid

Shopify Partner
6447 587 1368

Generally there may be other logic that ends up controlling display in tandem with what you've edited.

Either externally or within the initial {% if %} condition.


Glancing over the url's code for /collections/all-products , NO media is loaded at all.


Double check the syntax of your image logic by validating it's parts in a custom-liquid block every step of the way, {{  placeholder}}etc etc.


If you need this debugged then contact me by mail for services, contact Info in signature.
Please always provide context, examples: store url, theme name, post url(s) , or any further detail.
Contact Info in signature.

Save time & money ,Ask Questions The Smart Way

Confused? Busy? Get the solution you need

Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to

Shopify Partner
9 0 1

Thank you Paul.
There was a conditional statement in one of the parent elements in the liquid code which prevented the images' display.
*The solution is not suitable to post on this forum