X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing and adding new features (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 -

Jerrad 01-31-2008 02:04 AM

Re: Recently Viewed Mod
 
Thanks for sharing this great mod, MoonDog!
I'm using a commercial recently viewed mod, which is working fine, but doesn't remember the recently viewed products when a customer returns to the site.

Any idea if your mod could work with version 4.0.x?
I'm trying to implement it, but only one thumb (with the correct product name and price) is displayed.
Furthermore, it will not always show the last viewed product and after closing and opening the browser I get the message that there are no recently viewed items..

Looks like a cookie issue, as far I can tell... 8O

Any idea how to solve this?
And would it be possible to display more recently viewed products, or is four the limit?

Thanks again! :-)

mike_turbo 01-31-2008 02:35 AM

Re: Recently Viewed Mod
 
The nullnullnull disapears from the list once i view another item :) when i have viewed 4 all of the null goes walkies

RichieRich 02-02-2008 04:14 AM

Re: Recently Viewed Mod
 
why cant this use products.tpl or products_t.tpl and be in the center of the page if required

Freakmode 02-04-2008 06:58 AM

Re: Recently Viewed Mod
 
Hi Moondog

Quick question - We were using this mod for a while on the right hand side and it worked well.

We recently re-added a tabbed product menu (in product.tpl) and now the recently viewed is a bit sparadic on what it shows.

Any ideas how to fix this or should we look at the left hand side menu code (but try and get it to work on the right)

I'm sure its just something silly.

Thanks

RichieRich 02-05-2008 12:26 PM

Re: Recently Viewed Mod
 
is there a reason the product image is used instead of the thumbnail image?

razorblade 02-06-2008 08:10 PM

Re: Recently Viewed Mod
 
this is great, thanks. this mod works in 4.0.16.

thanks for a great mod!!!

Jerrad 02-06-2008 11:19 PM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by razorblade
this is great, thanks. this mod works in 4.0.16.

thanks for a great mod!!!



That's great! Did you just follow the instructions or did you made any changes to the code?

I can't get it working properly in 4.0.12...
Maybe it's the tabbed menu I'm using on the productpage, cause 01bodyjewellery also seems to have problems after re-adding a tabbed menu?

razorblade 02-07-2008 10:03 AM

Re: Recently Viewed Mod
 
i had to change text colors, and i changed the price displayed to be the lowest wholesale price of the item, instead of the full price. i also resized the thumbnail. i dont have the tabbed menus, that may be why it is working well.

Jerrad 02-08-2008 01:50 AM

Re: Recently Viewed Mod
 
Thanks for letting me know, razorblade.
Seems that the tabbed menu is the reason that this mod won't work properly (for me)... :(

ADDISON 02-09-2008 05:37 AM

Re: Recently Viewed Mod
 
Could anyone to pack this mod and make an installation package? If setting up some parameters inside Admin area it will be great. For example the number of products to be shown, to show or not the product image, price

Thanks.

toolexperts 02-12-2008 07:04 AM

Re: Recently Viewed Mod
 
I can see the mod there, but it doesn't show any of my products :(

216.75.30.97

Metal-X-Man 02-14-2008 08:05 AM

Re: Recently Viewed Mod
 
Really great mod Moondog!

I'm having a problem with my thumbnail images show up. I'm getting the default image instead.

Q: Where is this variable generated: "$product.tmbn_url" this in the javascript in the product.tpl

I'm looking for an alternative to get the thumbnail up.

Metal-X

jeanne 02-25-2008 09:11 PM

Re: Recently Viewed Mod
 
For the thumbnail image instead of the larger one use:

prodImage='{include file="product_thumbnail.tpl" productid=$_imageid|default:$product.productid image_x=$product.tmbn_x|default:$config.Appearance .thumbnail_width image_y='100' product=$product.product}';

I also added code to the bottom of products.tpl that shows the categories in the recently viewed list.

<script type="text/javascript">
var p0=('<a href="{$http_location}/home.php?cat={$cat}"><br/><b>{$current_category.category}</b></a><br /><br />');
</script>

Thanks for the code

----

Jeanne
4.1.8
www.jardinediapers.com

wendy.email 02-26-2008 10:01 AM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by Metal-X-Man
Really great mod Moondog!

I'm having a problem with my thumbnail images show up. I'm getting the default image instead.

Q: Where is this variable generated: "$product.tmbn_url" this in the javascript in the product.tpl

