Author Topic: VM2 Customer registration  (Read 38362 times)

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #30 on: May 19, 2012, 21:20:28 pm »
I'm using VM2.0.6 & Joomla 2.5.4.  When I set the New User Activation = None, it does allow the customer to register and buy at the same time, but it does NOT include the required tax.  I also noticed when registering & buying from the VM cart it does NOT log the user into Joomla during that initial VM registration time.  It only logs the user into VM.  If the customer logs out using the VM cart and then logs back in from the VM cart or the Joomla login, it does log into both VM & Joomla, and then the tax is applied properly.  So this problem only occurs during the initial registration & buy from the VM cart.   Is there a fix for this problem?   

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #31 on: May 22, 2012, 22:32:01 pm »
Any help on this issue?

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #32 on: May 25, 2012, 19:37:57 pm »
Guys, help us!  Read my post from May 19th.  VM is not charging tax when user first registers from the shopping cart when buying for the first time.  Since VM does not log user into Joomla at the time user first registers, VM does not charge tax for that state.  This is a critical issue.  Please let us know if this is being fixed. 

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #33 on: June 01, 2012, 05:44:37 am »
Can anyone help us?

JohnnyC

  • Jr. Member
  • **
  • Posts: 53
Re: VM2 Customer registration
« Reply #34 on: June 01, 2012, 09:35:57 am »
It is a little complicated as you describe it and to be honest I haven't seen the problem clearly. My advice is, check the tax in products (when the final price is computed) and in user groups. Maybe you have a group with different tax rule than you want. Use the Joomla login and registration only for email, username and password fields (only these are "copied" to VM user when registering) and the VM registration for the rest account. So, every time the user logins, it will be through VM.
I cann't think anything more as I am not an expert... Hope the above will help...

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #35 on: June 01, 2012, 09:53:00 am »
Hi Johnny,

The problem is with the initial VM registration from the cart.  The VM team needs to fix this bug.  The tax works fine when the user logs back in after their initial registration, so the VM needs to make the initial registration from the cart set things to work like when the user logs back in.   

JohnnyC

  • Jr. Member
  • **
  • Posts: 53
Re: VM2 Customer registration
« Reply #36 on: June 01, 2012, 11:44:10 am »
So, when a user registers and logs in directly from cart, the taxes rules don't be applied?? I think the user is anonymous till the first login that becomes "default" or any other group you have. Are you sure "anonymous" and "default" have the same tax rules?
If you are pretty sure this is a bug you should pm the developers or post your question at http://forum.virtuemart.net/index.php?board=127.0 and then publish the ansewr here for us...

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #37 on: June 02, 2012, 07:27:44 am »
Hi Johnny,

That is correct... when the user first registers from within the VM cart, the user shows logged in within the VM cart, but the Joomla login module does not show the user is logged in.  And the result is that user is not charged tax if they register and buy in the same session.  If they login with the Joomla login module, or login with the VM cart login after registering in a previous session, then they are logged in to Joomla & VM and then VM charges tax correctly.   

And I cannot set tax rules for "anonymous" because then tax is added for everyone just visiting my store, even if they live in a state where tax would not be changed.  Charging tax for everyone was a previous bug I  reported and the answer from the VM team was to only set tax rules for "default" shopper group.  But maybe you hit on where the bug is... maybe VM is not changing the user to "default" shopper group when the user first registers.  Milbo, could this be the bug?   

bogusj

  • Jr. Member
  • **
  • Posts: 61
Re: VM2 Customer registration
« Reply #38 on: June 12, 2012, 21:59:19 pm »
Hi,

At the top of the shopping cart, there is the login without the new user registration link.
This confuses people who are trying to register. Of course when you click on check out, it automatically takes you to the new user registration, however most people, don't get that. Is there any way to add the new user registration at the login inside the cart?

Thanks in advance.

pbc278

  • Beginner
  • *
  • Posts: 9
Re: VM2 Customer registration
« Reply #39 on: June 14, 2012, 16:55:31 pm »
Please fix this bug! VM2 team... registering as new shopper and the auto login needs to log the user in properly, so also into Joomla!


Hi Johnny,

That is correct... when the user first registers from within the VM cart, the user shows logged in within the VM cart, but the Joomla login module does not show the user is logged in.  And the result is that user is not charged tax if they register and buy in the same session.  If they login with the Joomla login module, or login with the VM cart login after registering in a previous session, then they are logged in to Joomla & VM and then VM charges tax correctly.   

And I cannot set tax rules for "anonymous" because then tax is added for everyone just visiting my store, even if they live in a state where tax would not be changed.  Charging tax for everyone was a previous bug I  reported and the answer from the VM team was to only set tax rules for "default" shopper group.  But maybe you hit on where the bug is... maybe VM is not changing the user to "default" shopper group when the user first registers.  Milbo, could this be the bug?   

pbc278

  • Beginner
  • *
  • Posts: 9
Re: VM2 Customer registration
« Reply #40 on: June 15, 2012, 01:31:16 am »
 :P I fixxed the issue in my Virtuemart 2.06 / Joomla 2.5.4 config, after registration in the checkoutprocess you are not correctly logged into Joomla...
with this post you can fix the problem....

go to the file: components\com_virtuemart\controllers\user.php
find this part:
Code: [Select]
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:

Code: [Select]
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:

Code: [Select]
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 !?
Also I hope this bug can be resolved in future updates of VM2!


pbc278

  • Beginner
  • *
  • Posts: 9
Re: VM2 Customer registration
« Reply #41 on: June 15, 2012, 01:38:47 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  :-[

cas

  • Jr. Member
  • **
  • Posts: 487
Re: VM2 Customer registration
« Reply #42 on: June 15, 2012, 06:48:22 am »
Thanks pbc.

Can someone on the VM team confirm this is being fixed in the next release?

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: VM2 Customer registration
« Reply #43 on: June 26, 2012, 14:52:23 pm »
@pbc278

I have tried using your code, but it doesnt work for me. Im also using Virtuemart 2.0.6 with Joomla 2.5.4

Whenever a new customer completes an order and creates an account the completion page is shown but the login-module says that the customer is not logged in even though he/she is logged into Virtuemart. Another thing is that the cart is not empty after order completion either..

I hope you can help me with this.

Genius WebDesign

  • 3rd party VirtueMart Developer
  • Jr. Member
  • *
  • Posts: 175
    • Genius WebDesign
Re: VM2 Customer registration
« Reply #44 on: June 26, 2012, 15:04:00 pm »
@pbc278

Update.. The thing about the cart not emptying was related to the payment plugin. Thats solved now.
The login after registration-issue is still a problem, though