VirtueMart Forum

VirtueMart 2 + 3 + 4 => General Questions => Topic started by: 2dmaster on July 04, 2018, 22:12:58 PM

Title: Virtuemart.updateChosenDropdownLayout error
Post by: 2dmaster on July 04, 2018, 22:12:58 PM
this is not good function pls fix it !!!

VM8129:6 Uncaught TypeError: jQuery(...).chosen is not a function
    at Object.Virtuemart.updateChosenDropdownLayout (eval at <anonymous> (jquery.min.js:3), <anonymous>:6:35)
    at HTMLDocument.eval (eval at <anonymous> (jquery.min.js:3), <anonymous>:10:14)
    at c (jquery.min.js:3)
    at Object.add [as done] (jquery.min.js:3)
    at a.fn.init.ready (jquery.min.js:3)
    at eval (eval at <anonymous> (jquery.min.js:3), <anonymous>:9:19)
    at eval (<anonymous>)
    at jquery.min.js:3
    at Function.globalEval (jquery.min.js:3)
    at a.fn.init.domManip (jquery.min.js:4)



!!! worked if i set off in virtuemart cfg dropdowns regions and disable other vm libs !!!
Title: Re: Virtuemart.updateChosenDropdownLayout error
Post by: Studio 42 on July 04, 2018, 23:18:28 PM
Yes, i have same problem.
This is since last releases.
With a light code change, you solve the problem
in JOOMLAROOT/administrator/components/com_virtuemart/helpers/vmjsapi.php
after
Virtuemart.updateChosenDropdownLayout = function() {
add
if( typeof jQuery.chosen === "undefined") return;

It's not heavy tested, but the problem is most case because all Virtuemart changes and template, it's sometime a nightmare when you need to customize the javascripts for a shop
Title: Re: Virtuemart.updateChosenDropdownLayout error
Post by: stawebnice on August 08, 2018, 23:06:20 PM
great thanks, that's exactly what I needed when multivariant select of product variant was not working :)
Title: Re: Virtuemart.updateChosenDropdownLayout error
Post by: Milbo on August 10, 2018, 10:19:32 AM
But it must be something in your template, because the problem is rare. Furthermore the last version is already some months old.
Title: Re: Virtuemart.updateChosenDropdownLayout error
Post by: Studio 42 on August 10, 2018, 11:28:42 AM
Quote from: Milbo on August 10, 2018, 10:19:32 AM
But it must be something in your template, because the problem is rare. Furthermore the last version is already some months old.

I had already the problem, when you install a template demo pack, sometime they disable or do not load VM scripts because they use own select list javascript in product.