Hi
I'm trying to display my shop in my frontend. But when i check the console i see this message:
Quote$("#'.$prefix.'virtuemart_country_id").vm2front
With this error my page doesn't load all the javascript code so i had to comment one line in this file:
Quoteadministrator/components/com_virtuemart/helpers/vmjsapi.php
and the line to comment was:
jQuery( function($) {
//The next line i had to comment
//$("#'.$prefix.'virtuemart_country_id").vm2front("list",{dest : "#'.$prefix.'virtuemart_state_id",ids : "'.$stateIds.'",prefiks : "'.$prefix.'"});
});
This is not a real solution, so can anyone help me?
I'm using Joomla 3.4.4 and VM 3
Regards
This is a quote problem here. Or you need to escape or change quotes.
the code should something so to give the right result :
$js = 'jQuery( function($) {
$("#'.$prefix.'virtuemart_country_id").vm2front("list",{dest : "#'.$prefix.'virtuemart_state_id",ids : "'.$stateIds.'",prefiks : "'.$prefix.'"});
});';
But i have not the full code to check your quote problem now. This can be in some VM release only.
Hi
This is more code lines:
VmJsApi::jSite();
self::addJScript('vm.countryState'.$prefix,'
//<![CDATA[
jQuery( function($) {
//$("#'.$prefix.'virtuemart_country_id").vm2front("list",{dest : "#'.$prefix.'virtuemart_state_id",ids : "'.$stateIds.'",prefiks : "'.$prefix.'"});
});
//]]>
');
The full code is :
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[
jQuery( function($) {
$("#'.$prefix.'virtuemart_country_id").vm2front("list",{dest : "#'.$prefix.'virtuemart_state_id",ids : "'.$stateIds.'",prefiks : "'.$prefix.'"});
});
//]]>
');
$JcountryStateList[$prefix] = TRUE;
return;
}
And is full valid.
Or you have a server setting/problem, or a bad VM release.
Try to update virtuemart or check with your provider.
You can remove CDATA if you use html4 or html5 , because this is only to be xhtml valid, perhaps this help.
But in all case the problem is not the code here.
Regards,
Patrick
I've removed CDATA but I still have the same problem
I think that the component or my web doesn't charge all the libraries
The real problem is the function vm2front, the web doesn't recognize it
CHeck your VM config in "template" tab.
if Using the Script ajax Countries / Regions is checked.
And perhaps the problem can come from your template. Try default protostar template.
If this not work, Send a link to your site, then someone can verify if some javascript files are not loaded.
Hi
I'm using the script ajax Countries / Regions
If is not checked that option, the website load properly
So if this is not necessary I think I'll disactivate
For verify if some javascript files are not loaded, do you need administration permissions?
just compare your source or in Firebug to the demo site..
You need this script to get region for countries
Quote from: jorgepracticum on October 16, 2015, 11:33:51 AM
Hi
I'm using the script ajax Countries / Regions
If is not checked that option, the website load properly
So if this is not necessary I think I'll disactivate
For verify if some javascript files are not loaded, do you need administration permissions?