News:

Support the VirtueMart project and become a member

Main Menu

Switching language while on a product page throws to front page

Started by Henri Helminen, September 20, 2012, 13:57:08 PM

Previous topic - Next topic

Henri Helminen

Hey,

I'm sorry if this problem was already solved. I tried searching for a similar question, but unfortunately did not find one.

Anyways, I have set up a multilingual Joomla 2.5.7 with VM 2.0.10 + AIO. I created the language categories, menus, menu modules, language filter, content languages and language switcher module. Those are all working perfectly. I am using Joomla's own SEF.

My problem is that whenever I switch the site language by clicking the flag, when I'm at a product page, for example at a page like "example/en/category/product/", the system throws me to "example/fi/" (Finnish front page, in this example), instead of giving me the page "example/fi/kategoria/tuote/" (the product's page in Finnish). Joomla's language switcher has the menu association feature, so that when you're on page X using language A, when switching to language B, you'll still be on page X.

Does VM support this, and if so, what steps should I take?

Thanks in advance.

jjk

Quote from: Henri Helminen on September 20, 2012, 13:57:08 PM
... so that when you're on page X using language A, when switching to language B, you'll still be on page X. Does VM support this, and if so, what steps should I take?

Since the Joomla language switcher relies on Joomla menu items, this works with VM2 pages for which a menu item exists in all published site languages. Typically you have VM2 menu items for the shop home page, the product categories and the cart. So if you configured your multilanguage system correctly, the Joomla language switcher will fall back to the next menu level for which it finds a menu item, which normally is a VM2 product category.

In other words, if you are on "example/fi/kategoria/Tuotteennimi-yksityiskohta" and switch to English, it will fall back to "example/en/category".
Make shure you have a suffix (i.e. -yksityiskohta or whatever you like) in the VM2 SEO configuration. The default suffix is "-detail" and disable the Joomla url suffix in Joomla configuration. Without the VM2 SEO suffix the router can't work correctly.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

Henri Helminen

Ahh, of course.

I was browsing an item for which I had not made category links to the menus, thus I was thrown to the main page.

It would be nice though, if one could switch languages and would stay in the same item, or be redirected to the corresponding item, since items won't obviously be listed as menu items (and often not even all categories I suppose), but I guess it's just not possible.

In any case, thanks for the fast and helpful reply! Thumbs up.

aspirinemaga

Henri, could you please explain how to make category links to the menus pls ? I am sorry but i didn't understand at all how you have managed that. Pls, could you clearify the things ? thank you

lindapowers

The problem as Henri says is that most people are not gonna make a menu item for every category and even less for every product.

Asking is free but would be nice if we could have each category and product associated as in menu language asociations. They are translations so I guess there is a way.

Regards

jjk

Quote from: lindapowers on March 30, 2013, 02:14:51 AM
...would be nice if we could have each category and product associated as in menu language asociations.

In Joomla 2.5.x you can do that of course. If you have a Joomla menu for your shop categories, just give each VM category the 'Menu item type' 'Category layout' in the menu settings, select a language and also select the category name in the upper right from the dropdown list under 'Required Settings'.

Thereafter you should see the 'Association' symbol in Joomla's 'Menu Manager Menu Item' list

This works on my website since multilanguage was added to VM long time ago.

PS: On your new website the spanish language category menu items don't have language tags and the french category menu is missing completely. That's probably why switching languages in a category view redirects to the homepage.
Non-English Shops: Are your language files up to date?
http://virtuemart.net/community/translations

lindapowers

Hi jjk thanks,

The reason is that for our main language we didnt like the /es added to the URL.

The category view wasn't planned but XMAP forced me to create one pointing to parent categories to make the products appear in the sitemap.

Yep, French is still being translated and developed, that menu item has to be created in the rest of languages.

We do have the "shop" menu associated aswell as the rest of the menu items and they work (even for spanish).

What I meant is that if you don't create a menu for each category it will redirect to the main shop.

I think theres some background programming needed for that to work correctly. A product and it's translated versions should redirect to each other without menu associations, the language is already an association and mostly the fact that is a unique category and product so it would be nice to see an option for associations in the virtuemart settings.

Regards

marcQC

I have the same issue with virtuemart 3.x.

What can I do to make sure that if the user change the language on a product page that he would be forward toward the same page, but in the other language?

Thank you!!

GJC Web Design

It is possible -- see  https://www.quality-tuning.eu

I did this with my own Joomla language module  - basically  forming the correct alternative language urls based prod and cat ids of the page your currently on
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

Studio 42

Quote from: marcQC on August 18, 2016, 02:12:42 AM
I have the same issue with virtuemart 3.x.

What can I do to make sure that if the user change the language on a product page that he would be forward toward the same page, but in the other language?

Thank you!!
Hi,
See http://shop.st42.fr/fr/produits/multi-langue-pour-virtuemart.htm , Working for products,categories ...


GJC Web Design

GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation