Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

My popup windows aren't working anymore


tsherer

Recommended Posts

I've obviously done something kaka. Suddenly none of my popup windows showing the enlarged product images are working. The store is at www.healthequityproject.org/catalog

 

I am getting this error when I check the javascript console:

Error: popupWindow is not defined

Source File: java script:popupWindow('popup_image.php?pID=62')

Line: 1

 

Line 1 is just a comment so it can't be line 1 and my code on the popup_image.php page looks like this:

 

<?php

/*

$Id: popup_image.php,v 1.7 2003/06/20 00:40:23 hpdl Exp $

 

osCommerce, Open Source E-Commerce Solutions

http://www.oscommerce.com

 

Copyright © 2003 osCommerce

 

Released under the GNU General Public License

*/

 

require('includes/application_top.php');

 

reset($HTTP_GET_VARS);

while (list($key, ) = each($HTTP_GET_VARS)) {

switch ($key) {

case 'banner':

$banners_id = tep_db_prepare_input($HTTP_GET_VARS['banner']);

 

$banner_query = tep_db_query("select banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");

$banner = tep_db_fetch_array($banner_query);

 

$page_title = $banner['banners_title'];

 

if ($banner['banners_html_text']) {

$image_source = $banner['banners_html_text'];

} elseif ($banner['banners_image']) {

$image_source = tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $banner['banners_image'], $page_title);

}

break;

}

}

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<title><?php echo $page_title; ?></title>

<script language="javascript"><!--

var i=0;

 

function resize() {

if (navigator.appName == 'Netscape') i = 40;

window.resizeTo(document.images[0].width + 30, document.images[0].height + 100 - i);

}

//--></script>

</head>

 

<body onload="resize();">

 

<?php echo $image_source; ?>

 

</body>

 

</html>

 

Can anyone help? thank you!!!

 

travis

Link to comment
Share on other sites

I've obviously done something kaka.  Suddenly none of my popup windows showing the enlarged product images are working. The store is at www.healthequityproject.org/catalog

 

I am getting this error when I check the javascript console:

Error: popupWindow is not defined

Source File: java script:popupWindow('popup_image.php?pID=62')

Line: 1

 

Line 1 is just a comment so it can't be line 1 and my code on the popup_image.php page looks like this:

 

<?php

/*

  $Id: popup_image.php,v 1.7 2003/06/20 00:40:23 hpdl Exp $

 

  osCommerce, Open Source E-Commerce Solutions

  http://www.oscommerce.com

 

  Copyright ? 2003 osCommerce

 

  Released under the GNU General Public License

*/

 

  require('includes/application_top.php');

 

  reset($HTTP_GET_VARS);

  while (list($key, ) = each($HTTP_GET_VARS)) {

    switch ($key) {

      case 'banner':

        $banners_id = tep_db_prepare_input($HTTP_GET_VARS['banner']);

 

        $banner_query = tep_db_query("select banners_title, banners_image, banners_html_text from " . TABLE_BANNERS . " where banners_id = '" . (int)$banners_id . "'");

        $banner = tep_db_fetch_array($banner_query);

 

        $page_title = $banner['banners_title'];

 

        if ($banner['banners_html_text']) {

          $image_source = $banner['banners_html_text'];

        } elseif ($banner['banners_image']) {

          $image_source = tep_image(HTTP_CATALOG_SERVER . DIR_WS_CATALOG_IMAGES . $banner['banners_image'], $page_title);

        }

        break;

    }

  }

?>

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">

<html <?php echo HTML_PARAMS; ?>>

<head>

<title><?php echo $page_title; ?></title>

<script language="javascript"><!--

var i=0;

 

function resize() {

  if (navigator.appName == 'Netscape') i = 40;

  window.resizeTo(document.images[0].width + 30, document.images[0].height + 100 - i);

}

//--></script>

</head>

 

<body onload="resize();">

 

<?php echo $image_source; ?>

 

</body>

 

</html>

 

Can anyone help?  thank you!!!

 

travis

 

