Hello, How can I display a product image when the mouse is on its name. For example in the list of the basket. I think the solution is in the file orders_basket.tpl ,perhaps with a function call. Thanks
By searching on some site, I think I'll find the solution. I downloaded the script wz_tooltip.js. I put in the core file. In the template.tpl you want, I place the following code:
in the HEAD: <script type="text/javascript" src="$config[dir_core]wz_tooltip.js"></script>
That's it. It works. I make this: I downloaded the script wz_tooltip.js. I put in the core file. In the template.tpl you want, I place the following code:
inside the BODY section <script type="text/javascript" src="$config[dir_core]wz_tooltip.js"></script>
You have to generate the link to images, beacause it is not there. In function listProducts in core/orders.php This function is responsible for creating product list in basket and on the orderPage.
The easiest way: in the above file/function over the line: foreach( $this->aProducts as $aData ){ add: $oFile=Files::getInstance(); then in the loop over the $aData['sLinkDelete'] = defined(.... add: $aData['sFileName']=$oFile->aFilesImages[2][$oFile->aImagesDefault[2][$aData['iProduct']]]['sFil eName']; Now you have the file name in the $aData sent to templates. You need to add the directory (small or bigger thumbs or even the big ones), alt, title (or what you need) in the img tag.
In your example above just exchange: $config[dir_files]$aDataImage[iSizeValue1] to: $config[dir_files]$aData[sFileName] This will give you the original big images. Adding the thumb directory (100, 150 or whatever thumbs sizes you have) between dir_files and fileName you can display the small thumbs. $config[dir_files]100/$aData[sFileName] This "100" you can put just "hard wired" or create this in the listProducts.
Additionally you should build in some "security" queries in this function (does the image exist? and so on).
That's it! Everything is good. I did not write the code in the proper function of the order.php file I thank you from my heart Boboo. The only thing left to do is to place the image on the right of my mouse. The solution should be in this line in tooltip code: <div id=output style=position:absolute; display:none; ></div>
I'm worse than you, but very good student. I'm really addict of this cms.
This I put into common.js function tooltip(evt,id){ gEBI('output').innerHTML='<img src='+id+' />'; var e=(window.event)?window.event:evt; gEBI('output').style.top=parseInt(e.clientY)-100+'px'; gEBI('output').style.left=e.clientX+parseInt(50)+'px'; gEBI('output').style.display='block'; } function tooltipdown(){ gEBI('output').style.display="none"; } and this into container.tpl <div id="output" style="position:fixed;display:none;z-index:1;"></div> direct under <body> in both blocks: ORDER_BODY & BODY
If you use addition (+) in .js don't forget to parseInt() the added value, otherwise the value will be append (100+50->10050).
And in the products list of basket & orderForm <a href="#(or link to product)" onMouseOver="tooltip(event,'$aData[sFileName]');" onMouseOut="tooltipdown();">$aData[sName]</a>