Fotorama works normally until I click add to basket. After the page reloads this then shows collapsed (as per the image) and logs a couple of errors to console.fotorama collapsed

fotorama.js:99 Uncaught Fotorama requires jQuery 1.8 or later and will not run without it.Uncaught Fotorama requires jQuery 1.8 or later and will not run without it

gallery.js:290 Uncaught TypeError: settings.$elementF.fotorama is not a function
  • Actually jQuery is missing or you are using jQuery older than 1.8 So it is not working. – Dhaval Solanki Oct 25 '17 at 8:41
  • This definitely isn't true - as I can access it in console. Also it works until after I've added to cart and the page reloads. – ol'bob dole Oct 25 '17 at 9:30
  • Yes I faced same issue what you need to do put your fotorama code in the time out means it should run after 5 second after page loads Because in my case also same issue it was not working in the first page load once i refresh it works I use time out so once page loads all javascript loads after that fotorama code executes so all worked fine. – Dhaval Solanki Oct 25 '17 at 9:36
  • I don't fully understand what you're saying here, but please give a proper answer and some code if you have an explanation :) – ol'bob dole Oct 25 '17 at 17:55
  • Please post your javascript code here which you are using for slider. – Dhaval Solanki Oct 26 '17 at 3:48

I believe I have solved this issue by adding the following to my requirejs-config.js file:

var config = {
    shim: {
        'fotorama/fotorama': {
            deps: ['jquery']

More info on shim configuration: http://requirejs.org/docs/api.html#config-shim

| improve this answer | |
  • which configuration would you use this shim in? – ol'bob dole Apr 25 '18 at 14:56
  • @ol'bobdole It goes in your theme or module's requirejs-config.js file. E.g. for your theme: app/design/frontend/[vendor]/[theme_name]/requirejs-config.js. I've updated my answer will a full example. – Rich Apr 26 '18 at 0:42
  • any solution here please post and it would be helpful. Thanks in advance – gajjala sandeep Jun 2 at 15:44
  • The above answer didn't solve the issue. – Haerriz Oct 14 at 11:36

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.