Zen Cart Logo

attribute pop up images

Views: 61,589

Results 61 to 80 of 221
12 Jul 2007, 8:09 AM
#61
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

attribute pop up images

Blag, thanks for the response.

I think we can both curse the browser behaviour problems. It is the bane of all web developers.
As for the javascript problem. I should perhaps have been a little clearer. What I meant to say was that there was no link call for the jscript file in the head of the HTML page...which is generated by the attributes.php file.
I am beginning to suspect that like ckosloff, I may be seeing a conflict between this module and some other module I have loaded in my system. I do NOT have IH2 loaded so that's not it. I do have something which generated a 'popupWindow function call (italics below). But that function call to popWindow is actually inside an HTML comment, so it shouldn't be active. I need to check it out.
I even tried the original version 1.0 from Quillomania and got the same results as with your v1.0.1 (except that the option name was 'undefined' in the popup window).

The relevant HTML in the HEAD section for both v1.0 and v1.0.1 reads:

<link rel="stylesheet" type="text/css" href="includes/templates/healingspirit/css/stylesheet_new.css" /> <link rel="stylesheet" type="text/css" href="includes/templates/healingspirit/css/stylesheet_tablitev3_silver.css" /> **<script type="text/javascript" src="includes/templates/healingspirit/jscript/jscript_dynamic_window_popup.js"></script>** <script type="text/javascript" src="includes/templates/healingspirit/jscript/jscript_tablitev3.js"></script> <script type="text/javascript" src="includes/modules/pages/product_info/jscript_textarea_counter.js"></script> <script language="javascript" type="text/javascript"> *<!-- function popupWindow(url) { 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') } function popupWindowPrice(url) { window.open(url,'popupWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=600,height=400,screenX=150,screenY=150,top=150,left=150') } //-->* </script>

The only difference in v1.0.2 is that the line

<script type="text/javascript" src="includes/templates/healingspirit/jscript/jscript_dynamic_window_popup.js"></script>

is missing.

Very strange behaviour. It's almost as if the override function for the php file isn't working when the .js file is in the template_default directory.

Maury

12 Jul 2007, 3:01 PM
#62
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: attribute pop up images

mauryg

Ho hum! It certainly looks as if there is either a conflict such as that which we tried to eliminate when ckosloff reached the conclusion that the js in its original location was causing a problem.

If what follows is just to simplistic for you, just tell me to take a funny run, and in future I'll raise the level of the discussion to suit someone with reasonably 'advanced' technical knowledge.

Let's see whether we can narrow things down a bit - is it possible that your default_template subdirectory is being 'ignored'?
a) Is there anything in that subdirectory which IS loading?
b) Is there anything else in that subdirectory which IS NOT loading?

If the answer to a) is 'YES', then we may be able to assume that something is overriding the js,
whereas if the answer to b) is 'YES' then we may be able to assume that there is a problem elsewhere relating to the loading of the default_template subdirectory, and I would have to back away at that point because that is just a can of worms!

I have no real idea why the js file conflicted with Image Handler 2 (IMH2), but I do know that its relocation fixed the problem for ckosloff, and it didn't seem to have any negative impact on my own store. I assumed at the time that it had something to do with the fact that the 'continuous' reloading of the js file was overriding the js file for IH2.

There is a possibility that the following code from your HEAD SECTION

<script language="javascript" type="text/javascript"> *<!-- function popupWindow(url) { 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') } function popupWindowPrice(url) { window.open(url,'popupWindow','toolbar=no,location =no,directories=no,status=no,menubar=no,scrollbars =yes,resizable=yes,copyhistory=no,width=600,height =400,screenX=150,screenY=150,top=150,left=150') } //-->* </script>

is interfering with the jscript_dynamic_window_popup.js script, but I can see how this would be the casethe functions are different i.e. yours are popupWindow(url) and popupWindowPrice(url) whereas the function in the jscript_dynamic_window_popup.js script is popImage(imageURL,imageTitle,imageDesc)

So, all I can suggest for the time being is that, if the jscript_dynamic_window_popup.js is working when it is in the YOUR_TEMPLATE subdirectory (as for v1.0.0 and for 1.0.1), you might as well stick it back in there, but, of course, you ought to be aware that, should you decide to install IMH2, you are likely to find that the IMH2 'hover' effect fails.
If this won't do for you, then we'll have to investigate alternative solutions, but let's see what your response to q's a) and b) above are.

BTW - what is generating the js in the quote above?

12 Jul 2007, 4:11 PM
#63
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

