Jump to content

Asign customer to Trade group if he insers company details


Recommended Posts

Hello,

As in the title, is it possible to assign customer to a different than a default customer group when he registers? I know it could be easily done via cron script that would go through entire database and just change ID of the customer group, but how to do that during checkout?

If "company" field is filled during checkout he is assigned to "trade" group. Any idea how to do that?

Thanks

Link to comment
Share on other sites

In case anybody were interested and having similar issue, AuthController.php processSubmitAccount() function needs an override. 

after line 244:

                            if($is_company)
                            {
                            $customer->addGroups(array(4));
                            }
                            else
                            {
                            $customer->addGroups(array((int)Configuration::get('PS_CUSTOMER_GROUP')));
                            }

Group 4 is my "Trade" group ID.

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