Category Archives: Bugs

Javascript error with Magento Porto Theme

I purchase the porto theme at
https://themeforest.net/item/porto-ultimate-responsive-magento-theme/9725864?s_rank=2

It included a lot of feature to help me to customize the theme in light speed. But after installation i saw some javascript error on homepage and catalog and checkout page also:

With owlCarousel jQuery plugin:

With Stellar plugins:

With jQuery Widget:

With timepicker plugin:

After some digg i saw there a lot of their customer got the same problems and they post the question to customer support. But after that they just reply to merge javascript to fix the problem, because requirejs include two different jQuery instance so you can’t use the right jquery instance that loaded with Porto plugins. The solution is you have to remove duplicated jquery load in porto theme and wrapper the plugins load with requirejs so it can load the default Magento jquery instance.

– Remove jQuery load from Porto theme. Create/update your theme file at the default head block: Magento_Theme/layout/default_head_blocks.xml this will applied to all your Magento 2 pages. Put remove directive inside your head tag

and wrap the stellar init function with requirejs, create theme-path/requirejs-config.js to add jquery dependencies for your plugins:

Clean your Magento cache, and flush static view files to refresh new installation