caciobanu / improved-magento-layered-navigation

This project has reached its end-of-life (EOL).
MIT License
138 stars 54 forks source link

Incompatibility with themes different from rwd #97

Closed nadiasala closed 7 years ago

nadiasala commented 7 years ago

Hello, we are using your module with Magento 1.9.3.1 and a custom theme and we noticed that handler.js requires both jQuery and Enquire libraries and also the ConfigurableSwatchesList class defined. So some methods in Ajax version are not properly working; for example both toggleContent and blockCollapsing methods throw exceptions and ajax loading could not be hidden. Have you some tips or fix scheduled ?

Thank you!

caciobanu commented 7 years ago

Unfortunately it is near to impossible to offer compatibility with custom themes. My suggestion is to modify the JavaScript and adapt it to fit your custom theme.

lorenaramonda commented 7 years ago

If I can afford, there are some discrepancies in your code: you first start writing in prototype then switches in jQuery without, among the rest, defining it clearly because you use $j often which is not being defined. If you replace it with "jQuery" it works but if I can suggest, it will be better using the same syntax all over the script so writing it all in jQuery or all in prototype. As Magento uses prototype I guess this could be a better choice and these changes will fix a big part of your code. Next, for the specific methods requiring Enquire or the RWD classes that could be fixed with a check of their availability maybe.

What do you think about this? :)

caciobanu commented 7 years ago

Some of the JS is copied from the default RWD theme to keep the same functionality that is why you see jQuery, Prototype and Enquire used. When I'll get the time I'll rewrite some of the js to use only jQuery. Prototype will be kept for the price slider. As for Enquire I'll add some checks around it.

caciobanu commented 7 years ago

Off course, PR's are welcomed 👍

lorenaramonda commented 7 years ago

Thanks and good luck with your work! 😄

caciobanu commented 7 years ago

100 should be a good fix for this.