Hooks Names Required For Company Registration

When a vendor applies for an account we want to send him sms for registration application received ack.

Any hooks for this purpose.

Couldnt find anything in companies.php file.

You can use the update_company hook in the fn_update_company function (app/functions/fn.companies.php)

Update company will fire when the company isapproved ( active) by the admin.

We want to do the sms event after the vendor applies for registration.

Use a pre controller conditioned on a post request for the frontend companies controller.

can u please elaborate how to implement this file wise.

Update company will fire when the company isapproved ( active) by the admin.

We want to do the sms event after the vendor applies for registration.

There is the $action variable in this hook. So you can use the following code to check if the vendor applies for registration

if (AREA == 'C' && $action == 'add') {
    ...
}

can u please elaborate how to implement this file wise.

File: app/addons/my_changes/controllers/frontend/companies.pre.php

Then look at whether the $_SERVER['REQUEST_METHOD'] is 'POST' and take the appropriate action. You should have all the company info available in the $_REQUEST data.

ok thx will chk

There is the $action variable in this hook. So you can use the following code to check if the vendor applies for registration

if (AREA == 'C' && $action == 'add') {
    ...
}

Ecom where to add this code ( file)

Ecom where to add this code ( file)

You can use this code in the fn_YOUR_ADDON_update_company function. Did not forget to init hook in the init.php file of your module

File: app/addons/my_changes/controllers/frontend/companies.pre.php

Then look at whether the $_SERVER['REQUEST_METHOD'] is 'POST' and take the appropriate action. You should have all the company info available in the $_REQUEST data.

Shouldnt this be in companies.post.php so that if the company has been added then we send the sms , incase there could be an error on company addition sms will still go if we use the pre controller ??

Trouble with handling POSTed data in a 'post' controller is that sometimes a controller will redirect after handling the POSTed data itself and the 'post' controller will never be called while request_method is POST. But yes, if there are errors in the form data then it could be a problem. About the only one I can think of that would be fatal would be a duplicate email address (in that case the company wouldn't be created and you would have sent an SMS). You can review the standard controller code and duplicate some of the validation if you are concerned about it having errors.

Cs-cart is very flexible. Using the update_company hook as Ecom suggested gets you past some of the validation issues and is but one of many alternatives as well as a pre controller. Each has it merits. Note also that different merchants have different technical skills so sometimes setting up and using hooks can be a struggle for them versus just adding code to a controller.

If you don't know how to code then I'd strongly suggest you work with someone who can.

If you've been modifying distributed code, then hiring a developer to go in and try to fix it or reconstruct it is now going to be more expensive than if you'd simply hired someone who knew what they were doing to start with. Not a criticism, just facts.

Be happy to work with you, but advice is free, work is not.

Then you were not posting data to the 'companies' controller. But an 'add' should be a POST.