Forums / Bug Reports / Large image not correct shown when there is only a small and medium image

Large image not correct shown when there is only a small and medium image

Locked

Views: 3,171

Results 1 to 2 of 2
This thread is locked. New replies are disabled.
18 Oct 2007, 9:58 AM
#1
jwolters avatar

jwolters

New Zenner

Join Date:
Oct 2007
Posts:
1
Plugin Contributions:
0

Large image not correct shown when there is only a small and medium image

When there is not an image for a product in the 'large' folder, but there is an image in the 'medium' folder, the small image is shown in the popup instead of the 'medium' image.

In includes\modules\pages\popup_image\header_php.php (version 2984 2006-02-07 22:00:25Z drbyte) line 53 and 56 should use "$products_image_medium" and not "DIR_WS_IMAGES . 'medium/' . $products_image_medium".

  if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
    if (!file_exists(DIR_WS_IMAGES . 'medium/' . $products_image_medium)) {
      $products_image_large = DIR_WS_IMAGES . $products_image;
    } else {
      $products_image_large = DIR_WS_IMAGES . 'medium/' . $products_image_medium;
    }
  } else {
    $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large;
  }
 if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
    if (!file_exists($products_image_medium)) {
      $products_image_large = DIR_WS_IMAGES . $products_image;
    } else {
      $products_image_large = $products_image_medium;
    }
  } else {
    $products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large;
  }

time is my only fear
an enemy of sand

19 Oct 2007, 1:39 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Large image not correct shown when there is only a small and medium image

Or even better:```
// check for a large image else use medium else use small
if (!file_exists(DIR_WS_IMAGES . 'large/' . $products_image_large)) {
$products_image_large = $products_image_medium;
} else {
$products_image_large = DIR_WS_IMAGES . 'large/' . $products_image_large;
}

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.