X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Recently Viewed Mod (https://forum.x-cart.com/showthread.php?t=36753)

Warwick 01-24-2008 11:05 PM

Re: Recently Viewed Mod
 
You have otherwise any idea why it wouldn't show recently viewed products?

Warwick 01-24-2008 11:24 PM

Re: Recently Viewed Mod
 
Could it be related to the fact that I use DSEFU PRO?

MoonDog 01-25-2008 12:21 AM

Re: Recently Viewed Mod
 
Warwick,
Quote:


You have otherwise any idea why it wouldn't show recently viewed products?

This mod works like this:
First of all, click on a product and view the product details.

Then select another product and then view the product details for this product.

Now look to see if you have an thumbnail, product title and product price displayed in your recently view box. If everything works it should display the first viewed product.

If nothing shows up, then make sure that you have cookies enabled in your browser. See post #27 how to turn it on.

Repeat the first two steps by reviewing two product details and see if there is anything now in the recently viewed box. If not, then most likely it's the code in your product.tpl file.

Make sure that you have used the product.tpl file and not the products.tpl file. The second file has the letter s after product.

Re-install the javascript code from post #1 to the very end of the product.tpl file. Make sure that there are no {literal} and {/literal} tags surrounding this code.

Now repeat the first two steps again to see if this works on the recently viewed box.

Hope this works.

Quote:


Could it be related to the fact that I use DSEFU PRO?

Since I don't use DSEFU PRO, I'm not sure if this is affecting this mod or not.
I do know that 01bodyjewellery from post #20 is using CDSEO and I think it's similar and it's not affecting his site.
Or maybe someone that uses DSEFU PRO and installed this mod can let us know if they have it working together.

Good luck.

- MoonDog -

Warwick 01-25-2008 12:41 AM

Re: Recently Viewed Mod
 
Thanks for all your help and efforts, I tried all more than once but simply can't get it to show any recently viewed products. Seems I have to pass this mod :(

sales@webosusa.com 01-25-2008 10:29 AM

Re: Recently Viewed Mod
 
Works great now. Thanks!.

Cya!

Qdox 01-25-2008 02:58 PM

Re: Recently Viewed Mod
 
Nice addition to my collection of mods, Good Work.
For those interested to have it horizontally use this:

1- Add to skin1.css
Quote:


/* Recently Viewed Items */
.recently {text-align:center;background-color:transparent}
.recently img {text-decoration:none;width:80px;height:auto;}
.recently a{text-decoration:none;color:black;}
.box1{float:left;width:25%}
.box2{float:left;width:25%}
.box3{float:left;width:24%}


2- Create the recently_viewed.tpl with this:
Quote:

{capture name=menu}
<div class="recently">
{literal}
<script type="text/javascript">
if (p0){
}
else {var p0=null;
}
var p1=getCookie2("p1");
var p2=getCookie2("p2");
var p3=getCookie2("p3");
var p4=getCookie2("p4");
if (p1){
}
else {document.write("You have no recently viewed items.")
}
if (p1 !=null) {document.write('<div class="box1">'+p1+'</div>')}
if (p2) {document.write('<div class="box2">'+p2+'</div>')}
if (p3) {document.write('<div class="box2">'+p3+'</div>')}
if (p4) {document.write('<div class="box3">'+p4+'</div>')}
if(p0 !=null && p0 != p1 && p0 != p2 && p0 != p3 && p0 !=p4){
setCookie2("p1",p0);
setCookie2("p2",p1);
setCookie2("p3",p2);
setCookie2("p4",p3);
}
</script>
{/literal}
</div>
{/capture}
{include file="dialog.tpl" dingbats="dingbats_categorie.gif" title="Recently Viewed" content=$smarty.capture.menu extra='width="100%"'}



Please note that I used the dialog.tpl instead of the menu.tpl. If you need to use the menu.tpl copy the code from the post#1.
Another I put my javascript functions on common.js, so I had to rename them.

congiothoang 01-26-2008 08:58 AM

Re: Recently Viewed Mod
 
First, I want to say this is a great mod. Unfortunately, I can't get it to work. I thought becuase of XC SEO but when I disable XC SEO, it still not working (Plus, somebody else using the CD SEO and it works fine)

One more thing, I try to view source code of the product page and notice that there is no javascript display (notice that I did check to make sure that I place the code in correct file which is product.tpl )

THis piece of code did not display in the view source code:
{******************* Recently View Mods *********************}
<script type="text/javascript">
prodImage='<img src="{$product.tmbn_url}"/>';
prodName='<{$product.product}>';
var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/>${$product.taxed_price}<br/>');
</script>
{******************* END Recently View Mods *********************}


If you guys can help me out, here is the link to my site:

http://www.loyalgifts.com


Thanks a lot for your help guys!

Warwick 01-26-2008 09:03 AM

Re: Recently Viewed Mod
 
Quote:

First, I want to say this is a great mod. Unfortunately, I can't get it to work. I thought becuase of XC SEO but when I disable XC SEO, it still not working (Plus, somebody else using the CD SEO and it works fine)
Similarity to me (also having trouble getting it to work) is that you have X-Cart Pro as well, maybe that is causing trouble, a long shot but who knows?

MoonDog 01-26-2008 07:30 PM

Re: Recently Viewed Mod
 
congiothoang and Warwick,

I think I found the problem that might be causing anything to display on the Recently View menu box. I was viewing congiothoang's source code to see what might be causing the problem and I noticed that the include recently_viewed file is called before the product.tpl is called. The product.tpl has the javascript code that is required for the recently_viewed to display the recently viewed product. Therefore, nothing is showing up.

So in order for the Recently Viewed mod to work, the menu box has to be located on the right side or at the bottom of the product page like in Qdox post #36. This mod will not work if it's located on the left side with the other menu boxes.

My sincere apology for those who had problems when installing this mod on the left side of their webpage. :oops: Try it on the right side or on the bottom and it should work.

I'll update post #1 to reflect this change.

On another note, I installed XC SEO and it's working perfectly with this mod.

I hope this fixes your problems.


- MoonDog -

pegpub 01-27-2008 09:58 AM

Re: Recently Viewed Mod
 
Moondog,

Any chance of modifying this so it will work in the left column? I have a 2 column layout and would love to have this feature.


All times are GMT -8. The time now is 05:58 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.