VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: nixtuan on October 29, 2011, 05:19:16 AM

Title: conflict jquery and (mootools) in VM2 and joomla 1.7
Post by: nixtuan on October 29, 2011, 05:19:16 AM
hi every body,
I have met the problem that when I go to cart page. All function of joomla page doesn't work.
I figure out that the problem come from the conflicting of jquery.

My solution is:
comment the codes bellow from this file: administrator\components\com_virtuemart\helpers\config.php
function jQuery() {
      
      // if ( !VmConfig::get('jquery',true ) && JFactory::getApplication()->isSite()) return false;
      // static $jquery;
      // // If exist exit
      // if ($jquery) return;
      // $document = JFactory::getDocument();
      // if(VmConfig::get('google_jquery',true)){
         // $document->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js');
         // $document->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.8.14/jquery-ui.min.js');
      // } else {
         // $document->addScript(JURI::root(true).'/components/com_virtuemart/assets/js/jquery.min.js');
         // $document->addScript(JURI::root(true).'/components/com_virtuemart/assets/js/jquery-ui.min.js');
      // }

      // //JHTML::script('jquery.min.js', '//ajax.googleapis.com/ajax/libs/jquery/1.6.1/', false);
      // /*$document = JFactory::getDocument();
      // $document->addScriptDeclaration('jQuery.noConflict();');*/

      // $jquery = true;
      
      return true;
   }

happy coding!
Title: Re: conflict jquery and (mootools) in VM2 and joomla 1.7
Post by: Milbo on October 29, 2011, 11:43:29 AM
sorry this is absolutly stupid solution. You can exactly do this just with a config setting. Please learn first the possibilities of the configuration.
Title: Re: conflict jquery and (mootools) in VM2 and joomla 1.7
Post by: algisinfo on January 09, 2012, 18:22:41 PM
I know this is an old post, but having the same problem and found it searching for a solution.
Can you please explain what has to be done in the configuration to run jQuery in a way that is not conflicting with mootools ?
And why isn't that the default setting ?
Title: Re: conflict jquery and (mootools) in VM2 and joomla 1.7
Post by: Cleanshooter on January 10, 2012, 15:34:36 PM
Please see BT.pro's post on jQuery conflicts it is stickied... http://forum.virtuemart.net/index.php?topic=95979.0 (http://forum.virtuemart.net/index.php?topic=95979.0)