Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Popup window too small


muuseec

Recommended Posts

When I click a product to enlarge, my popupwindow is always a bit too small...!

 

It usually cuts off the lower part of the product.

Is there a remedy for this?

 

Thankful for suggestions. :thumbsup:

Information overload!

Link to comment
Share on other sites

you could adjust the width/height parameters passed to the window.open() function in catalog\product_info.php

defaults is 100x100 i think.

 

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=300,height=300,screenX=150,screenY=150,top=150,le
ft=150')

 

here I made it 300x300

Link to comment
Share on other sites

you could adjust the width/height parameters passed to the window.open() function in catalog\product_info.php

defaults is 100x100 i think.

 

  window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=300,height=300,screenX=150,screenY=150,top=150,le
ft=150')

 

here I made it 300x300

 

 

this didn't seem to do anything for me. :'(

Link to comment
Share on other sites

you could adjust the width/height parameters passed to the window.open() function in catalog\product_info.php

defaults is 100x100 i think.

 

 ?window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,res
izable=yes,copyhistory=no,width=300,height=300,screenX=150,screenY=150,top=150,le
ft=150')

 

here I made it 300x300

 

Hmmm, well I don?t that value is fixed to start with, I have a wide variety of picture sizes, but it is ALWAYS just cutting the lower part of the image regardless if it?s say 200 pixels or 50 pixels high.

There has gotta be some other place that u can find it. Doesn?t it?

Information overload!

Link to comment
Share on other sites

Could it be in the area of the product itself ? What i mean by this is when you setup your configuration, and afterwards in ADMIN, there is something i noticed either when ADDING a new image or the actual configuration area, where the image is autosized.

 

Perhaps this might help for you ??

 

Let me know if this works for you or not or i am talking a complete load of nonsense !!!? :blink:

Link to comment
Share on other sites

Hmmm, well I don?t that value is fixed to start with, I have a wide variety of picture sizes, but it is ALWAYS just cutting the lower part of the image regardless if it?s say 200 pixels or 50 pixels high.

There has gotta be some other place that u can find it. Doesn?t it?

 

Im trying to alter the pop up window & the picture inside it to make them bigger, no luck with altering the product_info.php file - window.open(url,'popupWindow','toolbar=no,location=no,directories=

no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width

=100,height=100,screenX=150,screenY=150,top=150,left=150')

 

I tried changing all the sizes & they don't seem to alter anything in the pop up window - anyone got any ideas...

Link to comment
Share on other sites

Im trying to alter the pop up window & the picture inside it to make them bigger, no luck with altering the product_info.php file - window.open(url,'popupWindow','toolbar=no,location=no,directories=

no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width

=100,height=100,screenX=150,screenY=150,top=150,left=150')

 

I tried changing all the sizes & they don't seem to alter anything in the pop up window - anyone got any ideas...

 

Perhaps I missed that earlier :blink: Since the URL sent to window open is an image then there will be no body tag on the popup. The workaround would be to have an HTML file which included your body tag then send the image file name as a query string attached to the URL of the html page.

Link to comment
Share on other sites

Perhaps I missed that earlier :blink:  Since the URL sent to window open is an image then there will be no body tag on the popup. The workaround would be to have an HTML file which included your body tag then send the image file name as a query string attached to the URL of the html page.

 

Oooops, well u missed me there as well :blink:

You don?t happen to have code suggestions...?

Information overload!

Link to comment
Share on other sites

This may help, I use close_popup_v1 and made a small change to one line so everything shows up. Simply replace catalog/popup.php with this code and it should work. BACKUP FIRST.

 

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

 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; ?>">
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<script language="javascript"><!--
var i=0;
function resize() {
 if (navigator.appName == 'Netscape') i=40;
 if (document.images[0]) {
 imgHeight = document.images[0].height+120-i;
 imgWidth = document.images[0].width+30;
 var height = screen.height;
 var width = screen.width;
 var leftpos = width / 2 - imgWidth / 2;
 var toppos = height / 2 - imgHeight / 2; 
 window.moveTo(leftpos, toppos);  
 window.resizeTo(imgWidth, imgHeight);
 }
 self.focus();
}
//--></script>

</head>
<body onload="resize();">
<center><a class="boxText" href="javascript:;" onclick="javascript:top.window.close();"> 
<?php
   $products_bigimage = str_replace(".","_G.",$products['products_image']);
$vorhanden = file_exists(DIR_WS_IMAGES . $products_bigimage);
if($vorhanden){
echo tep_image(DIR_WS_IMAGES . $products_bigimage, $products['products_name']. " - ". POPUP_WINDOW_CLICK_TO_CLOSE_TEXT);
} else {
  echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name']. " - ". POPUP_WINDOW_CLICK_TO_CLOSE_TEXT);
};
?><br />
[ <?php echo POPUP_WINDOW_CLOSE_TEXT ?> ]
</a></center>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

 

Notice I changed:

imgHeight = document.images[0].height+75-i;

(I think it was 75)

To:

imgHeight = document.images[0].height+120-i;

 

Hope this helps,

Installed Contributions: CCGV, Close Popup, Dynamic Meta Tags, Easy Populate, Froogle Data Feeder, Google Position, Infobox Header Entire Row, Live Support for OSC, PayPal Seal with CC images, Report_m Sales, Shop by Price Revised, SQL Updater, Who's Online Enhancement, Footer, GNA EP Assistant and still going.

Link to comment
Share on other sites

Cheers for that... The code seems to add text & then take the window to the centre of the page...... The more I mess the more mess I get into.... What I was after was just to resize the pop up window - where it was near the top right hand corner & also to make the picture much larger - my enlarge link makes the pop up picture smaller.... Anyone know the, which code to alter...

Link to comment
Share on other sites

The more I mess the more mess I get into....

 

Sorry about that originally I posted to mod the jscript of the page cuz I totally forgot the popup_image.php (if you can believe it) This time I tested the default popup_image.php file setting a 600x600 image in a table. You could change the window size on the last tep_image statement according to your needs

 

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

 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>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
<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=40;
 if (document.images[0]) window.resizeTo(document.images[0].width +30, document.images[0].height+60-i);
 self.focus();
}
//--></script>
</head>
<body onload="resize();">
 <table border="0" width="100%" height="100%" cellspacing="0" cellpadding="0">
   <tr><td align="center">
<?php echo tep_image(DIR_WS_IMAGES . $products['products_image'], $products['products_name'], 600, 600) . "\n"; ?>
   </td></tr>
 </table>
</body>
</html>
<?php require('includes/application_bottom.php'); ?>

 

Finally you could install the gd thumbnails contribution that preserves image quality for different image sizes

Link to comment
Share on other sites

  • 2 weeks later...

Had the same issue with the bottom of the window cutting off part of the image, just found a simple fix.

 

You'll need to edit catalog/popup_image.php

 

Find:

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

 

And replace with:

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

 

Thanks to bobg7 for the hint: :thumbsup:

Link to comment
Share on other sites

Had the same issue with the bottom of the window cutting off part of the image, just found a simple fix.

 

You'll need to edit catalog/popup_image.php

 

Find:

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

 

And replace with:

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

Jasper - I think I Loooooove u!

 

Worked like a charm, and it only took 30 seconds!

 

Thanx man! :) :thumbsup:

Information overload!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...