tec Posted September 15, 2006 Share Posted September 15, 2006 Good day, I was looking through the contributions to find one that will put a default image in place if there is no product image,i had found one, it had a file called Array in it, but the code was all jumbled. Does anyone know where i can find a contribution that will put a default prod image in if there isnt one assigned? Link to comment Share on other sites More sharing options...
rayge Posted September 21, 2006 Share Posted September 21, 2006 I was looking for the same thing. ALl im gonna do here is replace some code in includes/modules/product_listin.php replace lines 125 - 132 case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>?'; } break; with case 'PRODUCT_LIST_IMAGE': $lc_align = 'center'; if( $listing['products_image'] != "" && file_exists(DIR_WS_IMAGES . $listing['products_image'])) { if (isset($HTTP_GET_VARS['manufacturers_id'])) { $lc_text = '<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'manufacturers_id=' . $HTTP_GET_VARS['manufacturers_id'] . '&products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>'; } else { $lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>?'; } } else { $lc_text = '?<a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . tep_image(DIR_WS_IMAGES . "notavail.gif", $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a>?'; } break; where notavail.gif can be any image you placed in the images directory. THis will fix images within the product listing pages Link to comment Share on other sites More sharing options...
jayderose Posted October 29, 2006 Share Posted October 29, 2006 Thank you Ray, I just installed this and it seems to work great giving a stock no picture available on the results page. A quick and easy fix. :thumbsup: Janet Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.