registration issue

  • Posts: 29
  • Thank you received: 0
11 years 9 months ago #96548

My client wants the cart set to NOT require registration.

Under "Checkout," we have "login" - "no" and "registration" - "no registration"

The problem is that returning customers cannot purchase because the system tells them the email address is already in the system.

New customers get registered anyway. I can delete those registrations, but the probem will happen again in the future.

t

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #96619

Hi,

For that, you will probably have to edit the class "user" in "administrator/components/com_hikashop/classes/user.php", function "register()" and edit the following if condition:

		if($simplified==2){
			$this->database->setQuery('SELECT * FROM '.hikashop_table('user').' WHERE user_email = '.$this->database->Quote($userData->user_email));
			$userInDB = $this->database->loadObject();
			if(@$userInDB->user_cms_id){
				JError::raiseWarning('', JText::_('EMAIL_ADDRESS_ALREADY_USED'));
				return false;
			}
			$this->user_id = 0;
			if(isset($userInDB->user_id)){
				$this->user_id = $userInDB->user_id;
			}
			if(!$this->user_id){
				$this->user_id = $this->save($userData);
			}

			//unpublish previous addresses so that there is no information leakage
			$query = 'UPDATE '.hikashop_table('address').' AS a SET a.address_published=0 WHERE a.address_user_id='.(int)$this->user_id.' and a.address_published=1';
			$this->database->setQuery($query);
			$this->database->query();


		}

Be careful it's a core edition, you change will be lost at each update. And it require PHP knowledge.

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

  • Posts: 29
  • Thank you received: 0
11 years 9 months ago #96667

What would I change that code to?

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

  • Posts: 13201
  • Thank you received: 2322
11 years 9 months ago #96708

Hi,

My mistake, you don't have to edit the file.
The problem is that you tried to checkout with an email already used for an existing account.
If you try to checkout with a new email (never registered on your website), and then cehckout again, you will not have this error, because the mail is not registered for an account.

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

  • Posts: 29
  • Thank you received: 0
11 years 9 months ago #96750

OK, but lets say I come back tomorrow. Will it tell me I can't buy because my email address is already in the system?

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

  • Posts: 83041
  • Thank you received: 13405
  • MODERATOR
11 years 9 months ago #96753

No. TRy with a new email address that is not used by a user account on your website and you'll see that you can do as many orders with that email as you want in "no registration" mode.

The following user(s) said Thank You: bruntt

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

  • Posts: 29
  • Thank you received: 0
11 years 9 months ago #96754

Thanks. My client told me something different happened when he tested, but I believe he was mistaken.

t

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

Time to create page: 0.077 seconds
Powered by Kunena Forum