PupStar Posted January 16, 2013 Posted January 16, 2013 Hi Guys, I am having a blonde moment again. I need to add an icon of a camera to the product_listing module that when clicked shows the product image. Just like when you click to enlarge product_info image but not with a thumbnail but an icon. Can anyone shed some light on such a simple thing that I just can not seem to get my head around urgh So far I have <div id="piGal">' . '<a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'camera_icon.png') . '</a>' . '</div> Now as this link works and displays the icon it does not however find the image. Maybe I have been thinking about this to long and the answer is easier than what I am thinking. Thanks Mark
PupStar Posted January 17, 2013 Author Posted January 17, 2013 ok sorted I used the code from product_info. I must have been tired lol
PupStar Posted January 17, 2013 Author Posted January 17, 2013 ok so now the popup works now the issue I have is nesting if statements urgh I only want the icon to appear if the product has an image assigned to it. The code I am using is: case 'PRODUCT_LIST_NAME': if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { $prod_list_contents .= ' <td width="40%">' . $listing['products_name'] . '</td><td width="5%">' . '<div id="piGal"><a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'camera_icon.png') . '</div></a>' . '</td>'; } else { $prod_list_contents .= ' <td width="40%">' . $listing['products_name'] . '</td><td width="5%">' . '<div id="piGal"><a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'camera_icon.png') . '</div></a>' . '</td>'; } break; Any takers please
PupStar Posted January 19, 2013 Author Posted January 19, 2013 not sure if I am barking up the wrong tree with my logic here but I tried adding && tep_not_null($HTTP_GET_VARS['products_image']) to: if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) { with no success :( All I want to happen is the the 'camera_icon.png' to not show if there is no products_image <div id="piGal"><a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'camera_icon.png') . '</div></a> Thanks Mark
PupStar Posted January 20, 2013 Author Posted January 20, 2013 ok I managed to sort it out by adding a new 'case' to the listing case 'PRODUCT_LIST_IMAGE_ICON': if (tep_not_null($listing['products_image'])) { $prod_list_contents .= ' <td width="2%">' . '<div id="piGal" class="ui-widget-content ui-corner-qll infoBoxContents"><a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image'], '', 'NONSSL', false) . '" target="_blank" rel="fancybox">' . tep_image(DIR_WS_IMAGES . 'camera_icon.png') . '</div></a>' . '</td><td width="2%"> </td>'; } else { $prod_list_contents .= ' <td width="2%">' . '<div>' . tep_image(DIR_WS_IMAGES . 'camera_icon_blank.png') . '</div>' . '</td><td width="2%"> </td>'; } break;
Recommended Posts
Archived
This topic is now archived and is closed to further replies.