News:

Support the VirtueMart project and become a member

Main Menu

?showall=1 is added at the end of the URL in product details from Falang

Started by bogusj, September 18, 2013, 06:18:41 AM

Previous topic - Next topic

bogusj

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.

bogusj

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.

Maxim Pishnyak

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.
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

bogusj

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.

Maxim Pishnyak

From our point, we have no idea why "those of us" had choosed Falang. Can you enlighten us in this?
You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

bogusj

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.

Maxim Pishnyak

You can support Community by voting for Project on the JED
https://extensions.joomla.org/extension/virtuemart/#reviews
Join us at
https://twitter.com/virtuemart

jjk

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.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

bogusj

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.

hazael

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();
}