Has anyone got chosen.js working on Magento 1.7x?
I've seen one thread talking about problems with it and Magento validation.
If someone knows if it works can he show me how to do it?
adminhtmljavascriptmagento-1.7validation
Has anyone got chosen.js working on Magento 1.7x?
I've seen one thread talking about problems with it and Magento validation.
If someone knows if it works can he show me how to do it?
Best Answer
Old question, but I just ran into this issue, so I came up with an alternate solution, inspired by the answer given by @kevnk
My solution is to replace all selects, site wide, but it can simply be adjusted to target specific selects.
This is done in magento EE 1.12, but I see no reason for it to work in other versions.
I created the following script which does the following:
isValidation
method of Validation with a fallback to the original (now named_isValidation
) The original will be called for anything other than select, or if a select does not have a matching chosen elementinsertAdvice
method of Validation. This purely changes the container to the matching chosen element, so the validation advice is placed after thatSimply include this code via layout to your site.
After using this, I found that in checkout (OPC), the payment methods select boxes are not being transformed, as well as shipping, the state selection box is still visible. The issue is AJAXED in content.
I fixe dthis by wrapping the realoadProgressBlock method in checkout, to re-init the chosen object, thus fixing ajaxed in content.
EDIT:
A slight adjustment is needed in the code above, to make this work in magento EE 1.13 (possibly EE1.14/CE 1.8/1.9 ?)
the call to
parent();
in the code above must be changed toparent(this.currentStep);
Hope this is of help to someone.