Couldn't find anything in the forums here online, but thought others may find this situation too.... so I thought I'd add this as a handy reference.
The problem:
Converting client into AbleCommerce AC GOLD 12 SR1. They have approx. 25,000 skus. Images in the old system were brought over, but we have a LOT of issues where database field contains incorrect image file names.
a.) The database image field on many items is not null.
b.) The default image will not appear (because the field is not null).
c.) There are hundreds or thousands of potential errors to "find" the images.
Because the image file names are in the database, the cart "thinks" that the image should be displayed. However, since the image file name is wrong, we get a "broken image" display in the browser.
The Solution:
In the ProductImage.ascx page, I added an "OnError" javascript to the page.
Code: Select all
function imgError(image) {
image.onerror = "";
image.src = "/assets/_no_image.jpg";
return true;
}
Code: Select all
<a id="ProductImageUrl" runat="server" class="fancybox-thumbs" data-fancybox-group="thumb" ClientIDMode="Static">
<asp:Image ID="ProductImage" runat="server" BorderWidth="0" CssClass="productImage" ClientIDMode="Static" itemprop="image"
onerror="imgError(this);" />
</a>
Bottom line -- now the right " default" image will appear if the browser gets a 404 or 500 error and we can avoid the "broken image' mess....
Hope this helps someone else!