Jump to content

Change defaut costumer group


dredsman

Recommended Posts

Hello Frieds
How can i change costumer default group ? When a new customer registers, he is automatically allocated to the customer group (3) by default. I need to configure payment  methods for each group, so I would like the default to be New Customer (4) eg. , and after the credit analysis, an operator would change the group of this customer. Any suggestion?

Link to comment
Share on other sites

So, by default, when a new costumer as registered, is alowed in group costumer (3) by default;
In older versions, the classes/costumer.php declared the id_costumer_group clearly.
Attached, as stated in other older versions.
There are 3 groups:
visitor - id 1
guest -id 2
costumer - id 3
I need every new customer that registers in my store to be added to group 2, or to any other group other than the customer id 3 group.
 

group.png

Link to comment
Share on other sites

In the costumer.php
( $this->id_default_group = (int) Configuration::get('PS_CUSTOMER_GROUP');) 
This would be the line declaring the id.default_group. 
Customers now undergo a credit assessment in my store. All old customers are in group_id 3.
A solution I found would be to migrate customers who are already registered to a group id 4 eg. So I would leave the group _id 3 as default , and after the credit analysis, I would update it to group id 4. I don't know what the impact of an update like this would be on the database.
Or, change the id_default_group....

Tks
 

group2.jpg

Link to comment
Share on other sites

Hello friends, 
I found the solution, the ideal would be to be able to declare any group of clients as default, but it worked. Just replace customer with guest in the line that allowed the customer to the group.

In the classes/costumer.php
( $this->id_default_group = (int) Configuration::get('PS_CUSTOMER_GROUP');

to
( $this->id_default_group = (int) Configuration::get('PS_GUEST_GROUP');) 

Thanks

Link to comment
Share on other sites

  • 9 months later...

Hello, Prestashop has a hook for this action. Using overrides is a bad practice if you are able to use a hook! 

https://devdocs.prestashop-project.org/8/modules/concepts/hooks/list-of-hooks/actionclassnameactionbefore/

https://devdocs.prestashop-project.org/8/modules/concepts/hooks/list-of-hooks/actionclassnameactionafter/

Edited by dnk.hack (see edit history)
Link to comment
Share on other sites

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...