VirtueMart Forum

VirtueMart 2 + 3 + 4 => Language/Translations => Topic started by: bogusj on September 18, 2013, 06:18:41 AM

Title: ?showall=1 is added at the end of the URL in product details from Falang
Post by: bogusj on September 18, 2013, 06:18:41 AM
Hi,

Does anybody have the same problem?
I have a bilingual site (Greek and English) and I use Falang to make the translation.
When I browse my site from the menus, everything is fine. When I am at a product details view (Only there is the problem) and I try to switch to another language a ?showall=1 is added to the URL. This really messes up SEF, creates double links for all product details and is really bad for SEO.
Here is an example: www.allmassage.gr/en/massage/china/all-massage-tuina
Just try to switch to another language from the Falang language switcher located at the top left.

Any ideas?

Thanks in advance.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: bogusj on September 18, 2013, 06:48:37 AM
Hi again,

I applied the following workaround that works, however it would help a lot if someone explain why this happens in the first place.
Workaround:
1. Locate file /modules/mod_falang/tmpl/default.php
2. Change line 22 from:
<option value="<?php echo $language->link;?>" <?php echo !empty($language->active) ? 'selected="selected"' ''?>><?php echo $language->title_native;?></option>
to:
<option value="<?php echo str_replace("?showall=1"""$language->link);?>" <?php echo !empty($language->active) ? 'selected="selected"' ''?>><?php echo $language->title_native;?></option>
Basically what we say here is find "?showall=1" and remove it.
3. Change line 31 from:
<a href="<?php echo $language->link;?>">
to:
<a href="<?php echo str_replace("?showall=1"""$language->link);?>">

That's it. You're set! :-)

Hope this helps someone.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: Maxim Pishnyak on September 18, 2013, 08:44:15 AM
Quote from: bogusj on September 18, 2013, 06:48:37 AM
Hope this helps someone.
I doubt this will happen. Cos VM doesn't need falang at all to work with inbuilt in Joomla 2.5 multilingual feature. On this forum VM users able to get quality support in configuring mentioned feature. Falang doesn't necessary at all.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: bogusj on September 18, 2013, 15:26:14 PM
I am not saying that VM requires Falang, however for those of us who have chosen to use Falang in our sites for Joomla, not VM, this was creating a problem with VM links. I am not saying that it's VM's fault, but it does happen when you use Falang and VM at the same time.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: Maxim Pishnyak on September 18, 2013, 19:45:08 PM
From our point, we have no idea why "those of us" had choosed Falang. Can you enlighten us in this?
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: bogusj on September 18, 2013, 21:05:32 PM
I am again talking about Joomla and not VM. Falang is an extension chosen by many people for Joomla translation, because:
1. Is faster and more simple to perform the translation, since you can choose and translate only the parts you need.
2. The entire process is more familiar, if you are used to Joomfish and J1.5.

On the other hand, Joomla's 2.5 translation method requires you to duplicate everything, for all languages and work on them individually. So, when something changes, you need to go through all those for all languages and change them, while with Falang, most of the time, it's easy as deleting the old translation and recreate it, or just change it.

For all the above I find it simpler and faster.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: Maxim Pishnyak on September 18, 2013, 21:13:07 PM
Thank you for your input!
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: jjk on September 21, 2013, 23:24:13 PM
Quote from: bogusj on September 18, 2013, 21:05:32 PM
2. The entire process is more familiar, if you are used to Joomfish and J1.5.
Once you get used to the Joomla 2.5+/VM2 native translation, it's probably easier handle than the old Joomfish style system, which I stopped using when Joomla 1.6 was available. I wouldn't change my bilingual website back to the old system. Personally I doubt that VM2 will run nicely with the Falang translation system. In order to use Falang with other extensions, you would normally need to create a Falang 'Content element', which afaik doesn't exist for VirtueMart.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: bogusj on September 24, 2013, 11:58:26 AM
Hi jjk,

Again, I am saying that I am not using Falang for VM, I am using VM's/Joomla translation system. I use Falang only for Joomla's translation. However since Falang is there, when you switch between languages Falang adds "?showall=1" at the end of the URL, only at the VM pages, that creates duplicated URLs. It's a purely Falang problem, that I found a solution and I was kind to share it, just in case someone faces the same problem.
Title: Re: ?showall=1 is added at the end of the URL in product details from Falang
Post by: hazael on June 13, 2015, 12:38:55 PM
additional protection against duplicate links:

if ((strpos($_SERVER['REQUEST_URI'], '?showall=1'))){
$str = str_replace("?showall=1", "", $_SERVER['REQUEST_URI']);
header('HTTP/1.1 301 Moved Permanently');
header('Location:'.$str);
header('Connection: close');
exit();
}