Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Top menu not appearing in foreign languages in virtuemart

Top menu not appearing in foreign languages in virtuemart

Hi, I'm in the process of making my site multilingual (offering EN, German and Hebrew).

So far I've managed to get the non-virtuemart pages working, including the VM store homepage (which is not my "default" page) but I can't get the EN or translated top menu to appear on internal VM pages. What does get displayed is the "all languages" (English) menu. Any ideas what I have to do?

I've tried two approaches without success: 1) to duplicate the existing module of , for example, the German top menu and assign it to "no pages"; 2) to recreate the whole German top menu (in the menu manager) and duplicate the existing menu links of the original German top menu assign them to this new menu, and create a new module for it assigned to no pages.

I have the metamods set on the correct language (per the module language selector) and they reference a version of the top menu which is not assigned to any page using this kind of command:
if (
$option == 'com_virtuemart'
) return 208;
It doesn't work, and adding "and $language="de-DE" " (I referenced the Joomla language pack prefix) to the original command (and setting the language string to be "Jooma front-end") also doesn't work.

On a related matter I'm also unable to get the language switcher module to display on the internal VM pages. But unlike my case above with the top menu bar, even on EN-GB pages the module doesn't appear (even when using metamod with the same php callup as above).

Any ideas what to do??

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

...any help would be appreciated :-)

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Hi Tap21,

I assume you are using MetaMod Pro version. Question: are you using the built-in multi-lingual system in Joomla, or JoomFish or similar?

I have seen issues like this before with JoomFish. The answer was to reorder the system plugins. This info was taken from an old posting regarding JoomFish. The plugin order that was found to work was:

System - JFsef: -103
System - MetaMod Pro: -102
System - JFRouter: -101
System - JFdatabase: -100
System - Chameleon: -99

Can you confirm whether or not you are using JoomFish, or using the built-in Joomla multi-lingual features?
Please also mention what version of Joomla you are using.

Meanwhile I'm checking out a basic multi-lingual setup on Joomla 3.4.1 to see if there are any "gotchas".

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Ok I am now experiencing some similar difficulties to what you are experiencing, with VM pages on a multilingual site.

The problem I am seeing is when:
1 - I am on the non-default language, e.g. fr
2 - I have a French menu set up, with a menu item on there that is also assigned to fr, for the VM front page
3 - I view an item (page is still in french)
4 - I "add to cart" (ajouter au panier)

On the JS popup, the "continue shopping" and "show cart" links do not have the correct language tag on them. In non-SEF mode the parameter is set in the URL: &lang=en

So it looks like a mixture of bug in the router and/or something going on in VM. This should not happen. The Itemid is correct but it's adding the wrong language. This is triggered in prepareContinueLink() in vmview.php where the Itemid is added to the URL but not a language. The JRouter::_() function is adding English instead of French, which that Itemid is assigned to (and the current page is assigned to).

So far this is the only way I have been able to make VM forget which language it's in. For other internal pages, clicking through items and viewing the cart, it's staying in French successfully. Needless to say, this isn't being *caused* by MetaMod, but I think you're trying to get MetaMod to work around this behaviour.

Your first attempts were to try to recreate your German menu in a form that MetaMod could cause to display even on non-German pages. Unfortunately this is doomed to failure. MetaMod will happily tell the system to display the German menu, but the system, thinking that it's in a different language, won't display any of the items in that menu since they are presumably all set to German which is not the current language.

I haven't been able to replicate your problem where the language switcher module does not appear on internal VM pages. If you turn off SEF URLs, do you see a language code being used in the URLs? Is it the correct one? Do you see an Itemid in the URLs?

Sorry this is a messy situation. So far it looks like it's not something that MetaMod can fix. Once the system thinks it's in a particular language, there's little or nothing that MetaMod can do to display a module for a different language. I suggest that you report this as a bug to the VM people.

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Thank you for checking it out for me. I'm using Joomla's own multilingual tool.

In the meantime I stumbled upon a solution: through trial and error I discovered that the "all languages" version of the menu was working fine everywhere whereas my 3 different metamod (pro) menus were not being displayed within VM pages. Through that trial and error I found that the metamod's weren't having any effect so I deactivated them and left the original batch-duplicated menus.

At some stage, German categories which had worked fine were redirecting to 404 errors, and the breadcrumbs were displaying very odd locations, and my Hebrew links were displaying the German categories.

I deactivated the Joomla SEF, cleared the cache - and suddenly everything was fine: the German menu displayed on all VM pages along with the language switcher. But if I reactivate Joomla's SEF the problems return...

So technically (for now at least), my problem is solved - but what a pity I can't use the SEF option. Will wait until I complete the Hebrew category tranlsations to see is the incomplete state of that translation is what caused the complications wth the URL links vis SEF, because everything in that regard was initially okay...

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Wow that's messy all right. I won't pretend I understand what's going on with the SEF. I think the issue with MetaMod not working is simply that the menus that it was trying to pull in were assigned to a particular language (or the items inside them were in a particular language) which was not the "current" site language, so Joomla refused to display them. At least that's my working hypothesis at the moment. It would be useful if MetaMod could override that and pull in a menu regardless of its language setting, but that might lead to other complications I guess.

Anyway, I am pleased that you have found an appropriate work-around. Well done.

Best regards,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

**I forgot to ask an important question, because I may need metamods on the foreign languages pages to display the translated "swmenupro" product menus (my problem above was with general site navigation menus): what is the php condition that I write for the languages?

For example, if I'm using Joomla's language switcher, I would select that in the metamod, and then in the php section I'd write a condition with $language ? which language codes do I use - the ones belonging to the Joomla translation kits (eg. "en-GB" and "de-DE") or something unique to metamodpro?

Does the language setting in the module drop down menu have any effect on metamods or do I need to write a php command?

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Hi tap21,

Here's how the $language thing works:

1 - for your purposes you'll want to set "$language handling" in the Config tab of the Chameleon rule to "Joomla! front-end language". This is also the default.

2 - from the docs:

$language - a lower-case language code. By default this returns the default language of the web visitor’s browser, but can alternatively return the language code of the Joomla front-end, or intelligently find the best match between a user’s browser languages and a list of languages that you provide. Typical language strings returned include: en, en-gb, en-us, fr, de and many others.
$language_code - the first part of $language, if it contains both a language code and a region code. e.g. if $language is "en-gb" then $language_code is "en".
$language_region - the region code of $language, if it contains one. e.g. if $language is "en-gb" then $language_region is "gb".

3 - note that these are all lower case (even if you used mixed case in the Language Manager when setting up the languages).

So a basic condition to load a certain module when the front-end language is French would be:

if ($language_code == 'fr') return XXX;
// replace XXX with the module id of the module to show on pages in English.

Yes you do need to do that in a PHP command.

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

Thanks! I'm following those guidelines and I'm doing more or less fine: just one hitch - on Hebrew I can't the the metamod to display. Is the language string for it $language == "he" or something else? Because the snippet there isn't working for me...

tap21
Junior Modder
ranks
useravatar
Offline
20 Posts
Administrator has disabled public posting

Re: Top menu not appearing in foreign languages in virtuemart

I would use $language_code == 'he' just in case there's a locale element (he-il for example).

e.g.

if ($language_code == 'he') return XXX;

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3314 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1691
Total Polls:
6
Total Posts:
5912
Total Posts Today:
6
User Info:
 
Total Users:
11515
Newest User:
velis415
Members Online:
0
Guests Online:
184

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked