ads2u Posted February 26, 2014 Share Posted February 26, 2014 Hi, I'm using ps 1.5.6.2. May i know how to automatically assign register customer to another new customer group? I have read this related topics but unable to implement. have four customer group id : Group1 : Visitor 2 ; Guest 3 : Customer 4 ; NonCustomer In my situation i want every successful registration will goes to group id 4 which is NonCustomer group. Please guide me, very thanks :-) Link to comment Share on other sites More sharing options...
NemoPS Posted February 26, 2014 Share Posted February 26, 2014 I am not sure it can be done from the back office. However, for sure you have a configuration entry in the database named PS_CUSTOMER_GROUP, you can change that to 4, it should set it as default customer group Link to comment Share on other sites More sharing options...
ads2u Posted February 27, 2014 Author Share Posted February 27, 2014 I am not sure it can be done from the back office. However, for sure you have a configuration entry in the database named PS_CUSTOMER_GROUP, you can change that to 4, it should set it as default customer group using that way, i have to manually change the value in phpmyadmin/mysql to 4. I'm sure it can be done by editing some file/php. by my skill is limited to do that. Hope someone can help me Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 classes/Customer.php public function __construct($id = null) { $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); parent::__construct($id); } default customer group is defined in (int)Configuration::get('PS_CUSTOMER_GROUP'); code it's a part of ps_configuration table. so you can do it in two ways, change customer.php class, instead of (int)Configuration::get('PS_CUSTOMER_GROUP'); use other customer group or just alter PS_CUSTOMER_GROUP in database Link to comment Share on other sites More sharing options...
ads2u Posted February 27, 2014 Author Share Posted February 27, 2014 classes/Customer.php public function __construct($id = null) { $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); parent::__construct($id); } default customer group is defined in (int)Configuration::get('PS_CUSTOMER_GROUP'); code it's a part of ps_configuration table. so you can do it in two ways, change customer.php class, instead of (int)Configuration::get('PS_CUSTOMER_GROUP'); use other customer group or just alter PS_CUSTOMER_GROUP in database thanks. for 2nd choice which is to alter PS_CUSTOMER_GROUP in database, i don't think it is reliable with my case. and for the 1st choice, can you give me clearly instruction how to do that, i am not expert in php skills. my classes/customer.php from line 194-205 is like below, and assume the default group id i want is 4. can you give me clear instruction on this? protected static $_defaultGroupId = array(); protected static $_customerHasAddress = array(); protected static $_customer_groups = array(); public function __construct($id = null) { $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); parent::__construct($id); } public function add($autodate = true, $null_values = true) { thanks Link to comment Share on other sites More sharing options...
vekia Posted February 27, 2014 Share Posted February 27, 2014 change this line: $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); to $this->id_default_group = 4; Link to comment Share on other sites More sharing options...
farhat Posted March 19, 2014 Share Posted March 19, 2014 i changed this line $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); to $this->id_default_group = 1; but nothing changed Link to comment Share on other sites More sharing options...
NemoPS Posted March 19, 2014 Share Posted March 19, 2014 You have to set it to 4, as vekia said, not 1 1 is visitor Link to comment Share on other sites More sharing options...
farhat Posted March 19, 2014 Share Posted March 19, 2014 Yes i know what vekia said, My case, the default customer group after registration is not the visitor, I dont't know whay but the new member is register by default in the group 3. I try to return the default customer group after registration is the visiter (who is id 1) Link to comment Share on other sites More sharing options...
NemoPS Posted March 19, 2014 Share Posted March 19, 2014 Try changing it to inside the add() method as well if ($this->id_default_group == Configuration::get('PS_CUSTOMER_GROUP')) if ($this->is_guest) $this->id_default_group = (int)Configuration::get('PS_GUEST_GROUP'); else $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); Link to comment Share on other sites More sharing options...
farhat Posted March 19, 2014 Share Posted March 19, 2014 I already do, and also the new member is register by default in the group 3. may be the problem in the database but i don't know at what level Link to comment Share on other sites More sharing options...
NemoPS Posted March 19, 2014 Share Posted March 19, 2014 Try with the database entry at this point. It seems the only way around. Or maybe you are using a customer class override? Link to comment Share on other sites More sharing options...
farhat Posted March 19, 2014 Share Posted March 19, 2014 I modified the Customer.php in root/classes Link to comment Share on other sites More sharing options...
NemoPS Posted March 19, 2014 Share Posted March 19, 2014 Well then yes, try with the db entry, I'm clueless Link to comment Share on other sites More sharing options...
BZZYBI Posted July 30, 2016 Share Posted July 30, 2016 change this line: $this->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP'); to $this->id_default_group = 4; Thank you very much. This worked for me. but I would also like to change the "Group access" With the above change only the "Default customer"r group was updated. How can do the same with "Group access" ? Thank you Link to comment Share on other sites More sharing options...
Recommended Posts