News:

Looking for documentation? Take a look on our wiki

Main Menu

Fancybox problem with SSL

Started by harrstar, October 01, 2013, 03:36:14 AM

Previous topic - Next topic

harrstar

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

               
Joomla 2.5.25 and vm 2.6.10

jenkinhill

This is already changed in the secure versions. eg in 2.0.24 we use:

   $jsVars = "//<![CDATA[ \n";
      if(VmConfig::get('useSSL',false)){
         $jsVars .= "vmSiteurl = '". $uri->root( true ) ."/' ;\n" ;
      } else {
         $jsVars .= "vmSiteurl = '". $uri->root( ) ."' ;\n" ;
      }
Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum