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)

tam10 03-29-2008 03:01 PM

Re: Recently Viewed Mod
 
Ok
I replaced dingbats_categorie.gif with dingbats_a.gif, now it's ok.
Now i need to change the color of the words to White. How should i do that?

Tammy

MoonDog 03-29-2008 04:10 PM

Re: Recently Viewed Mod
 
Hi Tammy,

Looks like you have a customized menu that is only using labels for the title.

So the first thing you have to do is a create a language label in the admin side and name it lbl_recently_viewed and just place the text 'Recently Viewed' in there.

Then change the last line of code in customer/main/recently_viewed.tpl so it reads like this:

Code:

{include file="menu.tpl" dingbats="dingbats_a.gif" menu_title=$lng.lbl_recently_viewed menu_content=$smarty.capture.menu}

That should work, but if it doesn't, then post your menu.tpl and I'll see how to get this working for you.

- MoonDog -

tam10 03-29-2008 04:31 PM

Re: Recently Viewed Mod
 
Thanks MoonDog. It's perfect !!

You've been so helpful and I've learned from you so much today.
I wish i knew as much as you know css etc...

Thank you,

Tammy

MoonDog 03-29-2008 04:49 PM

Re: Recently Viewed Mod
 
Tammy,

Thank you for the kind words. I'm glad you got it working.

- MoonDog -

ShishaPipeUK 04-08-2008 02:24 PM

Re: Recently Viewed Mod
 
MoonDog, great mod and i am using this mod on x-cart 4.1.3 and does work ok, but when i look at details on another product and then say go back to home, only the recent product shows. I can not get any more than one product showing at a time, even if i view 10 products, i only just show the last product viewed.

I have followed your code 100%, just changed the bit at the botom of the skin1/main/product.tpl file which is:

Code:

<script type="text/javascript">
prodImage='{include file="product_thumbnail.tpl" productid=$product.productid image_x=$product.tmbn_x|default:$config.Appearance.thumbnail_width image_y=$product.tmbn_y product=$product.product tmbn_url=$product.tmbn_url alt=$product.fulldescr|replace:"":"" id="product_thumbnail" type="P"}';
prodName='<{$product.product}>';
var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/><a href="{$http_location}/home.php?cat={$cat}"><b>{$current_category.category}</b></a><br/>ё{$product.taxed_price}<br/>');
</script>


The extra code is to use my default x and y thumbnail settings in the admin section and to also give a full description of the product when you place your mouse over the image.

Anyway back to the problem, i think that some how its resetting its cookies, every time i look at another detail description, the box is then blank (nothing written or no picture) then go to another product and then the last item i looked at is shown and so on. So i only see one product only not 4 products no matter how many times i go to other detail descriptions, only the last one shows.

Any ideas please ?

Oh you can find this at http://www.theshisha.com/shopcart/home.php and try this for yourself and see what i mean.

The recent view box is to the right and under the product review box.

Mee 04-25-2008 12:39 AM

Re: Recently Viewed Mod
 
Thanks MoonDOg.
It's great.

Brow 04-28-2008 12:31 PM

Re: Recently Viewed Mod
 
Very nice. I have been looking for something like this. :)

ecommerce 04-29-2008 05:44 PM

Re: Recently Viewed Mod
 
um MoonDog, you're an animal dude! Awesome mod.

3 cool requests that add value to this mod:

1. How do I use language labels instead of hardcoding the "Recently view" ?
Where? and How?

2. Instead of an empty Recently View box, NOT show it at all until there's been some products view. "if products have been viewed, show "Recently View" box, else, dont show it yet". How do I do that?

3. ONLY show the "recently view" box...in the product details pages.
That way I dont have the box everywhere on the site.

MrSoft 05-06-2008 04:29 AM

Re: Recently Viewed Mod
 
I am having a little trouble with this mod, instead of "ё" I get "О©╫".

You can see the problem here www.tilehq.co.uk

Any ideas how to fix?

Thanks,

Colin

Mee 05-06-2008 08:21 AM

Re: Recently Viewed Mod
 
My customer wants to have more than 4. He wants show 2 items and make up, down button to see others to scrool.

Does anyone can help me?
I tryed but I can't.

