Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Modifying the Popup window


acbatchelor

Recommended Posts

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

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

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

Archived

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

×
×
  • Create New...