VirtueMart Forum

VirtueMart 2 + 3 + 4 => Administration & Configuration => Topic started by: ChristerE on May 24, 2012, 17:24:06 PM

Title: User logged in to VirtueMart but not to Joomla upon registration
Post by: ChristerE on May 24, 2012, 17:24:06 PM
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?
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Magnascan on May 25, 2012, 00:12:50 AM
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
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Merry on May 29, 2012, 02:13:34 AM
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
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: pbc278 on June 14, 2012, 16:08:22 PM
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 ?
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: pbc278 on June 15, 2012, 01:26:54 AM
 :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 !?
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: pbc278 on June 15, 2012, 01:41:34 AM
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  :-[
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: nicole2292 on July 30, 2012, 14:42:59 PM
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.
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: nicole2292 on July 31, 2012, 00:07:47 AM
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....
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Joe Bourque on August 05, 2012, 23:06:40 PM
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
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: freshqa on August 06, 2012, 09:20:44 AM
Same problem as listed above, can please a developer comment on it?
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Honza on August 08, 2012, 16:38:09 PM
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 :)
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: freshqa on December 21, 2012, 12:51:58 PM
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.
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: jenkinhill on December 21, 2012, 16:22:56 PM
Use .htaccess to force all urls to use www.  (or to remove www. if entered by the user). See http://forum.virtuemart.net/index.php?topic=99755.msg373786#msg373786
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Milbo on December 21, 2012, 17:12:45 PM
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".
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: freshqa on December 22, 2012, 01:31:19 AM
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 =/
Title: Re: User logged in to VirtueMart but not to Joomla upon registration
Post by: Milbo on December 22, 2012, 13:23:49 PM
freshqa, good how you take my rant. It is not meant personal, we are just tired of being accused. You may follow Nikolas the guy from akeeba in facebook. He has funny stories about customers asking for things which are impossible, because the reason is the hosting.

It is not so that we did it best, maybe there is another way avoiding the problem. But for SEO it is anyway better to work only with one domain.

Quote from: Wikipedialink=http://en.wikipedia.org/wiki/World_Wide_Web
WWW prefix

Many domain names used for the World Wide Web begin with www because of the long-standing practice of naming Internet hosts (servers) according to the services they provide. The hostname for a web server is often www, in the same way that it may be ftp for an FTP server, and news or nntp for a USENET news server. These host names appear as Domain Name System or [domain name server](DNS) subdomain names, as in www.example.com. The use of 'www' as a subdomain name is not required by any technical or policy standard and many web sites do not use it; indeed, the first ever web server was called nxoc01.cern.ch.[28] According to Paolo Palazzi,[29] who worked at CERN along with Tim Berners-Lee, the popular use of 'www' subdomain was accidental; the World Wide Web project page was intended to be published at www.cern.ch while info.cern.ch was intended to be the CERN home page, however the dns records were never switched, and the practice of prepending 'www' to an institution's website domain name was subsequently copied. Many established websites still use 'www', or they invent other subdomain names such as 'www2', 'secure', etc. Many such web servers are set up so that both the domain root (e.g., example.com) and the www subdomain (e.g., www.example.com) refer to the same site; others require one form or the other, or they may map to different web sites.

The use of a subdomain name is useful for load balancing incoming web traffic by creating a CNAME record that points to a cluster of web servers. Since, currently, only a subdomain can be used in a CNAME, the same result cannot be achieved by using the bare domain root.

When a user submits an incomplete domain name to a web browser in its address bar input field, some web browsers automatically try adding the prefix "www" to the beginning of it and possibly ".com", ".org" and ".net" at the end, depending on what might be missing. For example, entering 'microsoft' may be transformed to http://www.microsoft.com/ and 'openoffice' to http://www.openoffice.org. This feature started appearing in early versions of Mozilla Firefox, when it still had the working title 'Firebird' in early 2003, from an earlier practice in browsers such as Lynx.[30] It is reported that Microsoft was granted a US patent for the same idea in 2008, but only for mobile devices.[31]

In English, www is usually read as double-u double-u double-u. Some users pronounce it dub-dub-dub, particularly in New Zealand. Stephen Fry, in his "Podgrammes" series of podcasts, pronouncing it wuh wuh wuh. The English writer Douglas Adams once quipped in The Independent on Sunday (1999): "The World Wide Web is the only thing I know of whose shortened form takes three times longer to say than what it's short for". In Mandarin Chinese, World Wide Web is commonly translated via a phono-semantic matching to wàn wéi wǎng (万维网), which satisfies www and literally means "myriad dimensional net",[32] a translation that very appropriately reflects the design concept and proliferation of the World Wide Web. Tim Berners-Lee's web-space states that World Wide Web is officially spelled as three separate words, each capitalised, with no intervening hyphens.[33]

Use of the www prefix is declining as Web 2.0 web applications seek to brand their domain names and make them easily pronounceable.[34] As the mobile web grows in popularity, services like Gmail.com, MySpace.com, Facebook.com, Bebo.com and Twitter.com are most often discussed without adding www to the domain (or, indeed, the .com).