Hi,
I am using vm 2.0.22a on joomla 2.5.14.
The fancybox for the add to cart function from product detail view was not working on secure (https) pages, the popup was not showing. All browsers complained about cross referencing from https://... to http://... for the fancybox call. After some digging I found the culprit in /administrator/components/com_virtuemart/helpers/config.php on line 1136 :
$jsVars .= "vmSiteurl = '". JURI::root( ) ."' ;\n" ;
needs to be changed into
$jsVars .= "vmSiteurl = '". JURI::root(true ) ."/' ;\n" ;
The first line returns the absolute url to the site like :
http://www.example.com/
whereas the second line returns
/
which makes it a relative path from root.
It needs to be either a relative path or the absolute url should switch from http:// to https:// which it currently does not.
This little fix solved the problem and the add to cart popup is now working on https and http.
Uwe
Your fix generated for me as expected
vmSiteurl = 'http://vm2mp.stuprecht//' ;
ah lol overlooked the true in your statement. This is right, it gives back only the path. The question is how your patch works with subdomains.
But I think the real solution is to change the instance JURI to give back an https link.
I added now this
if(VmConfig::get('useSSL',false)){
$jsVars .= "vmSiteurl = '". $uri->root( true ) ."/' ;\n" ;
} else {
$jsVars .= "vmSiteurl = '". $uri->root( ) ."' ;\n" ;
}
Hi Milbo,
Yes, I concur, the joomla function is what really needs to be changed. I like your fix for it though.
On a side note, why is vm not switching back to http if outside the sensitive area?
Uwe