please be aware that i diddnt really write this, its just common ecommerce code hacked into actinic.
any changes/improvements would be greatly appreciated
any changes/improvements would be greatly appreciated
HTML Code:
Gabriel Crowe's recently viewed items script that was stolen from the web somewhere => this css goes in your main template header (or another appropriate external place) ========================================================= <style type="text/css"> .recently {text-align:center;width:100%;margin:5px;} .recentlyheader { font-size: 14px; font-weight: bold; text-align: left;color: <actinic:variable name="TextColor" />; margin: 5px; padding: 5px; border-bottom-width: 1px; border-bottom-style: dotted; border-bottom-color: <actinic:variable name="Palette3" />;} .recently img {text-decoration:none;width:100px;height:100px;} .recently a{text-decoration:none;color:<actinic:variable name="TextColor" />;} .viewed{margin-left:0px;float:left;text-align:center;width:130px;} .viewed a:hover{background-color:<actinic:variable name="BGColor" />;} .viewed img {padding:10px;border:2px solid <actinic:variable name="Palette2" />;} .viewed img:hover {background-color:<actinic:variable name="BGColor" />;border:2px solid <actinic:variable name="Palette3" />;} </style> ========================================================= this part goes in the product layout, at the bottom. ========================================================= <script type="text/javascript"> // Set current item as p0 proIMAGE='<actinic:variable name="ProductImageFileName" />'; var temp = new String('<Actinic:Variable Name="ProductName"/>'); proNAME = temp.replace(/[^a-zA-Z 0-9]+/g,''); var p0=('<div class="viewed"><a href="'+document.URL+'"><img src=\''+proIMAGE+'\' width=75 height=75 /><br/>'+proNAME+'</a></div>'); // test to see if p0 is not equal to null and that it does not match any of the other products // p1, p2, p3, or p4 - if all cases are true, set and rotate the cookies. var p1=getCookie("p1"); var p2=getCookie("p2"); var p3=getCookie("p3"); var p4=getCookie("p4"); if(p0 !=null && p0 != p1 && p0 != p2 && p0 != p3 && p0 !=p4){ setCookie("p1",p0) setCookie("p2",p1) setCookie("p3",p2) setCookie("p4",p3) } </script> ========================================================= this part goes at the end of the section that contains products. ================================================================== <div class="recently"> <script type="text/javascript"> if (p0){ } else {var p0=null; } var p1=getCookie("p1"); var p2=getCookie("p2"); var p3=getCookie("p3"); var p4=getCookie("p4"); if(p1){document.write('<div class="recentlyheader">Recently Viewed Items:</div>');} if (p1 !=null) {document.write(p1)} if (p2) {document.write(p2)} if (p3) {document.write(p3)} if (p4) {document.write(p4)} </script> </div> <div style="clear:both;"></div> ================================================================== please note that the locations of these items could be out, and that i DID NOT WRITE THIS. original from: http://www.jesseo.com/Recently-Viewed-Products.txt i merely adapted it for Actinic. Good luck, may the force be with you, always. - GC http://interact-studio.co.uk/
Comment