I have a feed because not all image links work. Is it possible if the image link does not work then an alternative is displayed. (no picture)?
Sure - you can use the onerror attribute of an img tag to set a local image URL if the image fails to load.
To do this, first upload a suitable "no image" image as images/noimage.jpg and then for the main product image, edit html/product.php, search for the "img" tag:
...and add the onerror attribute like this:
You can add exactly the same to the img in html/featured.php for Featured Products and html/searchresuts.php for search results as required...
Hope this helps!
Great, it worked.
This happens to me in the following two occasions:
1) the URL of the image is exceeding the max length as defined on the fields in the MysQL database. Extending the length in the database solves that issue.
2) more and more sites started implementing Cloudflare recently where trying to pull the image from the website is considered a DDOS attach by Cloudflare. Not sure how to fix that one. Any suggestions?
Some networks (e.g. Affiliate Window in the UK) have both merchant and network hosted images so might be worth checking if your feeds support this or similar and always go with the network option.
Otherwise it might be worth contacting the network or merchant where this happens to make sure they are aware of the issue as an image URL contained in a datafeed is
specifically intended to be requested from 3rd party sites...