Originally Posted by
joejoejoe
Thanks. What about for products that have an image file included but can't find the file? Such as file misnamed?
I just needed something simliar, just wanted cart to show the no_picture image if a mispelt image name occured, or image was deleted off server etc by accident, so made changes as follows:
copy across main_product_image.php from includes/modules/ to your includes/modules/YOUR_TEMPLATE_NAME
then find
Code:
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
and underneath put
Code:
if (!file_exists(DIR_WS_IMAGES . $products_image)) {
$products_image ="no_picture.gif";
}
then copy across product_listing.php from includes/modules/ to your includes/modules/YOUR_TEMPLATE_NAME
then find:
Code:
if ($listing->fields['products_image'] == '' and PRODUCTS_IMAGE_NO_IMAGE_STATUS == 0) {
$lc_text = '';
} else {
and underneath add
Code:
if (!file_exists(DIR_WS_IMAGES . $listing->fields['products_image'])) {
$products_listing_image = DIR_WS_IMAGES . "no_picture.gif";
}
else
{
$products_listing_image = DIR_WS_IMAGES . $listing->fields['products_image'];
}
then just below that you will find two occurances of code
Code:
'products_id=' . $listing->fields['products_id']) . '">' . zen_image(DIR_WS_IMAGES . $listing->fields['products_image'], $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH,
to change to
Code:
'products_id=' . $listing->fields['products_id']) . '">' . zen_image($products_listing_image, $listing->fields['products_name'], IMAGE_PRODUCT_LISTING_WIDTH,
thats it.
Bookmarks