Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Please help with STS Popup Image Error


Recommended Posts

Hello,

I've installed STS and everything works perfectly except the popup image window. With STS active, the enlarge image link opens a minimized window of my blank page template.

 

I've narrowed down the issue by trail and error to this code in the sts_display_output.php file:

 

// Override if we need to show a pop-up window

$scriptname = $_SERVER['PHP_SELF'];

$scriptname = getenv('SCRIPT_NAME');

$scriptbasename = substr($scriptname, strrpos($scriptname, '/') + 1);

// If script name contains "popup" then turn off templates and display the normal output

// This is required to prevent display of standard page elements (header, footer, etc) from the template and allow javascript code to run properly

if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {

 

$display_normal_output = 1;

$display_template_output = 0;

}

 

When I change the following line:

if (strpos($scriptname, "popup") !== 1|| strpos($scriptname, "info_shopping_cart") !== false) {

 

Then the popup image on the product detail page works perfectly but the product page is displayed as the OSC default template without my customized layout and styles.

 

The only similar post on this issue was from Ignission who recommended the following change to this code:

//if (strpos($scriptname, "popup") !== false || strpos($scriptname, "info_shopping_cart") !== false) {

 

if ($HTTP_GET_VARS['popup'] == 1) {

 

$display_normal_output = 1;

$display_template_output = 0;

 

Unfortunately, I tried this but got the same result. The popup image works but STS doesn't or visa versa.

 

I would greatly appreciate any advice to solve this issue to get the popup image to display correctly along with my custom STS layout.

 

Thank you!

 

Pete

Link to comment
Share on other sites

Ok, I haven't heard back from anyone on this yet and have spent the weekend searching through every post regarding STS and popup images.

 

I've found several references to changing the Javascript in the header of the product_info.php.html file along with a code change in the sts_product_info.php file.

 

This topic came the closest to getting the issue fixed:

http://www.oscommerce.com/forums/index.php?showtopic=149771&hl=

 

However, I've found 2 problems:

 

1) The product_info.php.html file is not working on my site. Any changes I make to this do not show up and I checked the debugging option in the STS output file and found my product detail page was still pulling from the default template.

 

2) If I follow dave111's instructions in the topic linked above and place the javascript code in the header of my default template, I get a popup window instead of an error but the window only opens to an empty template page again.

 

Has anyone found a solution to these problems? It seems like there is a lack of correct instructions in STS or a bug that has not been addresses in the latest contribution release.

 

Any advice on this matter would be greatly appreciated.

 

Thanks!

 

Pete

Link to comment
Share on other sites

Ok, after several failed attempts at getting help, I was able to figure this one out. Here are the steps I took if anyone else needs to fix the same problem:

 

1) I got rid of the version 3.0 install that I started with and restarted with 2.01.

 

If you have the WebMakers Header Tags Controller Intstalled, then change the sts_display_output.php file here:

 

Find this section:

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

require(DIR_WS_FUNCTIONS . 'header_tags.php');

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

echo "<title>" . TITLE . "</title>";

}

// EOF: WebMakers.com Changed: Header Tag Controller v1.0

 

And replace with this code:

// BOF: WebMakers.com Changed: Header Tag Controller v1.0

// Replaced by header_tags.php

if ( file_exists(DIR_WS_INCLUDES . 'header_tags.php') ) {

require_once(DIR_WS_FUNCTIONS . 'clean_html_comments.php');

require_once(DIR_WS_FUNCTIONS . 'header_tags.php');

require(DIR_WS_INCLUDES . 'header_tags.php');

} else {

echo "<title>" . TITLE . "</title>";

}

// EOF: WebMakers.com Changed: Header Tag Controller v1.0

 

This is actually indicated in the HTC Install_Catalog instructions.

 

2) Follow the instructions for the "Error Fixed" post from Alejandro Rodriguez the STS contribution page dated April 2, 2004.

 

3) Follow the instructions for the "STS 2.01 Bug fixes" post from Christophe B. on the STS contribution page dated Aug 25, 2004.

 

These corrections may also work in the 3.0 version but I have not tested this. Frankly I'm a little suprised that these were not included in 3.0 since they have been public for a year before the 3.0 release.

 

Also, if you use HTC, DO NOT use the "sts_header_tag_fix" instructions from ITNetwork Designs dated April 24, 2005. With HTC installed, this will break the site. Without HTC, I'm not sure what it does.

 

That's it. I've tried almost every other solution posted on the STS Contribution page and in this forum and none of them worked.

 

Good luck.

 

Pete

Link to comment
Share on other sites

  • 2 weeks later...

I have found putting

 

<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>

 

somewhere between the <head></head> of your sts_template.html (or if you are using a product_info.php.html) fixes the pop image problem. I got the code from another post. Hope it helps somebody else.

Link to comment
Share on other sites

  • 1 month later...

Hey guys, FWIW, it looks like this error is coming from a problem with the sts_osc_javascript.js file. This file should be included in your sts_template.html file with a line similar to:

<script language="JavaScript" src="$templatepath/sts_osc_javascript.js"></script>

The sts_osc_javascript.js file should NOT have the <script></script> tags at the top and bottom of the file, so remove those lines and you'll be fine.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...