martinstan Posted October 18, 2006 Posted October 18, 2006 Hi The 'visit products webpage' feature link is fine but can this link be moved so that this page opens when clicking on the product image, instead of the popup enlarged view? I'm not up on PHP at the minute but trying hard. Help would be really appreciated. Martin
martinstan Posted October 18, 2006 Author Posted October 18, 2006 I'm guessing a bit here but the two files involved seem to be catalog/popup_image.php and catalog/redirect.php. Does anyone know how I might modify the code in order to to make a new page popup instead of the enlarged image. Thanks Martin
desidil4ever Posted October 18, 2006 Posted October 18, 2006 I would recommend that u put ur question in a better way..its too vague..as to from where/which page u tryin to go to which page I'm guessing a bit here but the two files involved seem to be catalog/popup_image.php and catalog/redirect.php.Does anyone know how I might modify the code in order to to make a new page popup instead of the enlarged image. Thanks Martin Simple Add-ons Please add simple plain tips here for others.
martinstan Posted October 18, 2006 Author Posted October 18, 2006 I would recommend that u put ur question in a better way..its too vague..as to from where/which page u tryin to go to which page Thanks for your advice. I know what I'm after but yes I think you're probably right. Not explaining it well enough. Let me try and expand. I searched the contribs and there are a couple of things that sound almost there but are very complicated to install and I'm still not convinced they would work for what I'm after, so here goes. On the product_info.php there is an option to click on a link to visit the product's webpage which you can set in the admin area when adding a new product. This then allows you to give even more info about the particular product. There is also the option to click on the image thumbnail to enlarge the product in the javascript popup window. What I would like is to show more info about the product by clicking on the thumbnail so in effect replacing the javascript enlarged view. So it would achieve what the 'visit this products webpage' does. It wouldn't matter if this was just a plain html page. But I need to show certain characteristics about any particular product that isn't included anywhere else in the site. Here is an example of the info I need to show. http://www.melamin.com/www_site/en_melamin.htm I hope this is clearer but please let me know if I'm still not making sense. Thanks Martin
squeekit Posted October 18, 2006 Posted October 18, 2006 in product_info.php replace: <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script: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">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> with: <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <?php if (tep_not_null($product_info['products_url'])) { echo '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>Visit Website</a>'; } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="java script: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">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> <?php } ?> </td> </tr> </table> <?php } ?> notice: - such is within an IF statement so only if related website url is present will the main image be linked to it - else it displays as default ("Click to Enlarge") - i hardcoded english (not "proper" osc method to hardcode such) text under the image that reads "Visit Website" - i included target="_blank" so website opens in new browser window
squeekit Posted October 18, 2006 Posted October 18, 2006 sheesh - you know i might have still missunderstood you... i thought you wanted the thumb to open pages from other (the product's) website ---- are you saying you want the thumb link to stay in your shop's website???!!!! if so - well, that's much easier - and you should figure out how to modify the above code sample to do so - hint > merely look at other in-site links within your shop's php... sheesh :D
martinstan Posted October 18, 2006 Author Posted October 18, 2006 Guys thanks for your help. Will try in the morning and let you know Cheers Martin
martinstan Posted October 19, 2006 Author Posted October 19, 2006 in product_info.php replace:<?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <script language="javascript"><!-- document.write('<?php echo '<a href="java script: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">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> </td> </tr> </table> <?php } ?> with: <?php if (tep_not_null($product_info['products_image'])) { ?> <table border="0" cellspacing="0" cellpadding="2" align="right"> <tr> <td align="center" class="smallText"> <?php if (tep_not_null($product_info['products_url'])) { echo '<a href="' . tep_href_link(FILENAME_REDIRECT, 'action=url&goto=' . urlencode($product_info['products_url']), 'NONSSL', true, false) . '" target="_blank">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>Visit Website</a>'; } else { ?> <script language="javascript"><!-- document.write('<?php echo '<a href="java script: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">' . tep_image(DIR_WS_IMAGES . $product_info['products_image'], $product_info['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT, 'hspace="5" vspace="5"') . '<br>' . TEXT_CLICK_TO_ENLARGE . '</a>'; ?> </noscript> <?php } ?> </td> </tr> </table> <?php } ?> notice: - such is within an IF statement so only if related website url is present will the main image be linked to it - else it displays as default ("Click to Enlarge") - i hardcoded english (not "proper" osc method to hardcode such) text under the image that reads "Visit Website" - i included target="_blank" so website opens in new browser window Truely awesome. Works like a dream.There are some pretty bight people kicking around this forum. Thank you very much. :D
Recommended Posts
Archived
This topic is now archived and is closed to further replies.