Guest Posted July 24, 2005 Share Posted July 24, 2005 Hey guys... I've been using STS for a while but recently made a new template page. Other than the layout, the only real difference is that I'm not using as many of the tempate variables. Now the problem is that anything osComerce does that uses javascript is not working such as the "click to enlarge feature" for product pics. I also have a custom page that uses javascript to populate combo boxes. This used to work as well but not now. Anyone know why javascript is giving me such a headache? Is there something in one of the template variables that handles the javascript functionality? Thanks all! Link to comment Share on other sites More sharing options...
davechakrabarti Posted July 24, 2005 Share Posted July 24, 2005 Hey guys... I've been using STS for a while but recently made a new template page. Other than the layout, the only real difference is that I'm not using as many of the tempate variables. Now the problem is that anything osComerce does that uses javascript is not working such as the "click to enlarge feature" for product pics. I also have a custom page that uses javascript to populate combo boxes. This used to work as well but not now. Anyone know why javascript is giving me such a headache? Is there something in one of the template variables that handles the javascript functionality? Thanks all! <{POST_SNAPBACK}> I've noticed this problem too, except I installed STS on a clean install, so I didn't think that that might be the problem. I'd assume that the original OSCommerce file includes a reference to an external javascript file containing functions that are called on some pages (such as the click to enlarge feature) which we'd have to include manually in the STS templates for it to work. Can anyone clarify? -Dave. Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 I've noticed this problem too, except I installed STS on a clean install, so I didn't think that that might be the problem. I'd assume that the original OSCommerce file includes a reference to an external javascript file containing functions that are called on some pages (such as the click to enlarge feature) which we'd have to include manually in the STS templates for it to work. Can anyone clarify? -Dave. <{POST_SNAPBACK}> Thanks, Dave. That is probably what it is- I was careful to use the includes for everything that was related to the layout such as the header.php, footer.php, and the rest but maybe I missed a file that had the javascript functions. I was worried that this might be buried inside a certain template variable, but it makes more sense that I'm probably missing an include file. Anyone out there now if this is the case and what the name of the missing include might be?? Link to comment Share on other sites More sharing options...
Geotex Posted July 25, 2005 Share Posted July 25, 2005 Thanks, Dave. That is probably what it is- I was careful to use the includes for everything that was related to the layout such as the header.php, footer.php, and the rest but maybe I missed a file that had the javascript functions. I was worried that this might be buried inside a certain template variable, but it makes more sense that I'm probably missing an include file. Anyone out there now if this is the case and what the name of the missing include might be?? <{POST_SNAPBACK}> The script should be included in product_info.php, but don't know how much of that page is used in sts templates. here's the function that defines the pop up windows <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> hope it helps???? George GEOTEX from Houston, TX (George) Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 The script should be included in product_info.php, but don't know how much of that page is used in sts templates. here's the function that defines the pop up windows <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> hope it helps???? George <{POST_SNAPBACK}> I checked this file and confirmed it hadn't been changed. The function is there. But like my custom page with javascript, it doesn't execute but instead gives a error on page that says: Line: 1 Char: 1 Error: Object expected Code: 0 Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 I checked this file and confirmed it hadn't been changed. The function is there. But like my custom page with javascript, it doesn't execute but instead gives a error on page that says: Line: 1 Char: 1 Error: Object expected Code: 0 <{POST_SNAPBACK}> Nobody knows anything about this? Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 Nobody knows anything about this? <{POST_SNAPBACK}> Okay, this is getting weird. I double checked my templates. Neither have any includes in them. The only differences in that several template variables are not present in the second template: $categorybox, $cartbox, $orderhistorybox, $reviewsbox, $informationbox, $languagebox are not in the second one. The stylesheet is also different but verything seems to display correctly. I also notice that my new template is not taking its title from the settings in the php oscommerce files like it did before- its just using whatever i have put n n the template page. I figure if it is not doing the processing it did before with the other pages, there probably is something in there dealing with the javascript issue, like an object not being created. Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 Okay, this is getting weird. I double checked my templates. Neither have any includes in them. The only differences in that several template variables are not present in the second template: $categorybox, $cartbox, $orderhistorybox,$reviewsbox, $informationbox, $languagebox are not in the second one. The stylesheet is also different but verything seems to display correctly. I also notice that my new template is not taking its title from the settings in the php oscommerce files like it did before- its just using whatever i have put n n the template page. I figure if it is not doing the processing it did before with the other pages, there probably is something in there dealing with the javascript issue, like an object not being created. <{POST_SNAPBACK}> It is definitely related to one of the missing template variables. Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2005 Share Posted July 25, 2005 It is definitely related to one of the missing template variables. <{POST_SNAPBACK}> This was missing in the new template. I missed it because it was color-coded as a comment. <!--$headcontent--> Link to comment Share on other sites More sharing options...
davechakrabarti Posted August 1, 2005 Share Posted August 1, 2005 This was missing in the new template. I missed it because it was color-coded as a comment. <!--$headcontent--> <{POST_SNAPBACK}> What did you mean...just that one line? Where was it located? Please let me know...I'd love to get mine working as well. -Dave. Link to comment Share on other sites More sharing options...
mr_biggles Posted September 15, 2005 Share Posted September 15, 2005 What did you mean...just that one line? Where was it located? Please let me know...I'd love to get mine working as well. -Dave. <{POST_SNAPBACK}> I HAVE FINALLY GOT NO ERRORS !!! what i did was -- change <!--$headcontent--> to $headcontent in both sts_template.html and product_info.php.html then i added the following javascript to the head because for some reason sts wasnt adding it ! <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> I also cleared out all other bits between <head> and </head> so my head now looks like <head> $headcontent <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> </head> This is probally wrong but to hell with it! no-one seems to be able to get STS actually working properly anyway ! Cheers! Link to comment Share on other sites More sharing options...
Geotex Posted September 15, 2005 Share Posted September 15, 2005 I HAVE FINALLY GOT NO ERRORS !!!what i did was -- change <!--$headcontent--> to $headcontent in both sts_template.html and product_info.php.html then i added the following javascript to the head because for some reason sts wasnt adding it ! <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> I also cleared out all other bits between <head> and </head> so my head now looks like <head> $headcontent <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> </head> This is probally wrong but to hell with it! no-one seems to be able to get STS actually working properly anyway ! Cheers! <{POST_SNAPBACK}> Good work. Can you handle variable sized images, and have them display in the pop up properly? If not, I can send you the php commands to change to auto calculate the size of your photos. George GEOTEX from Houston, TX (George) Link to comment Share on other sites More sharing options...
mr_biggles Posted September 16, 2005 Share Posted September 16, 2005 Good work. Can you handle variable sized images, and have them display in the pop up properly? If not, I can send you the php commands to change to auto calculate the size of your photos. George <{POST_SNAPBACK}> lol, simple answer - I don't know yet ! I havent even started putting in product yet, i wanna get a working oscommerce with all the add-ons i want before i start loading the db. With this said i may be interested in the code you have, could you post it here? Cheers, Biggles Link to comment Share on other sites More sharing options...
Geotex Posted September 16, 2005 Share Posted September 16, 2005 lol, simple answer - I don't know yet ! I havent even started putting in product yet, i wanna get a working oscommerce with all the add-ons i want before i start loading the db. With this said i may be interested in the code you have, could you post it here? Cheers, Biggles <{POST_SNAPBACK}> This is cross browser, auto sizes the pop-up for the picture, and auto closes with click on close window or even click anywhere in the pop will close the window. Only problem I've seen is with FireFox, if you right-click to check properties, it closes the window. IE works as expected. <?php /* $Id: popup_image.php,v 1.18 2003/06/05 23:26:23 hpdl Exp $ osCommerce, Open Source E-Commerce Solutions http://www.oscommerce.com Copyright (c) 2003 osCommerce Image Modifications 2003/07/20 G. Snell Released under the GNU General Public License */ require('includes/application_top.php'); $navigation->remove_current_page(); $products_query = tep_db_query("select pd.products_name, p.products_image from " . TABLE_PRODUCTS . " p left join " . TABLE_PRODUCTS_DESCRIPTION . " pd on p.products_id = pd.products_id where p.products_status = '1' and p.products_id = '" . (int)$HTTP_GET_VARS['pID'] . "' and pd.language_id = '" . (int)$languages_id . "'"); $products = tep_db_fetch_array($products_query); ?> <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> <html <?php echo HTML_PARAMS; ?>> <head> <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> <title><?php echo $products['products_name']; ?></title> <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> <script language="javascript"><!-- var i=0; function resize() { if (navigator.appName == 'Netscape') i=1; if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+100-i); self.focus(); } //--></script> </head> <body onload="resize();" onclick="javascript:top.window.close();"> <?php if (tep_not_null($products['products_image'])) { $size=GetImageSize(DIR_WS_IMAGES . $products['products_image']); echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], $size[0], $size[1]); } ?> <table align="center" width="50%"><tr><td><a href="javascript:window.close();"><strong><font size=-1 face=tahoma color=#000000>Close Window</font></strong></a></td> </tr></table> </body> </html> <?php require('includes/application_bottom.php'); ?> George GEOTEX from Houston, TX (George) Link to comment Share on other sites More sharing options...
mr_biggles Posted September 18, 2005 Share Posted September 18, 2005 Thanks for the code but i have added a couple of things and the images and pop-ups seem to resize fine - for now ! lol Cheers. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.