acbatchelor Posted February 19, 2009 Share Posted February 19, 2009 on the product info page, can you modify the code on the popup window so that the window will be a specific size? Here's the default code <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> also, i have added another button at the bottom of my page between the Back and Add to Cart buttons. I would like to know the code to make this button a popup too. Here's the code for the row of buttons at the bottom of the page <td class="main"><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, tep_get_path($current_category_id = '')) . '">' . tep_image_button('button_back.gif', IMAGE_BUTTON_BACK) . '</a>'; ?></td> <td class="main" align="center"><?php echo '<a href="http://www.mywebsite.net/color_chart.htm">' . tep_image_button('color_chart.gif', Color_Chart) . '</a>'; ?></td> <td class="main" align="right"><?php echo tep_draw_hidden_field('products_id', $product_info['products_id']) . tep_image_submit('button_in_cart.gif', IMAGE_BUTTON_IN_CART); ?></td> Link to comment Share on other sites More sharing options...
germ Posted February 20, 2009 Share Posted February 20, 2009 To make the color chart open in a popup window: Add this code to the <head> section: <td class="main" align="center"><?php echo '<a href="java script: openwindow()">' . tep_image_button('color_chart.gif', 'Color_Chart') . '</a>'; ?></td> Now the forum is screwing up the code in two places and I can't stop it. All this code has to be on ONE LONG LINE or it won't work: window.open("http://www.mywebsite.net/color_chart.htm", "mywindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,re sizable=yes,copyhistory=no,width=100,height=100,screenX=150,screenY=150,top=150,l eft=150") Secondly it puts a space between java and script here that you must remove: java script: openwindow() If you do it right it will work. I've tested the code on my site. If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
acbatchelor Posted February 21, 2009 Author Share Posted February 21, 2009 thanks, it worked. but i'm still having problems with my product's image. almost everytime the popup window opens, it cuts a little bit of the bottom of the image off. Link to comment Share on other sites More sharing options...
germ Posted February 21, 2009 Share Posted February 21, 2009 In the <head> section of popup_image.php change this number to a larger value: function resize() { if (navigator.appName == 'Netscape') i=40; if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+[b][color="#FF0000"]60[/color][/b]-i); self.focus(); } If I suggest you edit any file(s) make a backup first - I'm not perfect and neither are you. "Given enough impetus a parallelogramatically shaped projectile can egress a circular orifice." - Me - "Headers already sent" - The definitive help "Cannot redeclare ..." - How to find/fix it SSL Implementation Help Like this post? "Like" it again over there > Link to comment Share on other sites More sharing options...
acbatchelor Posted February 21, 2009 Author Share Posted February 21, 2009 thanks again, i didn't even know there was a popup_image.php i should have known that. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.