Powerstore All Versions - Products Image placeholder
Does PS have to ability to check for missing product images in the imagesupload folder and provide a default placeholder image?
Does PS have to ability to check for missing product images in the imagesupload folder and provide a default placeholder image?
No, but that is something that could be added. However with Powerstore v4, you don't have to add an image when you insert a product, because we default to a default image if no image was specified.
Sounds like this could be added in the next update to PS 3.0.1 right?
I'm not sure that is something that could be added to PS 3, because that is not how it is designed. But i can provide with a work around on how to go about showing a default image if the image does not exists. Although that seems like it is not really possible because PS 3 requires an image before creating a new product.
If can provide this work around it would be helpful for those who have 7000+ products with images and will import via a database backend.
I just added this code to the Product_Results.php page and it works.
onerror="this.src = 'noimage.jpg'"
<div class="imageWrapper"> <a href="Products_Detail.php?ProductID=<?php echo(rawurlencode($ProductID)); ?>" title="<?php echo $row_WADAProducts["ProductName"]; ?>"> <img class="WADAResultThumb" border="0" src="imagesupload/<?php echo $row_WADAProducts['ProductThumb']; ?>" onerror="this.src = 'noimage.jpg'" /></a> </div>
But whatever you provide I will use.
Thanks Dani.
You can add these lines of code before the image tag:
<?php
$file = "imagesupload/" . $row_WADAProducts['ProductThumb'];
if(!file_exists($file)) $file = "imagesupload/default-product.png";
?>
and update the image tag to:
<img class="WADAResultThumb" border="0" src="<?php echo $file; ?>" />
Thank you Dani.
That works very well.
Your awesome.
I'm glad i was able to help.
you can use that concept any where where images are displayed (detail page, cart, etc...).
Now that I have purcahsed PS4 after importing products the placeholder image is missing for all products. How can this be rectified?
Seems like the placeholder image only come when you add a product from with the store manager. But I don't think one would expect that we would sit and enter couple thousand products manually right?
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.