News:

Looking for documentation? Take a look on our wiki

Main Menu

Virtuemart Router and Itemid

Started by sohopros, June 16, 2016, 21:03:59 PM

Previous topic - Next topic

sohopros

Virtuemart seems to be picking up the wrong Itemid when the Register or Save buttons are clicked on the User Registration / Edit Account pages IF VM SEF is turned on.  We have two templates on our site and two Create Account menu items (Id 842 and 1182), one for each.

If we start here: http://www.folch33.devsoho.com/create-account (Itemid = 1182) with VM SEF off, then the Register button script redirects to the correct template (Itemid = 1182): http://www.folch33.devsoho.com/create-account/view/user/layout/edit/lang/en-GB

But if we start the same place: http://www.folch33.devsoho.com/create-account (Itemid = 1182) with VM SEF on, the Register button script redirects to the wrong template (Itemid = 842): http://www.folch33.devsoho.com/pinsart-create-account/edit

The same behavior is seen with the Save button script from the VM Edit Account page (which is actually the same URL [http://www.folch33.devsoho.com/create-account] when a user is logged in. 

Is there a work-around for this?

sohopros


Milbo

You can set extra vmdebugs in router.php and check what the functions setMenuItemId and setActiveMenu do
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Milbo

The problem in your case is, that you have a site with different templates and different languages.

So you need shadow menues for any language and any template. So in fact you need it multiplied with each other

Normal case:
one main menu

Language case:
- main menu *
- main menu En (Englisch)
- Main menu De (deutsch)

Your case, plus 2 Templates

- main menu * templ1
- main menu * templ2
- main menu En templ1
- main menu En templ2
- main menu De templ1
- main menu De templ2

and I think mainly the problem is there
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

Studio 42

I had to fix similar issue.
You can verify current Itemid and modify the return URL in the form(note, i dont checked if this work in latest release)

sohopros

Quote from: Milbo on June 29, 2016, 09:10:56 AM
The problem in your case is, that you have a site with different templates and different languages.

So you need shadow menues for any language and any template. So in fact you need it multiplied with each other

Normal case:
one main menu

Language case:
- main menu *
- main menu En (Englisch)
- Main menu De (deutsch)

Your case, plus 2 Templates

- main menu * templ1
- main menu * templ2
- main menu En templ1
- main menu En templ2
- main menu De templ1
- main menu De templ2

and I think mainly the problem is there

Hi Milbo,

We have tried to create a separate 'Menu' for each language and its respective language 'Menu Item':

1) Created the Spanish and French Menus for Folch Template 'Header Menu'.

2) But when we go for menu item "Associations", it gets a notice as:
Notice:
A menu item set to All languages can't be associated. Associations have not been set.

3) So, we tried to set the language "ALL" to "English" for 'Header Menu'. Then a warning message appears as below:
Warning:
Save failed with the following error: The Language parameter for this menu item must be set to 'All'. At least one Default menu item must have Language set to All, even if the site is multilingual.

4) For the above two reasons, we have created another Menu - 'Header Menu EN' for 'English' Language:
    Header Menu => ../create-account1 => ALL(Language)
    Header Menu EN => ../create-account1 => English
    Header Menu ES => ../registrarse => Spanish
    Header Menu FR => ../creer-un-compte => French
   
5) Followed the same procedure as above for the Pinsart Template as well:
    Pinstart Header Menu => ../pinsart-create-account => ALL(Language)
    PA Header Menu EN => ../pinsart-create-account => English
    PA Header Menu ES => ../pinsart-registrarse => Spanish
    PA Header Menu FR => ../pinsart-creer-un-compte => French
   
6) When clicked on 'Register' button in 'Folch Template "/create-account1" page it again redirects to 'Pinsart Template' "/pinsart-create-account/edit". Still the issue remains same.

Please advise,

Quote from: Studio 42 on June 30, 2016, 22:55:04 PM
I had to fix similar issue.
You can verify current Itemid and modify the return URL in the form(note, i dont checked if this work in latest release)

Hi Studio 42,
Can you give more details? About what form are you talking?

Thanks,
Sandra

Studio 42

I  think for your case, is best to create correctly the right links.

YOu don't need to set menu "all".
Create menu english with(EN)
VM > create-account and set language to EN

Create another menu spanish with(ES)
VM > create-account ES  and set language to ES

Create another menu French with(FR)
VM > create-account FR  and set language to FR

If you need another template add a new menu eg.
Create another menu French with(FR)
VM > create-account FR  and set language to FR and change template too.

Do not forget to add your VM main pages link too for each language

Menu language "ALL" is only need for your website main page.
You can use association for the main menu but VM do not check(don't checked latest code) for the association, so you loose the benefict for the sublinks (eg. edit account) if you don't associate it and in this case VM choose itself the firs found ItemId because it use the vm routing and not Joomla menu item id.
So it really depend from where you come and perhaps current VM code cannot handle you case. But better is you test this yourself.