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-23-2008 03:22 PM

Re: Recently Viewed Mod
 
I manage put together. This is for who use tables as well.

The code below
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>
==================================================

But before right after the last DIV tag before the {/if} that you made for the tables like below
Code:

==================================================
....
 
 <div class="tabber" id="mytabber">
 {if $active_modules.Magnifier ne "" && ($config.Magnifier.magnifier_image_popup ne 'Y' || $js_enabled ne 'Y')}
 <div class="tabbertab">
 <h2>Product Magnifier</h2>
 {include file="modules/Magnifier/product_magnifier.tpl" productid=$product.productid}
 </div>
 {/if}
 {if $config.Appearance.send_to_friend_enabled eq 'Y'}
 <div class="tabbertab">
 <h2>{$lng.lbl_send_to_friend}</h2>
 {include file="customer/main/send_to_friend.tpl" }
 </div>
 {/if}
 {if $active_modules.Detailed_Product_Images ne "" && ($config.Detailed_Product_Images.det_image_popup ne 'Y' || $js_enabled ne 'Y')}
 <div class="tabbertab">
 <h2>{$lng.lbl_detailed_images}</h2>
 {include file="modules/Detailed_Product_Images/product_images.tpl" }</div>
 {/if}
 
 <div class="tabbertab" id="description">
 <h2>{$lng.lbl_full_description}</h2>
 {include file="customer/main/full_description.tpl"}</div>
 
 <div class="tabbertab">
 <h2>{$lng.lbl_more_tabs}</h2>
 <div class="tabber" id="mytabber">
 {if $active_modules.Recommended_Products ne ""}
 <div class="tabbertab tabbertabdefault">
 <h2>{$lng.module_name_Recommended_Products}</h2>
 {include file="modules/Recommended_Products/recommends.tpl" }</div>
 {/if}
 {if $active_modules.Customer_Reviews ne ""}
 <div class="tabbertab tabbertabdefault">
 <h2>{$lng.lbl_customer_reviews}</h2>
 {include file="modules/Customer_Reviews/vote_reviews.tpl" }</div>
 {/if}
 <div class="tabbertab">
 <h2>{$lng.lbl_more_tabs}</h2>
 <div class="tabber" id="mytabber">
 
 {if $active_modules.Upselling_Products ne ""}
 <div class="tabbertab">
 <h2>{$lng.lbl_related_products}</h2>
 {include file="modules/Upselling_Products/related_products.tpl" }{include file="customer/pricematch.tpl"}</div>
 
 {/if}</div></div></div>
  </div>
 
  <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>

{/if}
 
 {if $active_modules.Product_Options ne '' && $product_options ne '' && ($product.product_type ne "C" || !$active_modules.Product_Configurator)}
 <script type="text/javascript" language="JavaScript 1.2">
 <!--
 check_options();
 -->
 </script>
 
 {/if}

==================================================


Thanks for this MOD. Greats! Cya!

Warwick 01-23-2008 03:52 PM

Re: Recently Viewed Mod
 
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.

sales@webosusa.com 01-23-2008 04:32 PM

Re: Recently Viewed Mod
 
Try without the " " symbol.

Code:

  else {document.write({$lng.lbl_my_text})
or like this
Code:


  else {document.write($lng.lbl_my_text)


I cannot try anymore because always show my latest viewed and i had the idea after.

How can i "kill" the last views? so i can tast this?

Cya!

sales@webosusa.com 01-23-2008 05:57 PM

Re: Recently Viewed Mod
 
Question? On Internet Explorer 7 over does not show the Recently Viewed Products

Any ideas?


Cya!

Warwick 01-23-2008 10:06 PM

Re: Recently Viewed Mod
 
Quote:

Originally Posted by sales@webosusa.com
Try without the " " symbol.

Code:

  else {document.write({$lng.lbl_my_text})
or like this
Code:


  else {document.write($lng.lbl_my_text)




Thanks, did try that but both don't work, probably while it is in a javascript piece of code?

MoonDog 01-23-2008 10:14 PM

Re: Recently Viewed Mod
 
Warwick & sales@webosusa.com

Quote:

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.
Try this:

Place the following code in your skin1/customer/home.tpl file between the <head> and </head> tags:
Code:


<script type="text/javascript">
var myText="{$lng.lbl_my_text}";
</script>

Of course instead of {$lng.lbl_my_text}, you need to create your own language variable in the admin side.


Then open skin1/customer/main/recently_viewed.tpl and edit the following line:

From this...
Code:

  else {document.write("You have no recently viewed items.")
To this:
Code:

  else {document.write(myText)

- MoonDog -

MoonDog 01-23-2008 10:45 PM

Re: Recently Viewed Mod
 
For those of you who are unable to see your recently viewed items, make sure that you have enabled your cookie settings in your browser.

In Firefox it's located in the top menu bar Tools>Options...>Privacy tab and just enable 'Accept cookies from sites' and then select one of the three selections in the dropdown box.

In Internet Explorer it's at the top menu bar Tools>Internet Options...>Privacy tab and then just adjust the slider to medium.

--------------------------------------------------

For those who want to clear their recently viewed items, just delete the cookies from your browser.

In Internet Explorer go to the top menu bar Tools>Internet Options> and click on the 'Delete Cookies' button. You might have to close your browser and re-open it.

In Firefox go to the top menu bar Tools>Options>Privacy tab and then select from the downdown box by 'Keep until:' to 'I close Firefox'. Then close your browser and re-open it.

Hope this helps.

- MoonDog -

Warwick 01-23-2008 10:48 PM

Re: Recently Viewed Mod
 
Thanks MoonDog, it isn't working yet but I'm getting there I feel.

Now it literally shows:
{$lng.lbl_my_text}

I tried removing the " around them but no good.

p.s. I have my cookies enabled but no recent products appear :(

MoonDog 01-24-2008 06:53 PM

Re: Recently Viewed Mod
 
Warwick,
Quote:

Now it literally shows:
{$lng.lbl_my_text}

The most likely cause for this problem is that you have the javascript code enclosed in {literal} and {/literal} tags. Make sure that you are not enclosing it with these tags.

The same goes for the javascript code in the product.tpl file. Don't use the literal tags for the javascript code you placed there. You will not receive any javascript errors by not using them.

You will need the {literal} and {/literal} tags for the other javascript code as was posted in post #1.

Good luck.

- MoonDog -

Warwick 01-24-2008 10:54 PM

Re: Recently Viewed Mod
 
That did it, thanks! :)

Now only if it would show recently viewed products, javascript is enabled, have to investigate some more :(


All times are GMT -8. The time now is 08:20 PM.

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