Check your catalog/product_info.php if you still have the following code inside (just above 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>

Link to comment
Share on other sites

Yes the code is still there. Any other ideas? I'm really stumped! thanks

 

travis

 

 

 

 

Check your catalog/product_info.php if you still have the following code inside (just above 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>

Link to comment
Share on other sites

i did quite a few things and am cursing myself for having done too much at one time. now it's making it so difficult to pinpoint what i did that is causing the problem.

 

i replaced the original product_info.php and still having the same problem. i would be so thankful if you could check out www.healthequityproject.org/catalog and click any item and then you'll see the "click to enlarge" isn't working. perhaps you'll be able to tell something that i can't?

 

much thanks

 

 

 

try to review your last steps before crash ...

what files you changed ? if you have original  file product_info.php  try it

 

and  give us more info ...

Link to comment
Share on other sites

i did quite a few things and am cursing myself for having done too much at one time. now it's making it so difficult to pinpoint what i did that is causing the problem.

 

i replaced the original product_info.php and still having the same problem.  i would be so thankful if you could check out www.healthequityproject.org/catalog and click any item and then you'll see the "click to enlarge" isn't working. perhaps you'll be able to tell something that i can't?

 

much thanks

 

Looking at your source I see you use the STS contrib. I have no experience with that but you might take a look at the following which is written into your product_info.php

<script LANGUAGE="JavaScript" SRC="/catalog/includes/sts_templates/mysite/sts_osc_javascript.js"></SCRIPT>

The popupwindow function will probably be in there and it seems something is going wrong with that. Above that, is the reference to 'mysite' correct within the path to the javascript file ?

Link to comment
Share on other sites

thanks wheel-i'm really banging my head against the wall on this. the path is ok so that's fine. i'm not sure how to tell if the popupwindow function is coded incorrectly on the sts_osc_javascript.js file as i don't know javascript at all.

would it help if i posted the code for that? or am i at the point that i have to start all over from scratch? ugh!

 

 

 

Looking at your source I see you use the STS contrib. I have no experience with that but you might take a look at the following which is written into your product_info.php

 

The popupwindow function will probably be in there and it seems something is going wrong with that. Above that, is the reference to 'mysite' correct within the path to the javascript file ?

Link to comment
Share on other sites

thanks wheel-i'm really banging my head against the wall on this.  the path is ok so that's fine. i'm not sure how to tell if the popupwindow function is coded incorrectly on the sts_osc_javascript.js file as i don't know javascript at all. 

would it help if i posted the code for that? or am i at the point that i have to start all over from scratch?  ugh!

 

I just took a look at that .js file and as far as I can tell that seems fine.

As I understand it did work before you made your other changes and if you haven't touched that javascript file it can't be the problem.

Can you tell what this file, includes/sts_templates/mysite/product_info.php.html, should do in relation to the default osC product_info.php ?

Link to comment
Share on other sites

i'm not exactly sure-i think it's a templte for the product page. at this point i think i'm going to have to start from scratch and just reinstall everything. i backed up my database so i'll restore that. :(

 

 

 

I just took a look at that .js file and as far as I can tell that seems fine.

As I understand it did work before you made your other changes and if you haven't touched that javascript file it can't be the problem.

Can you tell what this file, includes/sts_templates/mysite/product_info.php.html, should do in relation to the default osC product_info.php ?

Link to comment
Share on other sites

i'm not exactly sure-i think it's a templte for the product page. at this point i think i'm going to have to start from scratch and just reinstall everything. i backed up my database so i'll restore that.  :(

 

You could wait a little while longer to see if someone with STS experience can give a clue before going to reinstall. Also try to track your changes back, somehow, somewhere there must be something small which made your popup stopping and it would be a shame if you have to start again just for that.

A small advice; if you have a running shop not only make a backup of your database but also make a copy of your admin and catalog directories on your local hard disk. That way you always have a working backup of everything. If you make changes and everything works to your satisfaction repeat the backups of database and files. Use an FTP program which can synchronize local and remote directories so you don't have to copy everything to your local hard disk everytime but only the changed files.

Good luck and I hope it doesn't have to come to a reinstall.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...