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)

sales@webosusa.com 01-27-2008 04:44 PM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by Warwick
Is this working with 4.1.3? I tried it but can't get it to show any recent products ... any ideas?

And is it possible to get the "You have no recently viewed items." multi language as well, I tried to put {$lng.lbl_my_text} in the javascript but I'm sure that's not working.


That happen with me, but because didn't want to work anyways on the left side from home.tpl only above, middle, right, and bottle. Never on left.

MoonDog 01-27-2008 05:24 PM

Re: Recently Viewed Mod
 
pegpub and others,

Quote:


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.

For pegpub and those who have a two column layout or want to place the Recently Viewed mod on the left side, just do the following:

First of all, install the mod as outlined in Post #1 and placing the include recently_viewed.tpl anywhere in the left column in your home.tpl file.

Then create a file by copying the code below and name it recently_viewed_2.tpl and place it in the skin1/customer/main/ folder.
Code:


{literal}
 <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(p0 !=null && p0 != p1 && p0 != p2 && p0 != p3 && p0 !=p4){
  setCookie("p1",p0)
  setCookie("p2",p1)
  setCookie("p3",p2)
  setCookie("p4",p3)
  }
 </script>
{/literal}

And the last step is open the skin1/customer/home.tpl and find:
Code:


{include file="customer/home_main.tpl"}

And after that line place the following code:
Code:


{include file="customer/main/recently_viewed_2.tpl"}

Hopefully that should take care of the left column view problem.

NOTE: This modification is not needed if you place the Recently Viewed mod on the right column or in the middle column.

- MoonDog -

pegpub 01-27-2008 07:09 PM

Re: Recently Viewed Mod
 
Moondog,

Thank you very much. Works like a charm now. :D:D:D

MoonDog 01-27-2008 08:39 PM

Re: Recently Viewed Mod
 
pegpub,

Quote:


Thank you very much. Works like a charm now.

You're welcome. Glad you got it working.

- MoonDog -

congiothoang 01-28-2008 12:00 AM

Re: Recently Viewed Mod
 
Works for me too ( and also with XC SEO installed ).


Thanks a lot for this great mod.

mike_turbo 01-28-2008 03:08 AM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by MoonDog
Hi mike_turbo,


Try this; repace the code you added in product.tpl with the following code:

Code:


<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.price}<br/>');
</script>

It's almost exactly like the code in post #1 except for the code highlited in red.

Let me know if this works for you.


- MoonDog -


Thanks for the update.

This is working fine except i am still getting

nullnullnull under the prices. Still got threads to read through so this may of been fixed :) lets hope so.

MoonDog 01-28-2008 10:05 PM

Re: Recently Viewed Mod
 
congiothoang,

I'm happy to see you got it working.

mike_turbo,
Quote:


This is working fine except i am still getting nullnullnull under the prices.

See if this will work for you.
Find this code in recently_viewed.tpl:
Code:


  if (p1 !=null) {document.write(p1)}
  if (p2) {document.write(p2)}
  if (p3) {document.write(p3)}
  if (p4) {document.write(p4)}

and edit it so it looks like this:
Code:


  if (p1 !=null) {document.write(p1)}
  if (p2 !=null) {document.write(p2)}
  if (p3 !=null) {document.write(p3)}
  if (p4 !=null) {document.write(p4)}

I tried to recreate the null error you are getting so that I can troubleshoot it but I was unable to do so.
Hopefully as a longshot this will help.


- MoonDog -

mike_turbo 01-29-2008 12:07 AM

Re: Recently Viewed Mod
 
hi thanks.

Still not working.

eaglemobiles 01-29-2008 01:42 PM

Re: Recently Viewed Mod
 
Very good MOD THANKS MoonDog,

Every thing working but i am getiing $ sign for price how to change to ё.

Many THANKS

MoonDog 01-29-2008 06:38 PM

Re: Recently Viewed Mod
 
eaglemobiles,

Quote:


... i am getiing $ sign for price how to change to ё

In product.tpl find this line of code:
Code:


var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/>${$product.taxed_price}<br/>');

Then replace the $ sign with the ё sign in front of {product.taxed_price} so it looks like this:
Code:


var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/>ё{$product.taxed_price}<br/>');

I've highlighted the above currency code change in red.

- MoonDog -


All times are GMT -8. The time now is 10:22 PM.

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