News:

Looking for documentation? Take a look on our wiki

Main Menu

Registration link on login page override

Started by Stonedfury, March 03, 2013, 23:35:39 PM

Previous topic - Next topic

Stonedfury

I have searched and there really wasn't a solution posted that I could find so I hope this one helps others. If you are wanting that link on the on the login page that says "Don't Have an Account" to redirect to the VM registration page.

When you create a login link it has on that page your login form, forgot username, forgot password and register. All is good except the register as it takes you to joomla register page or K2 if you use that. Now the average Virtuemart user want the person to register on, of course, the VM registration page. Here is a solution that works perfectly.

Open up your /template/yourtemplate/html/com_users/login/default_login.php and find
<li>
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>

and replace with
<li>
<a href="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>

All it does it take you to the account page but there is no user information so it ask you to register or login. Simple yet effective SEO/SEF link

If you haven't got a template override for that file then just make one by coping the components/com_users/views/login/default_login.php to the folder mentioned above (create it) and then edit for the override. I believe that should work. That way updates wont erase it.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

naoko15

Hello StonedFury, thank you very much for this tip, it is exactly what i was looking for. Unfortunately it doesn't work for me...the "register" link keeps opening Joomla's register form.

I have Virtuemart 2.0.20b. Do you know how to make it work with this version?

Thank you very much!

Stonedfury

It still works for me. Are you using an override? If you don't have an override file then make one and try it. Also the register link you are refering to, is that in a menu or on the login page? This fixes that link on the login page that a person can click to get to your joomla registration. If you are using a menu then just set the menu to load vm account it is the same thing.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.

jenkinhill

Kelvyn
Lowestoft, Suffolk, UK

Retired from forum life November 2023

Please mention your VirtueMart, Joomla and PHP versions when asking a question in this forum

naoko15

#4
Quote from: jenkinhill on March 24, 2013, 15:17:16 PM
naoko15 it sounds like you need this plugin: http://joomstuff.com/free/plg_vm2_joomla_user_activation.php

Thanks Jenkinhill, my idea is to have the user redirected to VM's user account page, so they can add or edit their address, witohut having two different register forms.

Quote from: Stonedfury on March 23, 2013, 20:40:03 PM
It still works for me. Are you using an override? If you don't have an override file then make one and try it. Also the register link you are refering to, is that in a menu or on the login page? This fixes that link on the login page that a person can click to get to your joomla registration. If you are using a menu then just set the menu to load vm account it is the same thing.

I'm using an override and i dont' know why it doesn't work for me. In theory, it should work without a problem.


Thanks!! : )

EDIT: it seems to be working now. Thanks for the help!

Stonedfury

That plugin is a great one and should of been a part of virtuemart. I found it a few weeks back on here. It actually logs the user into joomla and virtuemart so that the direct and login works correctly. My hack/modification just loads the user details page. If you are not logged in or registered this page will ask you to login or register with your full vm information. I am glad that you got it working.
No such thing as a stupid question, only a stupid answer. I won't ask if I know the answer or found it using the search as you suggested.