Zen Cart Logo
Forums / General Questions / Image not found change

Image not found change

Locked

Views: 2,081

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
29 Jun 2010, 9:35 PM
#1
beau91324 avatar

beau91324

Zen Follower

Join Date:
Jul 2009
Posts:
149
Plugin Contributions:
0

Image not found change

I'd like to be able to use a generic image like "No Picture Available" instead of a text string when ZenCart can't load a image, like you see in the admin when you miss type the image name. Is there anyway to do this?

29 Jun 2010, 9:41 PM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,806
Plugin Contributions:
15

Re: Image not found change

In Admin >> Configuration >> Images, the Product Image - No Image Status should be 1 and the image set to no_picture.gif

You can, of course create your own gif.

29 Jun 2010, 10:07 PM
#3
beau91324 avatar

beau91324

Zen Follower

Join Date:
Jul 2009
Posts:
149
Plugin Contributions:
0

Re: Image not found change

That is what I have setup, but I still get the default Alt. text if the image is set in the product but is not found or loaded. What is in the Admin->Image seems to deal with having no image file defined when the product is first created. I need something if the file is incorrectly defined.

30 Jun 2010, 9:42 AM
#4
stevesh avatar

stevesh

Black Belt

Join Date:
Feb 2005
Location:
Lansing, Michigan USA
Posts:
19,793
Plugin Contributions:
2

Re: Image not found change

That function adds the no_image.gif only when you don't specify an image for a product. If the image is specified, but missing, you'll get the name and alt text in Firefox, and the dreaded red 'X' and alt text in IE.

There's no way I know to change that in admin, so I guess the best solution would be to make sure all your images that are associated with a product exist.

30 Jun 2010, 9:54 AM
#5
schoolboy avatar

schoolboy

Totally Zenned

Join Date:
Jun 2005
Location:
Cumbria, UK
Posts:
10,327
Plugin Contributions:
0

Re: Image not found change

The "No Image" gif will show, ONLY if there is no reference in the database to a pic.

So, lets say product ABC has an image abc.jpg ... but after adding the product and the image, you decide that abc.jpg is awful and you delete it from the server.

The reference to abc.jpg STILL EXISTS in the database, so the php will assemble the <img src> using that reference. as the image itself no longer exists on the server (in the images folder), it displays the alt text.

Either the database field MUST be empty (null), OR you should deliberately state that the image is no_image.gif by associating that image with the product data.

30 Jun 2010, 3:39 PM
#6
beau91324 avatar

beau91324

Zen Follower

Join Date:
Jul 2009
Posts:
149
Plugin Contributions:
0

Re: Image not found change

Sounds like I need to change the PHP code. Can anyone point me to the file(s) that need to be changed. Help with how to change the code will also be cheerfully accepted.

30 Jun 2010, 4:52 PM
#7
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,806
Plugin Contributions:
15

Re: Image not found change

Why mess with the php?:unsure:

IF you have deleted the pic as suggested by schoolboy and stevesh, why not just edit the particular product and put no-picture.gif in the Products Image slot?

You could use PhpMyAdmin to delete the images.

You could use a sql statement to remove several at once.

All sorts of answer that don't mess with code and create problems down the line.

30 Jun 2010, 5:30 PM
#8
beau91324 avatar

beau91324

Zen Follower

Join Date:
Jul 2009
Posts:
149
Plugin Contributions:
0

Re: Image not found change

I understand I can do that, the problem is I have over 20,000 items in the database and about 10% of the items don't have the correct image names and they are randomly scattered thru out. To do the change by hand would be much too time consuming. Also my client will most likely be adding more items with incorrect image names, it's just the way he works. So I'm trying to anticipate the problem.