Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Bookmark this page - how to?

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 07-24-2008, 12:11 PM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Bookmark this page - how to?

I've been reading that offering a reminder to bookmark can boost repeat shopping, but I'm having a hard time getting this code to work with smarty

I've found a fairly clean code that looks like this:

<script>
function bookmark(title,url){
if(window.sidebar)
window.sidebar.addPanel(title,url,■");
else if(window.opera && window.print){
var elem = document.createElement(▓a');
elem.setAttribute(▓href▓,url);
elem.setAttribute(▓title▓,title);
elem.setAttribute(▓rel▓,▓sidebar▓);
elem.click();
}
else if(window.external)
window.external.AddFavorite(url,title);
}
</script>




And to call it on a page you use this:



<a href=■javascript:bookmark(▓Henrie Media Inc.▓,▓http://www.henriemedia/▓);■>Bookmark this page</a>

But x-cart is giving a bunch of problems, for one its taking me to a 404-not found page (which may or may not be my SEO module interfering.)



Has anyone successfully implemented this on their site?
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #2  
Old 07-25-2008, 09:25 AM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Bookmark this page - how to?

Are you just adding the entire <script> to a Smarty template such as welcome.tpl?

If so, you will probably need to add {literal} tags, so you can escape the "{" and "}" characters when added to a Smarty template.

See this Smarty reference page for more details:
http://www.smarty.net/manual/en/language.function.literal.php

If you haven't already done so, you might want to try putting the entire <script> in an external Javascript file and reference it on the pages you want the bookmark feature to be available.

Also, test it out in different web browsers to see if you are having the same success/failure in each of the main browsers.

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #3  
Old 07-25-2008, 09:40 AM
  tqualizerman's Avatar 
tqualizerman tqualizerman is offline
 

X-Adept
  
Join Date: Jun 2008
Posts: 392
 

Default Re: Bookmark this page - how to?

I actually put the <script> section into common.js

then attempted to use the href call on product.tpl along with the product name and URL smarty tags so that the bookmark option would be dynamically generated.

But this only produce a 404 not found, which leads me to think that the actual script is tripping up somewhere.
__________________
- www.nerdseven.com - Gadgets & Gizmos from Out of This World
- Sound Sensitive T-Shirts That Flash to the Beat of Music (http://www.tqualizer.com)


X-Cart Version 4.1.10
Reply With Quote
  #4  
Old 07-26-2008, 06:43 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default Re: Bookmark this page - how to?

Why don't you try "add bookmark" service of http://www.addthis.com/ .
It's FREE & you can track how many people have bookmarked which pages also.

Also it's very easy to inegrate with x-cart.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 07:15 AM.

   

 
X-Cart forums © 2001-2020