Roadking Posted April 22, 2005 Share Posted April 22, 2005 Hello, I am interested in some assistance altering a php file but not sure how. I have a site the sells photographs. Each visitor who visits and navigates into a sub-category gets a paged list of pictures (currently set to 20 products per page). In order to see the enlarged picture they must first click on the small image in the list, (while this list is up it shows the index.php file in the browser address bar). This takes them to the individual ordering page for that picture/product, which allows them to click on the small image and see an enlarged one. I would like to have the capability to enlarge the image from the 20 products listing page without having them go to the individual page to blow up the image. For example I would like the category page to look as follows (Small image of product) (Hot link to Click to enlarge) (Quantity) (Product Name) --- etc. It is the (Click to enlarge) that I wish added, but cannot figure out how. To see what I want visit http://www.fasbinder.com Click the Baseball category Click the Varsity sub-category Click the vs. ADAMS sub-category This is the screen I wish to show enlarge links next to each picture Your expertise would be appreciated. Roadking Link to comment Share on other sites More sharing options...
niknakgroup Posted April 22, 2005 Share Posted April 22, 2005 in catalog/includes/modules/product_listing.php find: 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; Change 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="' . 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> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript>'; ? ? ? ? ? ?} ? ? ? ? ? ?break; Then insert the following into index.php just before the </head> tag <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> Bingo! P.S. - you may want to look at a thumbnailer contribution - your thumbnails are actually small images showing the full jpeg and take AGES to load. This gobbles up your bandwidth and makes browsing really slow for dial up connections - try thumbnailer contribution - hope that helps! Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem.... Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums..... if (stumped == true) { return(square_one($start_over) } else { $random_query = tep_fetch_answer($forum_query) } Link to comment Share on other sites More sharing options...
Roadking Posted April 22, 2005 Author Share Posted April 22, 2005 Thank you for the code. I inserted the index.php code without a problem. But when I insterted the product_listing.php code it formated up to the following code at which I get an error. Does the copy paste from the forum do anything to the code you posted, that would prevent me from just pasting it? '</a> <script language="javascript"><!-- document.write('<?php echo '<a href="javascript:popupWindow(\\\'' . tep_href_link(FILENAME_POPUP_IMAGE, 'pID=' . $product_info['products_id']) . '\\\')">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], addslashes($product_info['products_name']), SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?>'); //--></script> <noscript> <?php echo '<a href="' . tep_href_link(DIR_WS_IMAGES . $product_info['products_image']) . '" target="_blank">' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript>'; ? ? ? ? ? ?} ? ? ? ? ? ?break; I will check out the thumbnailer. My code in Photoshop that creates the copyright image creates a thumbnail just didn't know it could be used with oscommerce. Roadking Link to comment Share on other sites More sharing options...
Roadking Posted April 22, 2005 Author Share Posted April 22, 2005 Afer spending time looking and the code you supplied I believe I was able to determine that the problem is in the <?php ?> The entire file of product_listing.php is enclosed in <?php ?> already (open at the start and close at the end) and the code you sent includes them as well. Can you nest these calls? Please advise. Roadking Link to comment Share on other sites More sharing options...
niknakgroup Posted April 22, 2005 Share Posted April 22, 2005 Simplest way of doing this is to put ?> before the bit I posted, and <? php at the end of it to re-open the php tag. Should work....let me know. Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem.... Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums..... if (stumped == true) { return(square_one($start_over) } else { $random_query = tep_fetch_answer($forum_query) } Link to comment Share on other sites More sharing options...
Roadking Posted April 22, 2005 Author Share Posted April 22, 2005 I have tried that and I have also tried to modify your code without any luck. Link to comment Share on other sites More sharing options...
niknakgroup Posted April 22, 2005 Share Posted April 22, 2005 :blush: OK, just approached and went way past my knowledge level - im certain the extra bit is correct, just not entirely sure about how to go about adding it in.....any coders out there finish my bodge job for me???? Please...? :blush: Please note - if I have suggested a contrib above, it doesnt mean it will work! Most of the contribs are not ones I've used, but may be useful for your particular problem.... Have you tried a refined search? Chances are your problem has already been dealt with elsewhere on the forums..... if (stumped == true) { return(square_one($start_over) } else { $random_query = tep_fetch_answer($forum_query) } Link to comment Share on other sites More sharing options...
Roadking Posted April 24, 2005 Author Share Posted April 24, 2005 I appreciate all your time. I am at least further along than I was before. I will continue working wth it as I need a solution. I have also come up with an alternative but will need to explore it a bit more. Thanks Again Roadking Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.