Hope this is the right place to add this for the community.
I have been working on a site that will eventually have many attributes. The problem that I had was how to keep it clean. The site is still under construction. But I thought that I would share what I had done.
Here is a version on a mockup site: Link
There is this great script by Eric Bosrup for creating hovering text boxes from links. Highly customizable. His website is Here. I have included the file below for you.
Make sure and back up the files that you will be modifing. Don't forget to utilize the overide feature in Zen-Cart. You are doing this on your own and I am not responsible for any complications. Just wanted to say that up front. If you have a problem I will try to help.
Here are the steps:
1. load the js on your server. I just put mine in the store folder. Here is the file: File
2. load the images for the graphics on your server. I created an images folder in the root of my server and put the three images there. Here are the images
3. add this to the bottom of mytemplate/common/tpl_footer.php
Code:
<script type="text/javascript" src="../store/overlib.js"></script>
Here is a description of what I did.
I utilitzed the options comment field in the attributes option name. That means that your comments will appear twice, once above the attribute and within the graphic box. You can remove the one above the attributes. I have that shown below in my examples.
If you don't have a comment it won't add the hovering tip to the attribute. The attribute will look normal.
At some point I may add an extra comment field so I can use both independantly with an attribute. But for my needs this will work.
4.On line 25 in mytemplate/template/tpl_modules_attributes.php I removed this
Code:
<?php echo $options_comment[$i]; ?>
This will prevent the comments appearing in two places.
Next I modified line 30 from this:
Code:
<div class="wrapperAttribsOptions">
<h4 class="optionName back"><?php echo $options_name[$i]; ?></h4>
To this:
Code:
<div class="wrapperAttribsOptions">
<h4 class="optionName back"><?php
if ($options_comment[$i] != '')
{echo "<a href=\"#\" onmouseover=\"return overlib('$options_comment[$i]', TEXTCOLOR, '#ffffff', WIDTH, 250, HEIGHT, 120, BACKGROUND, '../images/greenbox.gif', PADX, 60, 20, PADY, 20, 20);\" onmouseout=\"return nd();\" ><img src=\"../images/tooltip.png\" border=\"0\" alt=\"tooltip\"/></a> " . $options_name[$i];}
else {echo "<img src=\"../images/spacer.gif\" width=\"16px\">" . $options_name[$i];}
?></h4>
Don't forget to add this to the bottom of the mytemplate/common/tpl_footer.php if you didn't do it in step 3:
Code:
<script type="text/javascript" src="../store/overlib.js"></script>
Hope all this makes sense.
Would love to see your site if you add this.
Bookmarks