Ajax Search: Fix double language URLs such as /it/it/

Please post your questions and problems with any of our extensions which you are using

Ajax Search: Fix double language URLs such as /it/it/

Postby admin » Tue Oct 29, 2013 12:52 pm

Dear friends, due to a SEF issue in internal joomla files or your router, we had made a patch to fix double language tags:

Open your: \modules\mod_vm_ajax_search\ajax\index.php

search for:
Code: Select all
else
        {
          $href = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$row['product_id']);
         $href = str_replace('modules/mod_vm_ajax_search/ajax/', '', $href);


and add next lines, so it looks like this:
Code: Select all
else
        {
          $href = JRoute::_('index.php?option=com_virtuemart&view=productdetails&virtuemart_product_id='.$row['product_id']);
         $href = str_replace('modules/mod_vm_ajax_search/ajax/', '', $href);
         
         $exp = explode('/', $href);
         
         if (count($exp)>=3)
         {
          
           if ((strlen($exp[1])==2) && ($exp[1]==$exp[2]))
            {
              
              unset($exp[1]);
             $href = implode('/', $exp);
                  //var_dump($href); die();
            }
            
         }


We will release this within next updated of the ajax search.

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm

Re: Ajax Search: Fix double language URLs such as /it/it/

Postby max.fiorenza@.....com » Tue Oct 29, 2013 3:43 pm

Hello Stan, unfortunately i've tryed your modification on another website (www.tuttiinacqua.it) and in search results, link still have /en/en or /it/it , so double language code appear.
Let me know if you need further informations to solve this problem.
max.fiorenza@.....com
 
Posts: 1
Joined: Tue Oct 29, 2013 3:42 pm

Re: Ajax Search: Fix double language URLs such as /it/it/

Postby admin » Mon Nov 11, 2013 2:09 pm

Hello, i think the issue is caused by improper cookie/session storage as it thinks that each directory of the site requires a new cookie path. I suggest to try to change Joomla's cookie path to '/' so it always sets it for the root. You also may want to set the domain if you are using more than one (www, non-www or per lang domains).

Image

Best Regards,
Stan
admin
Site Admin
 
Posts: 2708
Joined: Wed Jan 06, 2010 11:43 pm


Return to VirtueMart and Joomla Extensions (free or paid)

cron