News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

User logged in to VirtueMart but not to Joomla upon registration

Started by ChristerE, May 24, 2012, 17:24:06 PM

Previous topic - Next topic

ChristerE

Scenario:

A new user creates a Virtuemart account, all is ok, the user is redirected to account maintanance page and is logged in to VirtueMart BUT when I go to the Joomla Login module the user IS NOT logged in??!!

Any suggestions how to solve this?

Magnascan

Hi All

I have the same problem, I have tried 2.0.6 and 2.0.7 and 2.0.6 creates a user but the activation email does not work (it just takes you to the home page) and 2.0.7 does not create a joomla user in the backend when a visitor tries to register (but you can still check out). Can anyone tell me how to get virtuemart 2 to allow me to get shoppers to register so that they need to activate their account with the joomla activation email?

Cheers

Steve

Merry

Quote from: Magnascan on May 25, 2012, 00:12:50 AM
Can anyone tell me how to get virtuemart 2 to allow me to get shoppers to register so that they need to activate their account with the joomla activation email?
Cheers
Steve

In JOOMLA go to USERS - User Manager - far top right OPTIONS Icon, then change NEW USER ACCOUNT ACTIVATION to "SELF" and click the SAVE Button.

Merry
Answer is probably from my VirtueMart 2 User Manual ebook, includes FREE updates. FREE Admin Menu Cheatsheet, Quick Install Guide & 30-Minute Quick Setup Guide http://showmeguides.com/

pbc278

Same issue here. Have a module loaded with joomla login in the top menu, when I log into joomla using the virtuemart cart inlog function, the joomla module still doesn't display username and greeting.
But virtuemart does greet the user.

When I first log into Joomla via the module then virtuemart is also logged in, so the other way around works....
Seems lik it's a bug...

Joomla! 2.5.4
Virtuemart 2.0.6

Suggestions Anyone ?

pbc278

 :P I fixxed this issue in my Virtuemart 2.06 / Joomla 2.5.4 config.

go to the file: components\com_virtuemart\controllers\user.php
find this part:
if($currentUser->id==0){
$msg = (is_array($ret)) ? $ret['message'] : $ret;
$usersConfig = &JComponentHelper::getParams( 'com_users' );
$useractivation = $usersConfig->get( 'useractivation' );
if (is_array($ret) && $ret['success'] && !$useractivation) {
// Username and password must be passed in an array
$credentials = array('username' => $ret['user']->username,
  'password' => $ret['user']->password_clear
);
$return = $mainframe->login($credentials);


This part should do the correct login, but it is skipped completely because when it reaches this part the variable '$currentUser' is never '0', but has the value of the new user ID that is created when the entered userdata is stored... SO, first change the first line to:

if($currentUser->id!=0){

then you can see the return of this part sould be the login action, but the line '$return = $mainframe->login($credentials);' does not do anything, change it also to:

return $mainframe->login($credentials);

After this you are correctly logged into Joomla and Virtuemart 2!

I'm not a VM developer, but I hope this fix makes any sense and I also hope my logic is correct !?

pbc278

Quote from: pbc278 on June 15, 2012, 01:26:54 AM
then you can see the return of this part sould be the login action, but the line '$return = $mainframe->login($credentials);' does not do anything, change it also to:

This part was correct, sorry, did not know do a 'return' this way...
I was learned to write "return bla bla bla;" and not "$return = bla bla bla;"

sorry  :-[

nicole2292

I'm on Virtuemart 2.0.8e and I'm having this same problem. However your suggestion seems to have already been implemented so not sure what else I can do now.

I require activation (set to self) however as soon as the user registers they are logged into virtuemart and can purchase even though joomla does not say they are activated or logged in. This is a huge problem as it defeats the purpose of activation which is a legal requirement for our store.

Please tell me how I can fix this problem of the new registration being immediately logged in.

Site is supposed to launch tomorrow so URGENT help is appreciated.

nicole2292

Can anyone help with this? It's a huge problem... it's super URGENT. Our site must go live in under 8 hours and no-one is helping...

Please....

Joe Bourque

SO I have the complete opposite I created a user in Joomla then go to virtuemart to check out and it ask me to login.

Is anyone else seeing this problem as well. I was occuring in Virtuemart 2.0.6 and upgrade to 2.0.8e and problem still exist

freshqa

Same problem as listed above, can please a developer comment on it?

Honza

Hi guys, I solved it in this file:

components\com_virtuemart\controllers\user.php

1) Search for this line:

if($currentUser->id==0){

2) Replace it with this line:

if($ret['newId'] > 0 && $currentUser->guest){

That woks for me :)

freshqa

In 2.0.10 i fixed this issue as said above, in 2.0.14 ( Joomla 2.5.8 ) same case scenario and above fixes doesnt help for some reason:

1) user register through chekout process
2) order done, user logged into virtuemart
3) user not logged into joomla Why this is not fixed after 6 month? why include register function into cart if its not working correctly?

Need some help here please, dont tell me to just turn off registration checkbox in the cart, this is not a real solution.

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

Milbo

Quote from: freshqa on December 21, 2012, 12:51:58 PM
3) user not logged into joomla Why this is not fixed after 6 month? why include register function into cart if its not working correctly?

If you come that way then I tell you the truth.

the truth is that you was not able for 6 months todo your homework. You was not able for 6 months to learn the basics of SEO. You do not know the difference of an alias, forward or htaccess redirect. This is a basic of webserver administration. This error typically happens to user which have the first time a vserver and dont know to handle it correctly.

Sorry, but you asked for the "why".
Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

freshqa

I hope you are right,  i wasnt looking for solutions since on 2.0.10 it worked with Honza's reply above.  1st thing to do is test tomorrow. I found the .htaccess thread today and ignored since im not using manual user activation at all, didnt realise this was my case =/