I'm looking for an alternative to get the thumbnail up.

Metal-X



me too, any help is appreciated!!

MrSoft 03-01-2008 10:17 AM

Re: Recently Viewed Mod
 
Moondog,

Thanks for the mod. It works great.

Jeanne,

Thanks for the category inclusion.

Do you know how I can show the category image as well?

Cheers,

Colin

813motoring 03-01-2008 06:14 PM

Re: Recently Viewed Mod
 
I just recently put this mod on our x-cart.. i really like the feature.. but I dont know if my computer isnt loading the page all the way or if there is a problem with the code.. but the picture wont show up in the recently viewed box.. you can visit my site at the link below...

www.813motoring.net

813motoring 03-02-2008 04:48 PM

Re: Recently Viewed Mod
 
please someone or moondog help me.. please check out my site.. picture wont show up and im gettin the $ sign.. please help!

MoonDog 03-03-2008 06:34 PM

Re: Recently Viewed Mod
 
Hi 813motoring,

I went to your site and noticed that your using https:// throughout your whole site. I keep getting a 'Securtiy Information' popup box when browsing with IE Explorer. This https:// issue might be causing the problem of your images not showing. Go to this thread http://forum.x-cart.com/showthread.php?t=37614&highlight=secure+image and read carpeperdiem's reply on post #4. Hopefully this might solve your problem.

- MoonDog -

sunset 03-03-2008 07:10 PM

Re: Recently Viewed Mod
 
Thanks heaps for the link to that post moondog...it has fixed a problem that has been bugging me for a long time. Cheers.

813motoring 03-04-2008 04:49 AM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by MoonDog
Hi 813motoring,

I went to your site and noticed that your using https:// throughout your whole site. I keep getting a 'Securtiy Information' popup box when browsing with IE Explorer. This https:// issue might be causing the problem of your images not showing. Go to this thread http://forum.x-cart.com/showthread.php?t=37614&highlight=secure+image and read carpeperdiem's reply on post #4. Hopefully this might solve your problem.

- MoonDog -



thanks moondog.. i will try it out.. i guess there is settings on x-cart for this? would i just change them around to the right ones and hope it works then? I will def. let you know how it works out thanks again

MrSoft 03-04-2008 02:02 PM

Re: Recently Viewed Mod
 
I am having the same problem with nullnullnull, you can see an example here www.tilehq.co.uk

I would appreciate any help.

Thanks,

Colin

813motoring 03-04-2008 05:05 PM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by MoonDog
Hi 813motoring,

I went to your site and noticed that your using https:// throughout your whole site. I keep getting a 'Securtiy Information' popup box when browsing with IE Explorer. This https:// issue might be causing the problem of your images not showing. Go to this thread http://forum.x-cart.com/showthread.php?t=37614&highlight=secure+image and read carpeperdiem's reply on post #4. Hopefully this might solve your problem.

- MoonDog -


Hey moondog.. soo i changed the things that carpeperdiem stated in that thread... which was...

Use HTTPS for users' login and registration: CHECKED
Use secure login form on a separate page (HTTPS): UN-CHECKED
Do not redirect customers from HTTPS to HTTP: UN-CHECKED

that is what you were tellin me to do right? anyways i changed it to exactly what he put and i still am not gettin the pictures to show up? Let me know what your next thoughts are..

MoonDog 03-04-2008 09:14 PM

Re: Recently Viewed Mod
 
813motoring,

The only other thing that I can think of as to why the images are not showing up is the fact that you are pulling your images from the database instead of from the filesystem. Since I don't store my images on the database I'm not really sure as to what code to use to display the images. You might have to search the forums to find out how to accomplish this or maybe someone who has installed this mod using images from the database can post an answer here.

- MoonDog -

jeanne 03-05-2008 02:57 PM

Re: Recently Viewed Mod
 
MrSoft,
I don't use category images but you could try
prodImage='{<img src="{if $current_category.icon_url}{$current_category.icon _url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="{$current_category.name}" style="float: left"/>}';

You would have to add the
'+prodImage+'
back in to the
var p0=('<a href="{$http_location}/home.php?cat={$cat}"><br/><b>{$current_category.category}</b></a><br /><br />');

Like this
var p0=('<a href="{$http_location}/home.php?cat={$cat}">'+prodImage+'<br/><b>{$current_category.category}</b></a><br /><br />');

