Skip to main content
added 455 characters in body
Source Link
Krishna ijjada
  • 9k
  • 6
  • 42
  • 70

This is quite large to post in comments, i have created one extension where i added some javascript and jquery file like mentioned.

Add your files to requirejs-config.js like

var config = {
    map: {
        '*': {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
        }
    }
};

Once it is done clear cache and php magento setup:static-content:deploy go to \pub\static\_requirejs\frontend\Magento\luma\en_US\requirejs-config.js check your configuration files. of, if not find, remove the file and refresh the browser , it will generate automatically. once you find your filesfile paths there. you can mentionwrite code in phtml

     require(['jquery', 'tether', 'bootstrap'], function($){ 
         //check with alert once if works fine then you can go
        $(function() {
            $('[data-toggle="tooltip"]').tooltip()
        });
 });

Using require() you are saying something like "the function that I pass has the following dependencies, check that these dependencies are loaded before running it".

Hope this helps.

This is quite large to post in comments, i have created one extension where i added some javascript and jquery file like mentioned.

Add your files to requirejs-config.js like

var config = {
    map: {
        '*': {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
        }
    }
};

Once it is done clear cache and php magento setup:static-content:deploy go to \pub\static\_requirejs\frontend\Magento\luma\en_US\requirejs-config.js check your configuration files. of not find, remove the file and refresh the browser , it will generate automatically. once you find your files there. you can mention

This is quite large to post in comments, i have created one extension where i added some javascript and jquery file like mentioned.

Add your files to requirejs-config.js like

var config = {
    map: {
        '*': {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
        }
    }
};

Once it is done clear cache and php magento setup:static-content:deploy go to \pub\static\_requirejs\frontend\Magento\luma\en_US\requirejs-config.js check your configuration files, if not find, remove the file and refresh the browser , it will generate automatically. once you find your file paths there. you can write code in phtml

     require(['jquery', 'tether', 'bootstrap'], function($){ 
         //check with alert once if works fine then you can go
        $(function() {
            $('[data-toggle="tooltip"]').tooltip()
        });
 });

Using require() you are saying something like "the function that I pass has the following dependencies, check that these dependencies are loaded before running it".

Hope this helps.

Source Link
Krishna ijjada
  • 9k
  • 6
  • 42
  • 70

This is quite large to post in comments, i have created one extension where i added some javascript and jquery file like mentioned.

Add your files to requirejs-config.js like

var config = {
    map: {
        '*': {
        "tether" : "js/bootstrap/tether.min",
        "bootstrap": "js/bootstrap/bootstrap.min"
        }
    }
};

Once it is done clear cache and php magento setup:static-content:deploy go to \pub\static\_requirejs\frontend\Magento\luma\en_US\requirejs-config.js check your configuration files. of not find, remove the file and refresh the browser , it will generate automatically. once you find your files there. you can mention