Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Default Image if none available


updmike

Recommended Posts

You know when you look and look through the contribution page knowing you have seen this contribution over and over but when you actually need it you cant find it worth beans?

 

I cant seem to find the contribution that will add a default "no image available" image to the listings and product info pages if no image was uploaded to the server for that item..

 

Please proove that i did not dream up this contribution and point me to where it is.. LOL...

 

Mikey :huh:

Link to comment
Share on other sites

  • 3 years later...

 

Thats the one that worked for me, nothing else suggested by anyone else on any other thread worked.

 

I just added

$img=true;
if ($src == "images/"){
     $img = false;
     $src = "images/noimg.jpg";
}

 

after

 

function tep_image($src, $alt = '', $width = '', $height = '', $params = '') {

 

and it worked instantly, thank you Tim Wilson!

 

I actually added to this, from another post which i forgot where it is... here's what mine looks like currently and i believe it is more versatile as a result.

if (file_exists($src) == 0) $src = DIR_WS_IMAGES . 'noimg.jpg';
$img=true;
if ($src == "images/"){
     $img = false;
     $src = "images/noimg.jpg";
}

Edited by Robert972
Link to comment
Share on other sites

  • 4 weeks later...

Nice contribution,but I have some problems with it :blink:

 

As you can see in the first image the contribution is working fine for the product with no picture (green color), but at the top (red color) I don't need them (these are the subcategories displayed when I enter a categorie), how do I remove them ? in these case I used Image Required=True

 

In the second (Image Required=False) there are no pictures at all :'(

 

So how to make so the subcategories don't show the noimg.jpg and the products with no picture do ?

 

 

 

1

baddf8.th.jpg

 

2

bad1zw6.th.jpg

Cumparaturi4all

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...