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

Remove or update Jquery

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 04-21-2015, 07:57 AM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default Remove or update Jquery

In the common/js folder is jquery.min.js v 1.11.0.

I am implementing some jquery that requires 1.11.2 and there is a conflict. Is there a way to remove the older version or update it?
__________________
X-cart v 5.2
Reply With Quote
  #2  
Old 04-21-2015, 08:05 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Remove or update Jquery

replace the call for jQuery in skin/your_skin/customer/service_js.tpl with the one you want - probably best to just insert jQuery from Google
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 04-21-2015, 08:10 AM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default Re: Remove or update Jquery

When I add a call for the correct jquery in my module (which loads fine), the old version still loads in there.
__________________
X-cart v 5.2
Reply With Quote
  #4  
Old 04-21-2015, 08:13 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Remove or update Jquery

See my post above - the keyword is "replace"
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 04-21-2015, 08:14 AM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default Re: Remove or update Jquery

Oh, well how do I do that?
__________________
X-cart v 5.2
Reply With Quote
  #6  
Old 04-21-2015, 08:26 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Remove or update Jquery

Oh sorry this is for XC5 - I didn't see it. What I said is for XC4.

For XC5 you will need to do the replacement in your module - basically read the js files, loops through them, unset the old and set the new jQuery file. If you just replace the files next update may restore it
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #7  
Old 04-21-2015, 08:32 AM
 
bob@n-flatables bob@n-flatables is offline
 

Member
  
Join Date: Nov 2012
Posts: 26
 

Default Re: Remove or update Jquery

Ok. Is this what I would do?

<?php

namespace XLite\Module\MyID\MyModule\View;

abstract class AView extends \XLite\View\AView implements \XLite\Base\IDecorator
{

protected function getCommonFiles()
{
$list = parent::getCommonFiles();
$key = array_search('js/jquery.min.js', $list);

if($key) {
unset($list[$key]);
}
}


}
__________________
X-cart v 5.2
Reply With Quote
  #8  
Old 04-21-2015, 08:39 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Remove or update Jquery

I would use getJSFiles but yes something like that and add the new jquery after removing the stock one
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may 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 05:06 PM.

   

 
X-Cart forums © 2001-2020