Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Popup Image in product_listing


paolo

Recommended Posts

Posted

My first post, apologies if in the wrong place.

 

Instead of (or as well as) having the image pop-up to be larger when clicked in the product info page, is it possible to have the image that displays on the product listing behave the same?

 

I've looked and not found any contributions suggesting this. Can anyone point me in the right direction to code this in to my existing install? I'm willing to have a go at doing it with a little help from the community. :thumbsup:

 

www.astra247.com is our new oscommerce site, but I feel there are too many clicks to get to a larger image and then back to the product listing, unlike our existing site www.ceilingfan.co.uk

 

Thanks,

 

 

Paolo.

Posted

I've now discovered how to do this after a morning and lunchtime of playing around....

 

Added to the top of my product_listing.php code the following;

 

/* added for popping up image on product listing instead of linking to product info */

$javascript = 'popup_window.js';

require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PRODUCT_INFO);

/* the 2nd bit is for TEXT_CLICK_TO_ENLARGE reference */

 

Then changed...

 

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> ';

}

 

to....

 

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="java script:popupWindow(\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $listing['products_id']) . '\')">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], addslashes($listing['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>';

}

 

I'm using BTS (templates) if that makes any difference. Hope someone else may get use from this experiment which for now seems to be working just great for me.

 

Cheers,

 

Paolo.

 

p.s. See www.astra247.com for working example

 

 

My first post, apologies if in the wrong place.

 

Instead of  (or as well as) having the image pop-up to be larger when clicked in the product info page, is it possible to have the image that displays on the product listing behave the same?

 

I've looked and not found any contributions suggesting this. Can anyone point me in the right direction to code this in to my existing install? I'm willing to have a go at doing it with a little help from the community.  :thumbsup:

 

www.astra247.com is our new oscommerce site, but I feel there are too many clicks to get to a larger image and then back to the product listing, unlike our existing site www.ceilingfan.co.uk

 

Thanks,

Paolo.

  • 1 month later...
Posted

hallo, i visited your site and didn't notice what are you talking about.

 

what i understand from your post is that you want to enlarge images from product list page when you click on image, and not arrive to product info page?

Archived

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

×
×
  • Create New...