Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

"Images Required" False: removes valid images.


zoln

Recommended Posts

I have several products for which I don't want to provide images, but broken images are worse.

 

Setting "Image Required" to false does what I want in product listings, but removes a lot of valid images as well.

 

That is, it removes the site logo, header icons, infoBox arrows and corner decorations.

 

Examining the code hasn't solved the mystery.

  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

 

I've tested that ( (empty($src) || ($src == DIR_WS_IMAGES)) is false for the desired images.

The <img> tag (only) is completely absent in the output, so I don't see where else the decision could occur.

 

So, what's going on?

I would rather not require images in general, but still show them when they do exist.

 

[osCommerce version: I - don't - know. Apparently it's not important enough to put in plain view.]

Link to comment
Share on other sites

I have several products for which I don't want to provide images, but broken images are worse.

 

Setting "Image Required" to false does what I want in product listings, but removes a lot of valid images as well.

 

That is, it removes the site logo, header icons, infoBox arrows and corner decorations.

 

Examining the code hasn't solved the mystery.

  function tep_image($src, $alt = '', $width = '', $height = '', $parameters = '') {
if ( (empty($src) || ($src == DIR_WS_IMAGES)) && (IMAGE_REQUIRED == 'false') ) {
  return false;
}

 

I've tested that ( (empty($src) || ($src == DIR_WS_IMAGES)) is false for the desired images.

The <img> tag (only) is completely absent in the output, so I don't see where else the decision could occur.

 

So, what's going on?

I would rather not require images in general, but still show them when they do exist.

 

[osCommerce version: I - don't - know. Apparently it's not important enough to put in plain view.]

 

 

Do you not want to show product images??

Link to comment
Share on other sites

Do you not want to show product images??

Si. I do wish to show product images.

 

Specifically, those for which images are defined.

 

I do not want to show image placeholders for images that are not defined.

 

There exist products with images and products without images.

 

Setting "Images Required" to "false" handles product (and category) images as desired.

 

Unfortunately, it also removes defined non-product images from the page.

Link to comment
Share on other sites

SOLVED

 

(pretend that I added that to the thread subject, and that the post icon is a tick or something)

 

I hadn't noticed that the images were being rejected later when it came to calculating their size.

I don't know why they failed - possibly they have to be in the database to be calculated - but for my purposes it was enough to set "Calculate Image Size" to false, for now.

 

Eventually I'll want sizes to improve page loads, but there are other priorities unless someone happens to drop the answers in my lap.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...