2

Searched everywhere,

My question is basically if someone knows if its possible to remove prototypeJS with Jquery and fix the ajax search and 1 page checkout?

I believe also product search and add products depend on prototype.

Im using Magento 1.9CE The problem is there seems to be nowhere documented how to replace the 1-page checkout from prototype to Jquery.

I have currently the Prototype removed so now the theme is broken, looking desperatly for a solution to replace the prototype js with jquery to make it work again.

  • Some more details may help get you an answer faster. What version of Magento are you using? Any code examples you've tried so far? etc. – B00MER Mar 10 '15 at 17:54
2

You can't just replace prototype.js. I know it's hard to hear, but it's just not possible.

All core modules are built on Prototype - this means all of the js window objects - bundle, product, etc. Also all of the checkout JS depends on Prototype as they all are ES5 polyfilled for backward compatibility with older browsers.

Don't worry about replacing Prototype and just add jQuery. Or, better yet, learn how to use Prototype! Here's a good way to get started: http://blog.philwinkle.com/prototype-js-for-jquery-afficionados/

1

Magento basic JS framework is build on prototype. So it would be hell of a lot work to replace this because all the dependencies.

For your convenience there will be a shift to jQuery in Magento 2. So because the first Release Candidate will be announced shortly I do not think that it would bother even changing it right now.

Of coarse you can load jQuery in compatible mode and use a anonymous function for your internal code.

(function($){
    // Now jQuery will be $ locally
})(jQuery);

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.