Help me please.

Thank you all your help.

Freakmode 05-19-2008 11:51 AM

Re: Recently Viewed Mod
 
Hi Moondog

Is there a secret to getting this to work with Telafirma Dynamic images?

I show no thumbnails for some reason

chealyte 05-21-2008 01:06 AM

Re: Recently Viewed Mod
 
This part some how it is still use " products image " to show in list. How to make it use " Thumbnail " picture ?? some how many i try it still pink to product images and resize it .. which seem this quick fix wont work well it will slow down the loading time .. cuz of lage images.

Example : .. the image show in recently viewed follow by this kind of url " http://tinybeeonline.com/images/P/SCAN0018.jpg " .. i think it should show as " http://tinybeeonline.com/images/T/SCAN0018.jpg " .. i am not sure what to change to make this happen i try a lot of way still not work .. i change the type="P" to type="T" still not work ..

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>


Reguarding my post .. i just edite to add some info to it ..

I think i figure out why it does not show " Thumbnail " because the script that wrote cookies is on products.tpl .. i think it should be move to products list ( such as recomand products , products list when we click on catagories , related products .. ) those are show Thumbnail and we can get link from it post in cookies and display it out .. i am not sure how to this .. also we should do some check .. see if the products we view now already add to recent view cookies or not if not add new one else do not add ..

Cyber Matrix 05-21-2008 05:25 PM

Re: Recently Viewed Mod
 
Is there a way to call the head js instead of showing all this in the header? I have tried a few things and it does not seem to work.
Code:

{literal}
<script type="text/javascript">
 function setCookie(name, value) {
 var today = new Date()
 var expires = new Date()
 expires.setTime(today.getTime() + 1000*60*60*24*30)
 document.cookie = name + "=" + escape(value) + "; expires=" + expires.toGMTString() +";path=/"
}
 function getCookie(Name) {
 var search = Name + "="
 if(document.cookie.length > 0) {
 offset = document.cookie.indexOf(search)
 if(offset != -1) {
 offset += search.length
 end = document.cookie.indexOf(";", offset)
 if(end == -1) end = document.cookie.length
 return unescape(document.cookie.substring(offset, end))}
 else return ""
 }
}
</script>
{/literal}


peterstagg 06-23-2008 01:49 PM

Re: Recently Viewed Mod
 
Hey Moondog
This is a really nice mod.
Thanks heaps!
It fits nicely with what I want and works smoothly.

I have a tabbed product menu and modified the menu and dialog templates and it does not seem to cause any problems. Are people still having those issues?

I also seemed to get it to work left side without any modifications that you suggested in #42, have you modified the code recently?

Cheers
peter

neaisha 06-26-2008 04:48 PM

Re: Recently Viewed Mod
 
i like this mod too and kudos to the person who developed it. i'm having an issue with the size of the images.

i had previously edited product_thumbnail_cust.tpl so that all of my thumbnail images would be a specific height.

with this mod, sometimes the images display correctly in the left column. other times, it displays the full size image...but it's random. any ideas as to why? i encounter it primarily in IE7.

Cyber Matrix 06-27-2008 04:27 AM

Re: Recently Viewed Mod
 
I believe the size changes are in the css file. Looking back at this thread it shows to put this in you css
Code:

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


See the 2nd line change the size there.

neaisha 06-27-2008 04:31 AM

Re: Recently Viewed Mod
 
yep...i was missing a ; in the skin. thanks

neaisha 07-10-2008 11:28 AM

Re: Recently Viewed Mod
 
my thumbnails aren't displaying securely. anyone know how to make sure the images show in https so that when a customer is logged in they wont get the security warning?

thefizix 07-12-2008 12:01 PM

Re: Recently Viewed Mod
 
MoonDog,

I added everything you said and I still cant get it to work on my site. I am running version 4.1.9. My site is www.thefizix.com/store. thanks

neaisha 07-16-2008 10:25 AM

Re: Recently Viewed Mod
 
anyone figure out how to secure the images yet?

peterstagg 07-16-2008 12:45 PM

Re: Recently Viewed Mod
 
Neaisha

It goes in the script that you have to put in the product.tpl file


