Ylja Posted January 23, 2005 Posted January 23, 2005 How can this be done? I would like the image to popup like in product_info.php when I click the image in the product listing. Thanks!
Guest Posted January 23, 2005 Posted January 23, 2005 In index.php copy this code to your head: <script language="javascript"><!-- function popupWindow(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res izable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,le ft=150') } //--></script> In includes/modules/product_listing.php find this code: 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; and replace it with this: 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 = ' <script language="javascript"><!-- document.write(\'<a href="javascript: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>Click to enlarge</a>\'); //--></script> <noscript> <a href="' . tep_href_link(DIR_WS_IMAGES . $listing['products_image']) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $listing['products_image'], $listing['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a> </noscript>'; } break; Enjoy! Bobby
demogoria Posted May 15, 2005 Posted May 15, 2005 This works great, but I have a problem. WHen I am listing products by using the Manufacturer infobox, the script does not work, ie, it acts as if I didnt even use the code. (No javascript) When I navigate to the product list via Categories box, all is well. Do you have any ideas for a workaround on this? Thanks a bunch!
100asa Posted May 25, 2005 Posted May 25, 2005 I've the same problem (www.100asa.it) and the text 'click to enlarge' don't change with languages. Skype: centoasa Skype: remigioruberto
100asa Posted May 25, 2005 Posted May 25, 2005 and popup image don't work on advance search result page! Skype: centoasa Skype: remigioruberto
Wendy James Posted May 25, 2005 Posted May 25, 2005 Probably because he only gave the code to change the index.php and the product_info.php not the whole site. Wendy James Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
demogoria Posted May 28, 2005 Posted May 28, 2005 Do you happen to know which file displays the results by the manufacturer so that I can add that code change to it? I was under the impression it was product_listing.php but I guess I was wrong. :)
demogoria Posted May 30, 2005 Posted May 30, 2005 Oh nevermind, I figured it out. Simply take out the if statement in products_listing.php and make it just the javascript. Since Im not a PHP guru, this could cause problems in the long run, but it works! lol
yatahaze Posted October 6, 2005 Posted October 6, 2005 Does anyone have a better solution, or can explain how to make this work on the advanced search result file? Thanks.
yatahaze Posted October 6, 2005 Posted October 6, 2005 Nevermind, I just had to add that first bit of code but fix one little problem with it. It shows & #39; where a ' is supposed to be. That code has to go on advanced_search_result.php then it works.
spottedhaggis Posted November 23, 2005 Posted November 23, 2005 hi Just installed this, and I am having a problem with adding items to the cart from the popup. Could it be because I have replaced manufacturer with product description as I have no manufacturers in my system Born - Scotland Location - Kent, England Job - hunting for one
spottedhaggis Posted November 23, 2005 Posted November 23, 2005 I followed the instruction to the letter, the only part I changed was, where you had manufacturer information to be displayed in the popup, I ut in the code to display the description instead. The error I get when I click add to cart is as follows. Line: 16 Char: 3 Error: 'opener.document.forms.cart_quantity' is null or not an object Code: 0 URL: http://spottedhaggis.com/go4beads/popup_image.php?pID=4 Any ideas?.... Born - Scotland Location - Kent, England Job - hunting for one
vondada Posted January 3, 2006 Posted January 3, 2006 Are there any known conflicts between using this and the Products Listing in Columns? Does anyone know? I can't get this to work on my cart: http://www.hollywoodhistoricphotos.com/shop/catalog Then click any of the categories. The popup looks like it's going to work but doesn't. Any suggestions would be greatly appreciated.
Guest Posted June 16, 2006 Posted June 16, 2006 I followed the instruction to the letter, the only part I changed was, where you had manufacturer information to be displayed in the popup, I ut in the code to display the description instead. The error I get when I click add to cart is as follows. Line: 16 Char: 3 Error: 'opener.document.forms.cart_quantity' is null or not an object Code: 0 URL: http://spottedhaggis.com/go4beads/popup_image.php?pID=4 Any ideas?.... Nice Site!! I am having the same problem making this work with columns. It looks like you never resolved it. :(
shelby72 Posted April 4, 2008 Posted April 4, 2008 How did you get this to work on the advanced search result page? Exactly what code do I need to add in?
RTFMUser Posted June 12, 2008 Posted June 12, 2008 Update Fix. "Index.php " and "advanced_search_result.php" <head> <script language="javascript"><!-- function aleatorio(inferior,superior){ numPosibilidades = superior - inferior aleat = Math.random() * numPosibilidades aleat = Math.round(aleat) return parseInt(inferior) + aleat } function popupWindow(url) { window.open(url,'popupWindow_'+aleatorio(1,200),'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re sizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l eft=150') } //--></script> It(He,She) allows to open more than one window, or the same one several times. Sometimes the user does not give himself(herself) cuenda of that the this opened window, and it(he,she) does click and click. He(She) corrects the failure(judgement) that on having looked for a product, with the seeker. --- Permite abrir más de una ventana, o la misma varias veces. a veces el usuario no se da cuenda de que la ventana esta abierta, y hace clic y clic. Corrige el fallo que al buscar un producto, con el buscador. More Info in OsCommerse Spanish - http://oscommerce.qadram.com
Recommended Posts
Archived
This topic is now archived and is closed to further replies.