I tried i include the swiper.min js. but not working.


i added this slider in our product phtml file then coming error please let me know how we can fix this screenshot. http://prntscr.com/lmbmis

http://magento-213836-648260.cloudwaysapps.com/demo this is my site link.


Magento doesn't work properly with third part js libraries, if not included using require js. You've just added script in the body. Check this post to include js library with jquery dependency;

How to add js libraries that require Jquery to magento 2 using requireJs

  • i used this jquery slider – neha rani Nov 24 '18 at 7:48
  • Copy the code from your phtml and paste it in the question. – Vivek Kumar Nov 24 '18 at 7:50
  • Our theme require.config.js code "var config = { paths: { 'js': "Magento_Theme/js/swiper.min" }, shim: { 'js': { deps: ['jquery'] } } };" – neha rani Nov 24 '18 at 8:03
  • <script src="magento-213836-648260.cloudwaysapps.com/app/design/frontend/…> <script> require(['jquery', 'glide', 'domReady!'], function($, glide){ $(function(){ var swiper = new Swiper('.swiper-container', { scrollbar: { el: '.swiper-scrollbar', hide: true, }, slidesPerView: 4, spaceBetween: 30, slidesPerGroup: 1, loopFillGroupWithBlank: true, }); }); }); </script> – neha rani Nov 24 '18 at 8:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.