<script type="text/javascript">
prodImage='{include file="product_thumbnail.tpl" productid=$product.productid image_x=25 product=$product.product type="P" tmbn_url=$product.tmbn_url id="product_thumbnail" }';

prodName='<{$product.product}>';
var p0=('<table><tr><td align = left><a href="'+document.URL+'">'+prodImage+'</a></td><td width = 100%><b><a href="'+document.URL+'">{$product.product}</b></a><br/>ё{$product.taxed_price}</td></tr></table>');
</script>

you set the image_x to the size you want.

see my dev site to view the 25px size images I use

peter

neaisha 07-16-2008 03:23 PM

Re: Recently Viewed Mod
 
hey peterstagg,

no, i wanted to know how to secure the images. right now in IE7, this code displays the images in http vs https. i wanted to know if there's a way to may sure they're displayed securely?

neaisha 07-16-2008 03:49 PM

Re: Recently Viewed Mod
 
took me forever to figure out where i was getting the security message but it's on this page...

https://www.mysite.com/xcart/cart.php?mode=checkout

the thumbnails are the only images in http not https and you get the popup in IE as a result.

i think it has to do with the cookie. given that the images are initially viewed in http mode, they are therefore going to display insecurely. is there anyway to fix this?

hmm...so in the code this is how the thumbnail is being called - prodImage='<img src="{$product.tmbn_url}"/>'; is there any way to make sure that the image is either always secure OR use if/then statements?

William Lam 08-06-2008 03:59 AM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by neaisha
took me forever to figure out where i was getting the security message but it's on this page...

https://www.mysite.com/xcart/cart.php?mode=checkout

the thumbnails are the only images in http not https and you get the popup in IE as a result.

i think it has to do with the cookie. given that the images are initially viewed in http mode, they are therefore going to display insecurely. is there anyway to fix this?

hmm...so in the code this is how the thumbnail is being called - prodImage='<img src="{$product.tmbn_url}"/>'; is there any way to make sure that the image is either always secure OR use if/then statements?


Neaisha,

Have you figured this one out yet, im dying to know how to resolve this.

neaisha 08-06-2008 01:30 PM

Re: Recently Viewed Mod
 
unfortunately nope. i love the mod but this could be one of those things that sorta makes me want to remove it b/c it could impact sales.

neaisha 08-19-2008 08:09 AM

Re: Recently Viewed Mod
 
jeanne

suggested the following code but it omits the images

Code:

{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}


i was wondering if you could use something similar to this for the images but specify https_location?

ianfranklin 08-24-2008 09:54 PM

Re: Recently Viewed Mod
 
Is there a way I can call the thumbnail image instead of the product image? I don't want to have it re-size the images because they look grainy, especially in IE.

gotpump 09-23-2008 08:35 PM

Re: Recently Viewed Mod
 
The only issue I'm having is when there is only 1 picture displayed. Below that pictures price it displays:

undefinedundefinedundefined.

Any suggestions?
Did I miss Something?

neaisha 10-20-2008 08:27 AM

Re: Recently Viewed Mod
 
ok, i'm still having the security warning in IE. i tried this code...

Code:

{if $current_location eq $http_location}
{include file="customer/main/recently_viewed.tpl"}
{else}&nbsp;{/if}


Janel 10-29-2008 05:43 AM

Re: Recently Viewed Mod
 
grrrr.... I had this working perfectly before I installed newest version of xcart and now when I go to implement this mod I can't get my images to appear.

Any ideas? I do store them in file system and not database like I see mentioned earlier as a possible problem.

Janel 10-30-2008 05:43 AM

Re: Recently Viewed Mod
 
