Hello-
I'm on VM 3.0.8 / J! 3.4.1, but I've seen threads about this issue dating back to VM 1.x, and haven't seen any solid fixes for it. Hopefully, I'm just missing the answer, but... Ok, when someone goes to checkout and selects the country (in my case the United States), the States dropdown does not work. It seems to be the one field on the cart page that just keeps giving problems, but I can't seem to make it work properly, although I've tried tons of various combinations of settings for that field and for the various ajax / jquery / JS settings in VM itself. I've seen a few workarounds posted, such as hacking VM to replace that w/ just a text field. But, I'm wondering if there's a better fix out there. Also running Gantry (a RT template), in case that helps... not sure if that's a possible conflict-cause here?
Site is: https://www.mineratminerals.com
-Jim
Before doing anything elae you should rule out the template as an issue by switching to Protostar to see if the dropdown works there. If not then it could be a third party plugin such as a gallery.
Have you tried a debugger on the page? http://forum.virtuemart.net/index.php?topic=119638.0
Oh yes, will try that! Will let you know and report any success here! There IS one rather Javascripty-intense (to coin a phrase) module on that page that I didn't try disabling yet.
I don't see any of the required JS being even loaded on https://www.mineratminerals.com/for-sale/user/editaddresscartBT
chosen.js, vmsite.js etc
plus a 500 server error for some com_jrealtimeanalytics thing
r u sure this template is VM 3 compatible? AS Jenks says - try with Protosar first
then if ok rename the template html/com_virtuemart folder
Cool, thanks! Yeah, I tried Protostar & it still didn't work. But, when you mentioned disabling the overrides, that did the trick. I think it was some code from a prior VM override in there... disabled that & the dropdown kicked back in. (Still have some of those unrelated junky errors that you also pointed out, thanks. But, yeah, I think maybe some old override code was bonking the system here!) MArked the subject solved. :-)
Hi,
I am having the same problem at http://staging.superageless.com/
as you can see, the site is still using protostar
I only installed Virtuemart, VM Affiliate, that's it
Will appreciate some help or guide on what to do
thx
irwan
your loading at least 2 jquery libraries -- add to cart isn't even working
one is coming from your menu
As stated, you have a problem with your menu module loading a version of jQuery which is incompatible with VM2.x
<script src="http://staging.superageless.com/modules/mod_bm_cool_menu/assets/js/jquery-1.11.1.min.js" type="text/javascript"></script>
http://forum.virtuemart.net/index.php?topic=119638.0
Thank you very much for your help, somehow it skipped my mind that modules can also interferes with component. It was BM Cool menu and once I disabled it, it works.
Much obliged,
Irwan
I am encountering a similar issue on a 3.0.10 site. I have tried a lot of things, including using a jQuery compilation extension such as Jquery-Easy. Though this does seem to be a very helpful extension, it doesn't seem to have solved the problem with my virtuemart_state_id drop-down not being populated properly.
I did a bit of tracing, and am pretty sure there is some kind of JS error along the way I am having a hard time spotting where its breaking down. It seems the system is definitely returning the properly formatted json options, but they are not getting correctly populated into the dropdown?
Anyone have any ideas? I'm gonna see if I can spot where its breaking down in the meantime...
So after a few more minutes of hunting, I think I figured out where my problem is coming from. The site I am currently running is in a subfolder, jupgrade, as I am migrating this site originally from a Joomla 1.5x and Virtuemart 1.18x site. It looks like the ajax call in the 'components/com_virtuemart/assets/js/vmsite.js' file is using a relative path. After SEF urls are enabled, this relative path is going relative to the server and thus is breaking down and not returning any values.
I am not really sure of the solution to make this compatible with all different site configurations using only java-script. It would be necessary for the system to know that it is operating in a subfolder, and adjust the AJAX calls accordingly. Maybe someone with a better understanding of Virtuemart 3's inner workings might have an idea how to pull this off. I usually dev sites on subdomains, but I'm sure there are plenty of users out there in subfolders that are probably having this same issue.
Thank you trevor for writing the problem to me.
The solution is to use in vmsite.js around line 49-50
jQuery.getJSON(window.vmSiteurl + 'index.php?option=com_virtuemart&view=state&format=json&virtuemart_country_id=' + byAjax,
and we have to add the vmSiteurl to the calling js, so that it is known. I am going to change this later so that we have always a Virtuemart.vmSiteurl, but now for testing.
Open the vmsjapi.php in /administrator/components/com_virtuemart/helpers. and replace the function JcountryStateList with
static function JcountryStateList($stateIds, $prefix='') {
static $JcountryStateList = array();
if (isset($JcountryStateList[$prefix]) or !VmConfig::get ('jsite', TRUE)) {
return;
}
VmJsApi::jSite();
self::addJScript('vm.countryState'.$prefix,'
//<![CDATA[
vmSiteurl = "'.JURI::root().'";'."\n".'
jQuery( function($) {
$("#'.$prefix.'virtuemart_country_id").vm2front("list",{dest : "#'.$prefix.'virtuemart_state_id",ids : "'.$stateIds.'",prefiks : "'.$prefix.'"});
});
//]]>
');
$JcountryStateList[$prefix] = TRUE;
return;
}