Zen Cart Logo
Forums / Bug Reports / Enlarge product picture is cutoff

Enlarge product picture is cutoff

Views: 5,194

Results 1 to 20 of 30
15 Aug 2011, 3:24 AM
#1
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Enlarge product picture is cutoff

v1.5beta

go to meaningfulaccents.com
click on figurines
click on Enlarge image
you will notice the shoe is cut off
using IE8.0

15 Aug 2011, 3:29 AM
#2
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,767
Plugin Contributions:
9

Re: Enlarge product picture is cutoff

Just don't start with an image larger than your intended screen size.

15 Aug 2011, 4:06 AM
#3
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

hi dbltoe,

can u give more details? i don't understand what you mean. thanks.

15 Aug 2011, 4:31 AM
#4
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

I have the same issue ebaobao. At first I thought it was the template I was using, but when I switched back to the classic contemporary green template the behavior was still present. You will also find many sites exhibiting this behavior with the popup enlarge image (unless they are using one of the lightbox mods). You will find some forum posts about it, but back when I was troubleshooting it there were no solutions found. I never had time to dig into it so ended up just leaving it alone. I am using 1.3.9h (behavior was also present in v1.3.8a).

16 Aug 2011, 3:34 AM
#5
ideasgirl avatar

ideasgirl

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,437
Plugin Contributions:
3

Re: Enlarge product picture is cutoff

That's not a bug, if you are seeing it on Firefox, that's its usual behavior. If you look at it on IE, Safari or Chrome, the images show up just fine.

Now, you have bigger problems because there's something wrong with your categories, I just can't click on specific ones, the hover is all over the place (too big) so is difficult to click the right one.

17 Aug 2011, 4:44 AM
#6
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

hi ideasgirl,
in my original post, the problem exists on IE. It also exist on latest version of FF. Thanks for pointing out the categories hover issue. I just fixed it.

17 Aug 2011, 5:09 AM
#7
ideasgirl avatar

ideasgirl

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,437
Plugin Contributions:
3

Re: Enlarge product picture is cutoff

ebaobao:

hi ideasgirl,
in my original post, the problem exists on IE. It also exist on latest version of FF. Thanks for pointing out the categories hover issue. I just fixed it.

You are welcome...

I don't see the issue using IE8, Safari, or Chrome. It has always been an issue on FF (since I recall). Here are my 3 screenshots for you, hope that helps:
http://img545.imageshack.us/img545/6594/screenshotff.jpg (FF)
http://img225.imageshack.us/img225/9408/screenshotie8.jpg (IE8)
http://img194.imageshack.us/img194/9259/screenshotsafari.jpg (Safari)

17 Aug 2011, 5:53 AM
#8
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

hi ideasgirl,
what I meant is that the window that encapsulates the picture cuts off the shoe. But the image itself is fine. Once you resize the window you can see everything. I was talking about the initial window size right after clicking enlarge. Sorry if i wasn't clear. This is not that big of a deal. Just want zc to be as great as possible.

17 Aug 2011, 9:39 AM
#9
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Enlarge product picture is cutoff

ideasgirl:

It has always been an issue on FF (since I recall)That is because Zen Cart detects FF and does some incorrect adjustment to the popup size (was probably needed for Netscape, a long long time ago....). The fix is easy: just remove the size adjustment value (it's in some js popup file, might post details later).

17 Aug 2011, 1:09 PM
#10
paulm avatar

paulm

Totally Zenned

Join Date:
Nov 2003
Posts:
1,878
Plugin Contributions:
5

Re: Enlarge product picture is cutoff

The code has changed over the years it seems....

But the popup height adjustment is in this part of the code:
(includes\modules\pages\popup_image\jscript_main.php)

  if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1 && window.navigator.userAgent.indexOf('SV1') != -1) {
      i=30; //This browser is Internet Explorer 6.x on Windows XP SP2
  } else if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) {
      i=0; //This browser is Internet Explorer 6.x
  } else if (window.navigator.userAgent.indexOf('Firefox') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=25; //This browser is Firefox on Windows
  } else if (window.navigator.userAgent.indexOf('Mozilla') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=45; //This browser is Mozilla on Windows
  } else {
      i=80; //This is all other browsers including Mozilla on Linux
  }
