dredsman Posted January 16, 2023 Share Posted January 16, 2023 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 More sharing options...
juanrojas Posted January 17, 2023 Share Posted January 17, 2023 Hello, I don't know if this answers your question but did you check payment>preferences? Also check store parameters>customer settings>groups Link to comment Share on other sites More sharing options...
dredsman Posted January 19, 2023 Author Share Posted January 19, 2023 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. Link to comment Share on other sites More sharing options...
dredsman Posted January 19, 2023 Author Share Posted January 19, 2023 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 Link to comment Share on other sites More sharing options...
dredsman Posted January 19, 2023 Author Share Posted January 19, 2023 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 More sharing options...
badi3 Posted November 19, 2023 Share Posted November 19, 2023 Hi Dredsman, hope you still on the forum as I have sort of the same issue. Just wondering how you get the people from the default "guest group" to the "client group" after they have made a succesful purchase? cheers Link to comment Share on other sites More sharing options...
dnk.hack Posted November 19, 2023 Share Posted November 19, 2023 (edited) 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 November 19, 2023 by dnk.hack (see edit history) Link to comment Share on other sites More sharing options...
badi3 Posted November 21, 2023 Share Posted November 21, 2023 Hi dnk, No idea what to do with your suggestion. The dredsman system works great. I,ve added a module to switch the client from the "group without orders" to "group clients" after the made theyre first order. Condition based om amount spend in the shop. https://addify.store/product/prestashop-automatic-customer-group-switcher/ Link to comment Share on other sites More sharing options...
dnk.hack Posted November 21, 2023 Share Posted November 21, 2023 You have to know 1 rule for developers! If all works don't touch 😉 Have a good one! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now