You also have two </head> 's on your pages.

edited to add:
I forgot about the page views when you select a manufacturer so I changed what I added to the bottom of products.tpl I also decided to use the location information so that my subcategories made more sense. I'm not using the image for this and I use a different page for the search results. You would have to change this is you wanted to include recently viewed search results.

{if $cat le '0'}
<script type="text/javascript">
var p0=('<a href="{$http_location}/manufacturers.php?manufacturerid={$manufacturer.ma nufacturerid}"><br/><b>{section name=position loop=$location step=-1}{$location[position].0|escape}{if not %position.last%} - {/if}{/section}</b></a><br /><br />');
</script>
{else}
<script type="text/javascript">
var p0=('<a href="{$http_location}/home.php?cat={$cat}"><br/><b>{section name=position loop=$location step=-1}{$location[position].0|escape}{if not %position.last%} - {/if}{/section}</b></a><br /><br />');
</script>
{/if}

MoonDog 03-05-2008 08:41 PM

Re: Recently Viewed Mod
 
813motoring,

OK, let's try this. For those of you that have your images located in the database instead of the filesystem and your images are not showing up, do the following:

In customer/main/product.tpl find the code that you placed there:

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


and replace it with the following code:

Code:


<script type="text/javascript">
prodImage='{include file="product_thumbnail.tpl" productid=$product.productid image_x=80 image_y=0 product=$product.product tmbn_url=$product.tmbn_url id="product_thumbnail" type="P"}';
prodName='<{$product.product}>';
var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/>${$product.taxed_price}<br/>');
</script>


Then find the following code you placed in skin1.css:

Code:


.recently {text-align:center;}
.recently img {text-decoration:none;width:80px;height:auto;}
.recently a{text-decoration:none;color:black;}


and comment out or delete the line midlle line, so it looks like this:

Code:


.recently {text-align:center;}
.recently a{text-decoration:none;color:black;}


Hopefully that should take care of the problem.
Also make sure you clear your cache or use your refresh button if the images look distorted.

- MoonDog -

tam10 03-29-2008 06:19 AM

Re: Recently Viewed Mod
 
Hi,

Great mod. Thanks so much. Works great!!

For some reason the header apperas twice on my site: recently viewed x2 you can see it here: www.4-legged.com
couldn't figure out what i did wrong.
Another thing , where can i change the color of the header caption to white, as all my headers are in White.

Thanks again
Tammy

MoonDog 03-29-2008 09:39 AM

Re: Recently Viewed Mod
 
Hi Tammy,

It think you may be using another menu.tpl file.

Find the last line of code in customer/main/recently_viewed.tpl :

Code:

{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Recently Viewed" menu_content=$smarty.capture.menu}

And change it to this:

Code:

{include file="NameOfMenuFileYourUsing.tpl" menu_title="Recently Viewed" menu_content=$smarty.capture.menu}

Just replace the blue file name above with the name of the file that you are using for the other menu boxes.

Hope that works.

- MoonDog -

tam10 03-29-2008 01:17 PM

Re: Recently Viewed Mod
 
Thanks MoonDog for your reply.
As far as I know i'm using the same menu.tpl as all , But to be on the safe side, i'll check it again with the guy who did some adjustment to the site.

Thanks O:)

Tammy

MoonDog 03-29-2008 02:27 PM

Re: Recently Viewed Mod
 
Tammy,

One way to find out to see what .tpl file your using is to open the skin1/customer/categories.tpl file and look at the very last line of code.

it should start like this: {include file="?????.tpl

The question marks is the name of your menu file.

Or just copy the last line of the skin1/customer/categories.tpl file and copy it over the last line of code of the customer/main/recently_viewed.tpl
And then edit 'menu_title' of that line to say: menu_title="Recently Viewed"

Hope that helps,

- MoonDog -

tam10 03-29-2008 02:58 PM

Re: Recently Viewed Mod
 
MoonDog,


I tried to replace menu_title="Recently_viewed"
it's not working.
I am sure you understand much more them i do, so here is the cods

Here is the skin1/customer/categories.tpl:

{/capture}
{include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title="Recently Viewed" menu_content=$smarty.capture.menu}

Here is your cod:

{/capture}
{ include file="menu.tpl" dingbats="dingbats_a.gif "
menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


All times are GMT -8. The time now is 07:00 PM.

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