Great explanation by blag of the missing line.
BTW, I have revamped my site to Zen Cart version 1.3.7.1 and version 1.0.2 of the mod works flawlessly.
Now, mauryg, if you know that this mod and IH2 work fine in IE and FF, why try yet another .js for popups?
My suggestion for an quick and easy fix: just uninstall that script and stick to IH2, which will give you great control of your images.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

12 Jul 2007, 7:09 PM
#64
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

Blag and ckosloff,
Good morning to both of you.
Blag, the contents of the directories of interest are:

  1. \includes\modules\YOUR_TEMPLATE\
    attributes.php and the subdirectory for the v2.1a_Ty_Package_Tracker
    (note: \includes\modules\ also contains a copy of the ORIGINAL attributes.php
  2. \includes\templates\YOUR_TEMPLATE\jscript
    jscript_dynamic_window_popup.js
    jscript_tablitev3.js (for the product info template I described before)
  3. \includes\templates\template_default\jscript
    when v1.0.1 is used contains only a on_load subdirectory and a read_me file. The subdirectory contains the same read_me file. When v1.0.2 is used it will contain the jscript_dynamic_window_popup.js file.

As is obvioius from the HTML header and the actual product info pages, the tablite template is working perfectly. The javascript files are linked and the product description is tabbed as required.

So the answers to your questions are NO and NO. There is nothing else in the template_default/jscripts directory which is either also loading or not loading.
All we know is that when the jscript_dynamic_window_popup.js file is in the template_default/jscript directory it does NOT get added to the link statements in the head section of the HTML page.
The "strange" jscript language in the head section is apparently coming from the product_info page code:
/includes/modules/pages/product_info/jscript_main.php
Even the comment tags are there. that's unmodified Zencart 1.3.7

SO...I moved BOTH of the .js files from my override template directory to the template_default directory. i.e. both the window popup and tablite javascripts are in the template_default/jscript directory and nothing is left in the YOUR_TEMPLATE/jscript directory. Voila, :clap: the attribute popups work, the .js file is linked in the HTML head section and their are no javascript errors. Apparently if there is anything in the override jscript directory, zencart ignores the template_default/jscript directory. Very strange! Of course this could defeat the whole purpose of the override system on the next update if the template_default directory is replaced unless the update only adds or modifies existing files but doesn't delete the add-in modules.

ckosloff, The only 'popup' module I'm using is the attributes_popup one we are talking about. I am not even using IH2.

Hope I didn't bore you with the long winded explanation..

Maury

12 Jul 2007, 7:45 PM
#65
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

Glad you solved your issue, and by the way it is in the same manner that we solved the IH2 conflict, by moving the js files to template default.
We did it because IH2 installs there its hover javascript.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

13 Jul 2007, 5:53 AM
#66
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: attribute pop up images

I think that mauryg has hit upon something here. I didn't try moving all the js files into the YOUR_TEMPLATE subdrectory, but if mauryg is correct, it would seem that ALL the js files need to be kept in the same location, and it may not actually matter in which place they reside - other than my assumption that the template_default is the more 'efficient' location.

I hadn't realised this important requirement, but it does explain some other anomalous behaviour I have experienced in the past, but now that my js files are ALL in the SAME subdirectory, i.e. template_default, these 'glitches' have gone!!

I am not entirely sure how we can flag this potentially useful discovery so that others might be made aware of this 'constraint'.

I now see that my store has the same js script (as per the snippet previously in this thread) in the head of the product pages. I am not quite sure what the script does, and I can't help but wonder if it's a legacy thing that is now redundant, but, because this Zen Cart thing grew like topsy, no-one has thought of, or got round to, removing it.

13 Jul 2007, 2:51 PM
#67
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

"I am not entirely sure how we can flag this potentially useful discovery so that others might be made aware of this 'constraint'."
Tough, because there are many published Zen Cart mods that the authors have abandoned long ago, and are based in dated versions of the files.
Yours is an exception, having taken care of basing it on the latest and greatest.
The only thing that I can think of is publishing a more in-depth readme.txt file with the next version of the mod, based of course on the latest attributes.php.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Jul 2007, 5:57 AM
#68
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

OK guys, I finally figured out the real skinny on this.
I installed IH2 exactly according to Tim's instructions. It did NOT work! Note that Attributes_popup and Tablite were in my custom template folder.
Then I moved the IH2 .js file to my custom override template folder, i.e YOUR_TEMPLATE/jscript. Bingo EVERYTHING worked, IH2, Tablite and Attributes_popup and ALL the javascript links were in the HEAD section of the HTML page.
My conclusion is that if there is ANY .js script installed in the override folder, then the TEMPLATE_DEFAULT folder is ignored. It's not doing an override on a file by file basis, but rather on a folder by folder basis. I haven't tested this to see if it's true for some of the other template files. So if ALL the .js files are in TEMPLATE_DEFAULT/jscript folder (ckosloff v1.0.2) then everything works OR if everything is in the YOUR_TEMPLATE/jscript folder, everything works.
It sort of makes sense. If you update the core files, you would update/change the TEMPLATE_DEFAULT folder and could lose installed modules. This is the whole reason for the override system. Looks like Tim needs to update the instructions for installation of IH2 because there is no jscript folder in the CUSTOM_TEMPLATE folder in his IH2 module.
BTW, I also noted that the latest version of IH2 was written BEFORE latest version of ZC and there were some differences in the includes/functions/html_output.php file and I can't tell if they were added AFTER Tim wrote his version of that file. But in any case, IH2 is working.

This has been a great discussion and I think that this problem with the jscript folder is important enough to post to a more general audience and I will post a new topic in the general discussion area.

ckosloff: I would agree with your suggestion to just juse IH2 hover effect instead of attribute_popup (sorry Blag) BUT I don't see IH2 working with attribute images, only with product images.

Maury :cool:

14 Jul 2007, 3:03 PM
#69
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

mauryg,
IH2 hover effect and attribute_popup are entirely different animals.
The former works on product images, whereas the latter on attribute images.
I just thought that if you were using a different script than IH2 to produce a hover effect on product images, you better get rid of it.
Hope everything clear.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

14 Jul 2007, 6:29 PM
#70
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

ckosloff,
Good morning. Thanks for the clarification on IH2. I like the hover effect and of course I like the ability to automatically produce 3 different sizes of images. The one annoyance I note is that IH2 hover effect is active on ALL of my product images globally, rather than being able to activate it for individual products. Did I miss something?

Maury

14 Jul 2007, 7:09 PM
#71
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

mauryg:

ckosloff,
Good morning. Thanks for the clarification on IH2. I like the hover effect and of course I like the ability to automatically produce 3 different sizes of images. The one annoyance I note is that IH2 hover effect is active on ALL of my product images globally, rather than being able to activate it for individual products. Did I miss something?

Maury
Don't know.
Good question for the IH2 thread.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Jul 2007, 6:27 AM
#72
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

Ckosloff and Blag,

Dr. Byte has confirmed that if there are ANY .js scripts installed in the custom YOUR_TEMPLATE/jscript folder, NONE of the scripts in the TEMPLATE_DEFAULT folder will be used. So the jscript_imagehover.js file should be installed in the working (custom) jscript folder rather than OR IN ADDITION TO the TEMPLATE_DEFAULT folder in order for the hover image effect to work.

http://www.zen-cart.com/forum/showth...873#post402873

I'll ask my question about the global hover effect in the IH2 thread.

Maury

15 Jul 2007, 7:16 AM
#73
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: attribute pop up images

mauryg:

Ckosloff and Blag,

Dr. Byte has confirmed that if there are ANY .js scripts installed in the custom YOUR_TEMPLATE/jscript folder, NONE of the scripts in the TEMPLATE_DEFAULT folder will be used. So the jscript_imagehover.js file should be installed in the working (custom) jscript folder rather than OR IN ADDITION TO the TEMPLATE_DEFAULT folder in order for the hover image effect to work.

http://www.zen-cart.com/forum/showth...873#post402873

I'll ask my question about the global hover effect in the IH2 thread.

Maury
mauryg

I think that there is a solution to your dilemma, but I cannot be certain of this. I don't like the thumbnails etc created 'on the fly' from one large image, so throughout my web site I have used three images (_LRG; _MED; and the thumbnail). I have IH2 installed - in fact, due to having had to move my store twice in recent months, I have installed it no fewer than three times and on no occasion did the hover work.
Thus, if you want to suppress the 'hover' on any given image, it might be worth trying including three images as described in this thread https://www.zen-cart.com/tutorials/index.php?article=58. I am not sure if this will work, but if it does, it will confirm my suspicion that using three images prevents IH2 from generating a hover - please let me know!! (NOTE: the normal, click to enlarge, will still work, unless, of course, you don't include the _MED and _LRG images, just the thumbnail!)

15 Jul 2007, 4:47 PM
#74
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

What Dr. Byte says makes sense.
But...I'd rather continue to have both scripts in template_default and just be careful for next upgrade.
The reason is that I think that the site will work faster without the jscripts loading on every page.
But, please, use the other location if you feel more comfortable with it.
I appreciate your clarification of this issue in the IH2 thread, it was really long overdue.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Jul 2007, 5:07 PM
#75
ckosloff avatar

ckosloff

Totally Zenned

Join Date:
Feb 2007
Location:
South Florida, USA
Posts:
1,375
Plugin Contributions:
0

Re: attribute pop up images

Actually after reading everything Dr. Byte said in the thread, I realize that there should be no difference in speed.
You should only load jscripts in the template_default if certain that the jscript folder in the override template is empty.
Maybe we should clarify all this in the next release of attribute_popup.

[argentiniansupermarket.com

](http://argentiniansupermarket.com)

15 Jul 2007, 6:20 PM
#76
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

Looks like this is going to come down to a matter of philosophical preference. You are right that there will be no difference in loading speed if there is an active template other than TEMPLATE_DEFAULT. The override system will go to the custom template folder to check for files which have been replaced. (If you are using TEMPLATE_DEFAULT then of course there is no issue.).
There are no jscript files in the original default template folder as delivered with zencart and alll other modules seem to use the custom template folder for their added files. Dr. Byte has confirmed that the jscript folder is treated differently than the other folders in that the override does not work on a file by file basis, but rather, the entire folder is skipped. So it makes more sense to me to add the IH2 and attribute popup .js files to the active custom template jscript folder.

Maury

15 Jul 2007, 7:57 PM
#77
mauryg avatar

mauryg

Zen Follower

Join Date:
Jul 2006
Posts:
213
Plugin Contributions:
0

Re: attribute pop up images

Blag,
Sorry that idea doesn't seem to work. I took the default 'no_picture.gif' file which appears on all product listings if no other product image is specified and I made a _MED and _LRG version of it in Photoshop and put these new images in the appropriate directories:
images/no_picture.gif 100x80
images/medium/no_picture_MED.gif 120x96
images/large/no_picture_LRG.gif 150x120

The image(s) in the product listing page was the 100x80 thumbnail. The IH2 hover function displayed the 120x96 MED image in a window with the product name. When I deleted the MED image, the hover function displayed the original 100x80 thumbnail in a window with the product name. The 'larger image' click function displayed the 150x120 LRG image. So everything functions "normally" even when the three images not generated by IH2.

Even stranger than that - If I go to Admin>Configuration >Images and turn OFF the "Product Image - No Image Status" AND delete the image file name from "Product Image - No Image Picture" the no_picture image still appears. When I delete the _LRG and _MED images AND rename the thumbnail no_picture.gif.bak, the image no longer appears in the listings page (the product name appears in the place of the image). On the page for the product itself the product name appears where the image used to be, BUT the image (no_picture.gif) appears at the bottom of the product page below the "add to cart" icon AND THE HOVER FUNCTION STILL WORKS ON IT. I have no idea where it is getting the image. The only 'no-picture' file in the entire zencart folder is the renamed original one in the images folder. The only way to make this image disappear is to go to Admin>Catalog>Categories/Products page and delete the no_picture.gif image from the product listing. :frusty:

Maury

16 Jul 2007, 5:12 AM
#78
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: attribute pop up images

mauryg

Sorry about my assumption not proving to be correct, but now I am at a complete loss to understand why the hover effect has NEVER worked on my site. Do you guys have any ideas?

BTW when I click on this link http://www.zen-cart.com/forum/showth...873#post402873 (from earlier in this thread), I get a 'page doesn't exist' message. Can someone direct me to Dr Byte's authoritative response on the matter of the location of the js files?

Mike

16 Jul 2007, 5:56 AM
#80
blag avatar

blag

Zen Follower

Join Date:
May 2007
Location:
Leicester, England
Posts:
165
Plugin Contributions:
0

Re: attribute pop up images

mauryg:

Sorry about that Blag,
I thought I had copied the URL correctly. This one seems to work..

http://www.zen-cart.com/forum/showthread.php?t=70550

Maury
mauryg

I now see Dr Bytes reply regarding the location of js files, but I don't see any reference by Dr Byte to potential differences in performance depending on location.

I am confident that I have seen, somewhere in these fora, a reference to the fact that files located in the YOUR_TEMPLATE subdirectory load each time a relevant page is called, whereas those in the template_default subdirectory get loaded into memory once only.

For my part, I maintain a local 'version' copy of my cart separate from the main cart. This copy of my cart contains all 'modified' files and all the relevant hierarchical subdirectories - in this way it is comparatively easy for me to rebuild the store when the need arises.

Similarly, I have adopted a procedure whereby I keep the original, unmodified versions of all subsequently modified files, not only in the 'version' copy, but in my local copy of the main zen cart.

This may not be important to most users, but I testing and developing my store on a really flaky server, and I may now be facing my fourth 'forced' relocation in less than a month. Hence my paranoia about the 'version' copy.

Of course, keeping a version copy serves as a refernce in the event of major upgrades by Zen.