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

Flexslider X-Cart 4.4.5 Intergration

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-31-2012, 02:05 PM
 
VWD VWD is offline
 

Member
  
Join Date: Oct 2004
Location: Sweden
Posts: 25
 

Question Flexslider X-Cart 4.4.5 Intergration

Hello everyone, I╢ve been trying to get Flexslider to work in X-CART 4.4.5, but thus far it╢s not working.
Works great otherwise, but I╢m having problems getting it to run in X-CART.
Has anyone done this successfully and if so do you have a tutorial or tips you could share ?

Thanks
__________________
X-Cart Version: 4.4.5 GOLD
Reply With Quote
  #2  
Old 06-01-2012, 05:25 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

I implemented the Flexslider successfully. What sort of problems are you having with it?

A common mistake is to include jquery twice. I see this line:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>

But X-cart already has Jquery included.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #3  
Old 06-01-2012, 07:16 AM
 
VWD VWD is offline
 

Member
  
Join Date: Oct 2004
Location: Sweden
Posts: 25
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

Hello Mike, thanks for responding. That could be what's causing it, I will remove that line, test again and let you know if I get it working.
__________________
X-Cart Version: 4.4.5 GOLD
Reply With Quote
  #4  
Old 06-01-2012, 10:01 AM
 
VWD VWD is offline
 

Member
  
Join Date: Oct 2004
Location: Sweden
Posts: 25
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

Hello Mike, I tried removing it, but no luck.
Added the following code to <head> in home.tpl
<link rel="stylesheet" type="text/css" href="{$AltSkinDir}/custom/css/flexslider.css" />
<script src="{$AltSkinDir}/custom/js/jquery.flexslider-min.js"></script>.
Also added and removed the load function script:
<script type="text/javascript" charset="utf-8">
$(window).load(function() {
$('.flexslider').flexslider();
});
</script>

Added the following to welcome.tpl:
<div class="flexslider">
<ul class="slides">
<li>
<img src="{$AltImagesDir}/custom/pic1.jpg" alt="" title=""/>
</li>
<li>
<img src="{$AltImagesDir}/custom/pic2.jpg" alt="" title=""/>
</li>
<li>
<img src="{$AltImagesDir}/custom/pic3.jpg" alt="" title=""/>
</li>
</ul>
</div>
Pictures and css loading but not the flexslider.js as far as I can see. I╢m probably missing something obvious, any ideas..
Thanks
__________________
X-Cart Version: 4.4.5 GOLD
Reply With Quote
  #5  
Old 06-01-2012, 11:08 AM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

Also check that anywhere you have added javascript to a template (.tpl file), that you enclose it within {literal} {/literal} tags. Smarty and javascript share characters in their syntax, and you do do not want smarty to interpret the javascript characters. The literal tags tell smarty to ignore the javascript.

---
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #6  
Old 06-01-2012, 01:19 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

Quote:
Originally Posted by gb2world
Also check that anywhere you have added javascript to a template (.tpl file), that you enclose it within {literal} {/literal}
That is probably what is wrong now.

This bit:
PHP Code:
<script type="text/javascript" charset="utf-8">
  $(
window).load(function() {
    $(
'.flexslider').flexslider();
  });
< /
script
Should be:
PHP Code:
<script type="text/javascript" charset="utf-8">
  {
literal}
$(
window).load(function() {
    $(
'.flexslider').flexslider();
  });
{/
literal}
< /
script
The problem is that Smarty uses those same delimiters { and }, see those in the JavaScript?

Another way to escape those is to use {$ldelim} for "{" and {$rdelim} for "}".
Like this:
PHP Code:
<script type="text/javascript" charset="utf-8">
  $(
window).load(function() {$ldelim}
    $(
'.flexslider').flexslider();
{
$rdelim});
< /
script
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
VWD (06-09-2012)
  #7  
Old 06-09-2012, 03:46 AM
 
VWD VWD is offline
 

Member
  
Join Date: Oct 2004
Location: Sweden
Posts: 25
 

Default Re: Flexslider X-Cart 4.4.5 Intergration

Thanks Mike, I have not got it working in X-Cart yet, got it working in Drupal though. Will continue, sooner or later I╢m sure I╢ll find out what╢s wrong.
__________________
X-Cart Version: 4.4.5 GOLD
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 11:17 PM.

   

 
X-Cart forums © 2001-2020