```Adjustment for FF colored red, and 45 seems to be a better value than the current 25.

Not sure about IE 8 though, probaly it also depends on the users browser (compatibility) settings?

(In FF it also depends if the user settings allow javascript to resize the window. If resizing is disallowed the image will fit)
17 Aug 2011, 1:50 PM
#11
ideasgirl avatar

ideasgirl

Totally Zenned

Join Date:
Aug 2005
Location:
Trujillo Alto, Puerto Rico
Posts:
1,437
Plugin Contributions:
3

Re: Enlarge product picture is cutoff

what I meant is that the window that encapsulates the picture cuts off the shoe. But the image itself is fine.
Yes, I know...

The fix is easy: just remove the size adjustment value
Worked like a charm, thanks! :smartalec:

18 Aug 2011, 3:46 AM
#12
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

paulm:

The code has changed over the years it seems....

But the popup height adjustment is in this part of the code:
(includes\modules\pages\popup_image\jscript_main.php)

if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1 && window.navigator.userAgent.indexOf('SV1') != -1) {
i=30; //This browser is Internet Explorer 6.x on Windows XP SP2
} else if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) {
i=0; //This browser is Internet Explorer 6.x
} else if (window.navigator.userAgent.indexOf('Firefox') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
i=25; //This browser is Firefox on Windows
} else if (window.navigator.userAgent.indexOf('Mozilla') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
i=45; //This browser is Mozilla on Windows
} else {
i=80; //This is all other browsers including Mozilla on Linux
}

> 
> Not sure about IE 8 though, probaly it also depends on the users browser (compatibility) settings?
> 
> (In FF it also depends if the user settings allow javascript to resize the window. If resizing is disallowed the image will fit)


Thanks for identifying the where the problem was coming from and what file needed to be modified.  Changing it to i=45 made negligible difference in Firefox.  I had to change it to **i=80** and the popup re-sizes perfectly in Firefox showing the entire image (same as in IE and Chrome now).
19 Aug 2011, 6:35 AM
#13
ebaobao avatar

ebaobao

Zen Follower

Join Date:
Jul 2008
Posts:
495
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

crunch are you saying it fixes it in IE as well? the line in red says specifically firefox on windows. can you clarify?

21 Aug 2011, 1:38 AM
#14
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

No, the Firefox modification above does not fix the issue in IE 8.

I also just noticed there was a little bit of the image cut off in IE 9, so there is still an issue with IE browsers. I did some more testing with my site.

I added the following to the \includes\modules\pages\popup_image*jscript_main.php* file and it has fixed the problem in both IE 8 and IE 9 (not sure if issue is in IE 7, but probably is).

  } else if (window.navigator.userAgent.indexOf('MSIE 8.0') != -1) {
      i=80; //This browser is Internet Explorer 8.x
  } else if (window.navigator.userAgent.indexOf('MSIE 9.0') != -1) {
      i=80; //This browser is Internet Explorer 9.x

and of course to fix the issue in Firefox, change the Firefox entry from i=25 to i=80 as I posted above.

This has resolved the issue on my site, so when editing your own site, make a backup of that jscript_main.php file (just in case something goes wrong).

Here is how that whole section of the file looks now:

  if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1 && window.navigator.userAgent.indexOf('SV1') != -1) {
      i=30; //This browser is Internet Explorer 6.x on Windows XP SP2
  } else if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) {
      i=0; //This browser is Internet Explorer 6.x
  } else if (window.navigator.userAgent.indexOf('MSIE 8.0') != -1) {
      i=80; //This browser is Internet Explorer 8.x
  } else if (window.navigator.userAgent.indexOf('MSIE 9.0') != -1) {
      i=80; //This browser is Internet Explorer 9.x
  } else if (window.navigator.userAgent.indexOf('Firefox') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=80; //This browser is Firefox on Windows
  } else if (window.navigator.userAgent.indexOf('Mozilla') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=45; //This browser is Mozilla on Windows
  } else {
      i=80; //This is all other browsers including Mozilla on Linux
  }
21 Aug 2011, 2:01 AM
#15
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

Correction to IE 8 and IE 9 values (too much playing around and I copied in wrong data in the previous post.

The following will make the popup re-size windows behave the same in IE 8 and IE 9 and show the entire image (not cutting any of the bottom of the image off). NOTE: I tested all this using the stock Classic Contemporary Green template:

  } else if (window.navigator.userAgent.indexOf('MSIE 8.0') != -1) {
      i=55; //This browser is Internet Explorer 8.x
  } else if (window.navigator.userAgent.indexOf('MSIE 9.0') != -1) {
      i=30; //This browser is Internet Explorer 9.x
21 Aug 2011, 2:48 AM
#16
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

Here is an update to my testing using the stock Classic Contemporary Green template.

Issues:

  • IE 8: Popup re-size window does not open vertically enough to show the bottom of an image (it's cut off)
  • IE 9: Popup re-size window opens a bit too much so it shows extra white space below the image
  • Firefox 6 and prior versions: Popup re-size window does not open vertically enough to show the bottom of an image (it's cut off)

I updated the \includes\modules\pages\popup_image\jscript_main.php file to add IE 8 and IE 9 agents and changed the Firefox value.

Here is how that whole section of the file looks now:

  if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1 && window.navigator.userAgent.indexOf('SV1') != -1) {
      i=30; //This browser is Internet Explorer 6.x on Windows XP SP2
  } else if (window.navigator.userAgent.indexOf('MSIE 6.0') != -1) {
      i=0; //This browser is Internet Explorer 6.x
  } else if (window.navigator.userAgent.indexOf('MSIE 8.0') != -1) {
      i=55; //This browser is Internet Explorer 8.x
  } else if (window.navigator.userAgent.indexOf('MSIE 9.0') != -1) {
      i=30; //This browser is Internet Explorer 9.x
  } else if (window.navigator.userAgent.indexOf('Firefox') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=60; //This browser is Firefox on Windows
  } else if (window.navigator.userAgent.indexOf('Mozilla') != -1 && window.navigator.userAgent.indexOf("Windows") != -1) {
      i=45; //This browser is Mozilla on Windows
  } else {
      i=80; //This is all other browsers including Mozilla on Linux
  }

These updates above fix these issues with the popup re-size box in IE8, IE9 and Firefox.

NOTE: If your template modifies the behavior of the box somehow you may need to tweak these values a bit. The reason I say this is that the custom template I use (cherry zen) has something screwy in it that pushes the image down in the box leaving white space above the image. So, I have to tweak these values a bit to compensate for that template behavior.

21 Aug 2011, 3:12 AM
#17
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Enlarge product picture is cutoff

Do you have a demo of where you are using these settings?

I am not so sure about the FireFox setting, FireFox 6 is going to have issues with that being so large ...

21 Aug 2011, 3:19 AM
#18
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

I PM'd you.

21 Aug 2011, 4:37 AM
#19
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Enlarge product picture is cutoff

What operating system do you have on your computer?

I am using Windows 7 ...

21 Aug 2011, 5:08 AM
#20
crunch avatar

crunch

Zen Follower

Join Date:
Mar 2009
Posts:
227
Plugin Contributions:
0

Re: Enlarge product picture is cutoff

Windows 7 Ultimate 64-bit