New thread for user confirmation in CB

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4840

This thread topic was part of the tread about removing the password from the confirmation email. I am posting the original quotes here then will follow with my reply.

bthayer wrote:


As I was testing this out I noticed that if a user confirms his account by clicking the link in his email generated from HikaShop, HikaShop recognizes him as a user but CB only enables the account but does not approve it. Then if you click on "view profile" in the front end you get this error in red letters:

This user has not yet confirmed his email address and account!
This user has not yet been approved by a moderator!

Which of course is incorrect because HikaShop created the user and let the transaction go through. I need the user to be approved after he confirms so that I can redirect him to his order page after submitting the Authorize.net payment.


nicolas wrote:

Indeed, when a user registers via HikaShop, like when a user registers via joomla, his account will be confirmed in joomla but won't be confirmed in CB because CB has a special table with the user information instead of using joomla's confirmed value.

What you can do is edit the file components/com_hikashop/controllers/checkout.php and add the code:

			if($user_id && file_exists(JPATH_ROOT.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.php')){
				 $db->setQuery('REPLACE #__comprofiler SET (cbactivation,id) VALUES (\'\','.$user_id.')');
				 $db->query();
			}
just after the line
$user_id = $class->getID($user->get('id'));
which should confirm the user in CB as well.

Last edit: 13 years 10 months ago by bthayer.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4841

I added the code but now when I click on the email link I get a 500 Internal server error:

0
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, This email address is being protected from spambots. You need JavaScript enabled to view it. and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.



I go back to the email and click the link a second time and it works fine! :huh:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #4853

Please try with this code instead:

			if($id && file_exists(JPATH_ROOT.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.php')){
				 $db->setQuery('REPLACE #__comprofiler (cbactivation,id,user_id) VALUES (\'\','.$id.','.$id.')');
				 $db->query();
			}

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4906

So far this is code is not working. I don't get the error but the user is not confirmed in the CB user list and if they try to click on My Profile link it says user is not confirmed.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #4920

Could you try with the code:

 if($user->get('id') && file_exists(JPATH_ROOT.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.php')){ 
                 $db->setQuery('REPLACE #__comprofiler (cbactivation,id,user_id) VALUES (\'\','.(int)$user->get('id').','.(int)$user->get('id').')'); 
                 $db->query(); 
  }

We did some tests with CB on our end and it worked with that code.

Last edit: 13 years 10 months ago by nicolas.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4933

These 3rd lines of code you just provided behaved like the first. After clicking the confirmation link in the email I got a 500 internal server error. Then I click on it again and it worked. At checkout I had to click the "Next" button twice on each step. I replaced the lines with your second version and it verifies the user registration but does not confirm it. The user is able to checkout cleanly until the end. (However, there is no re-direct back to the site. I think I started a new thread for that topic.)

When the user returns to the site he cannot view his profile page. He can edit it because I added the Edit Profile link to the CB login module. In edit mode, however, the orders tab is not visible. Sounds like I'm going to have to run with it this way but create a visible menu for the My Orders page. If the user clicks on the "My Miser Profile" menu item (visible when logged in) he get these errors in red:

This user has not yet confirmed his email address and account!
This user has not yet been approved by a moderator!

To recreate the error:
1) Click on the link in the "Miser Shopping Cart" that says "Order your HeatMiser™ NOW for only $297 – Click Here!"
2) Click Next and register a user
3) look in your email and click the link, you are redirected back to the first page of the checkout process
4) Notice there is now a new menu item at to top that reads "My Miser Profile"
5) Click that menu item and notice the error message

Note: Shortly I will be adding a sub menu item to "My Miser Profile" for the My Orders page.

I noticed that you have created a test user. You might be able to log in with that user id and click the "My Miser Profile" menu item and get the error too.

Thanks for all your help,
Bill

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #4935

Ah, you need to remove the SET from the query. I mistakenly copied the wrong code. I edited my previous post and removed it from there.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4942

Nope, Still producing the error. I left it that way in case you want to see it for yourself.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 10 months ago #4945

Mmm that's strange. Anyway, we will publish before the end of the week a new version of HikaShop with the CB activation implemented. We already tested it on our end and it's working well so you should have it working by just updating. In the mean time, you can always activate manually the users in CB.

Please Log in or Create an account to join the conversation.

  • Posts: 73
  • Thank you received: 0
13 years 10 months ago #4949

Ok,
Thank you. I've replaced the code again now. Looking forward to the update.
-Bill

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
13 years 9 months ago #6293

Hi I have the Hika free v1.4.4 stable installed as well as CB latest v.
I have activated the CB / Hika user integration plugin
1. On registration during checkout the user is not activated in CB - your change log says this works - how can I auto approve / activate a new user in CB? CB settings have email activation set to 'No'.
2. Is it possible to use CB for the user registration during checkout so their profile is directly populated on registration - this would also possibly solve the auto activation issue.

I really like the system you have developed and find the checkout to be much more efficient than VM. Bravo!

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #6302

1. Actually, we made it work with the activation email. If you don't require activation in joomla, then, the user wil be activated in joomla but not in CB.
Could you edit the file administrator/components/com_hikashop/classes/user.php and change the code:

$app->redirect(hikashop::completeLink('checkout&task=activate_page',false,true));
			}
by the code
$app->redirect(hikashop::completeLink('checkout&task=activate_page',false,true));
			}elseif(file_exists(JPATH_ROOT.DS.'components'.DS.'com_comprofiler'.DS.'comprofiler.php')){
				$newUser = $this->get($this->user_id);
				$this->database->setQuery('REPLACE #__comprofiler (cbactivation,id,user_id) VALUES (\'\','.(int)$newUser->user_cms_id.','.(int)$newUser->user_cms_id.')');
				$this->database->query();
			}
near the end of the file ? That should activate the user automatically in CB when you don't require a user activation in joomla.
2. No, it's not possible.

Please Log in or Create an account to join the conversation.

  • Posts: 3
  • Thank you received: 0
13 years 9 months ago #6350

Thanks for the quick reply.
The code did indeed auto activate the CB user.
However this is currently what happens on checkout
1. Add to cart
2. Register (using Hika shop form / Add address etc)
3. Payment through paypal

After checkout the user is then logged in on the frontend and can view his orders using the HikaShop User Control Panel menu item.
However they cannot view their CB profile - it gives the message you must register or log in

When I go to logout it wont allow logout to take place and the session is still active- I have to clear the browser cache to logout.
When I re login I can view the CB profile with the Hika shop order and I can also view the orders using the HikaShop User Control Panel menu item.

Here is a link to the website under development

Thank you for your response to date - I will be happy to donate to the project if this issue is sorted as I anticipate using your system in the future over VM.

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
13 years 9 months ago #6361

Thank you for your report. We were able to reproduce the problem you're describing on our end and after several hours of debugging, we found the cause of the problem. We made some changes in HikaShop to fix the problem. If you download HikaShop on our website and install over your current version that should fix the problem.

Please Log in or Create an account to join the conversation.

Time to create page: 0.095 seconds
Powered by Kunena Forum