anyone have any ideas on my previous post? :(

my site: http://www.blueowlstudio.com/shop/home.php

xcel 12-11-2008 08:32 AM

Re: Recently Viewed Mod
 
moondog...

thanks for the mod. got it work on the first try. your instructions were perfectly detailed. i did notice as i was testing this, that so far 1 image that is now displayed in the r.v. box, is NOT the thumbnail like the others. is there are way to put image resizing in this mod? or least have it actually pull the thumbnail?

not sure why that one particular image is pulling the 'product image' and not the 'thumbnail'.

anywho, thanks again for the mod. take care.

donavichi 01-06-2009 02:55 PM

Re: Recently Viewed Mod
 
4.2 users will need to alter the product.tpl file to this:

Code:

<script type="text/javascript">
prodImage='<img src="{$product.image_url}"/>';
prodName='<{$product.product}>';
var p0=('<br/><a href="'+document.URL+'">'+prodImage+'<br/>{$product.product}</a><br/>ё{$product.taxed_price}<br/>');
</script>


to show images in the list, and alter recently_viewed.tpl to this:

Code:

{capture name=menu}
<div class="recently">
{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 (p1){
  }
  else {document.write("You have no recently viewed items.")
  }
  if (p1 !=null) {document.write(p1)}
  if (p2) {document.write(p2)}
  if (p3) {document.write(p3)}
  if (p4) {document.write(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}
</div>
{/capture}
{include file="customer/menu_dialog.tpl" title="Recently Viewed" content=$smarty.capture.menu}


to get the 'menu' to display in home.tpl

donavichi 01-06-2009 03:38 PM

Re: Recently Viewed Mod
 
I am also getting the same problem, previously mentioned a few times and currently with no solution, if anyone could be so bold as to provide the solution:

currently if no recently viewed products, you get 'you have no recent...' as intended.
if you have 1 recently viewed product, the mod works - shows the thumb, title and price of the recently viewed product, but retruns 'undefinedundefinedundefined' underneath.
if you have 2 recently viewed products, you get 'undefinedundefined' underneath.
if you have 3 recently viewed products, you get 'undefined' underneath.
if you have 4 recently viewed products, you get nothing underneath.

this has been referred to as nullnullnull, nullnull and null in previous posts.

anyone got the definitive answer please?

Learner 01-24-2009 12:04 AM

Re: Recently Viewed Mod
 
Hi,

Anyone or anybody answer me, is it test on X-Cart Pro 4.1.9 & X-Cart Pro 4.1.11 ?

Any help/inputs on this would be highly appreciated.


Thanks to all.

Learner 04-11-2009 12:15 AM

Re: Recently Viewed Mod
 
Hi MoonDog,
Thanks for this codes.Now It works fine for me.

1)But instead of an empty Recently View box, NOT show it at all until there's been some products view. "if products have been viewed, show "Recently View" box, else, don't show it yet".
2) Is it possible to display in central area after featured products on home page horizontally( Minimum 3 in a row)?

How do I do that?

Can anyone help me?

Thanks to all again.

TanyaG 04-27-2009 07:23 AM

Re: Recently Viewed Mod
 
Brilliant mode, thanks a lot for sharing. One thing I need to change. How can I hide recently_viewed.tpl if its no recently viewed product available?

Did anybody test it in IE 6?

Many thanks

royng 07-03-2009 04:43 PM

Re: Recently Viewed Mod
 
Moondog, you are awesome,

I am not a programmer and I am modifying 4.1.11.

My boss making me modify his xcart.

If I mess this up, he will kill me.

So, I just need to follow the code that you provide on post #1 and it should be working right?

customer/home.tpl

add these two lines of code in home.tpl

Add the following code to the end of your customer/main/product.tpl

Create a customer/main/recently_viewed.tpl file by using the following code:

And finally, add the following code to the end of your skin1.css file:

Also you mention, the file "news.tpl", is that for new product? I love to have it on the site too.

By any chance do you know how to add
"Let Customer choose number of products displayed on page"
I read the forum, and still not getting it.

http://forum.x-cart.com/showthread.php?t=38695&highlight=view+all

I want to add "<pres/ 1 2 3 4 / next> view all" and a drop down

Products
10
20
30
40
50
All

Please please please help me!

Thanks in advance. You can email me at royng2003@yahoo.com

Roy

Learner 07-07-2009 04:48 AM

Re: Recently Viewed Mod
 
Is it possible to display in central area after featured products on home page horizontally( Minimum 3 in a row)?

Any help from forum!!! Can anyone help me?

Thanks to all.

royng 07-07-2009 09:57 AM

Re: Recently Viewed Mod
 
I added, but the thumbnails not show.

How come?


All times are GMT -8. The time now is 10:09 AM.

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