Jump to content

Disable new customers by default


spk

Recommended Posts

Hello there!


 


I'm facing a little problem here, I want my customers status set to disabled by default when creating a new account in my shop.


 


I have been looking at the file AuthController.php and "$customer->active = 1;".


 


If I set it to 0, it actually works. But now the problem is that it also disables the guest checkout.


 


Customers should be able to use the guest checkout, but if they want to create an account, the admin must set their status to enabled first.


 


How do I solve this?


Link to comment
Share on other sites

it would seem you changed the code, there are two places

 

the area you want your code, i.e. set to zero(0) is

 

        if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))

 

 

 
if (!Configuration::get('PS_REGISTRATION_PROCESS_TYPE') && !$this->ajax && !Tools::isSubmit('submitGuestAccount'))
{
 
if (!count($this->errors))
{
if (Tools::isSubmit('newsletter'))
$this->processCustomerNewsletter($customer);
$customer->birthday = (empty($_POST['years']) ? '' : (int)$_POST['years'].'-'.(int)$_POST['months'].'-'.(int)$_POST['days']);
if (!Validate::isBirthDate($customer->birthday))
$this->errors[] = Tools::displayError('Invalid birthday.');
$customer->active = 0;
 
This part? 
 
If I put $customer->active to 0, I can't log in on any account.
 
I'm using v. 1.5.3.1.
Link to comment
Share on other sites

that would be the area I think.

 

curious as to you want to allow guest check out but not regular registrations....

 

Alright, but it doesn't work for me.

 

When I set active = 0 nothing changes, you can still register an account and log in as usual.

 

Any other ways to do this?

 

I don't know, its not for me, its for a friend and he wants it that way...

Link to comment
Share on other sites

  • 5 years later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...