AbanteCart Community

AbanteCart Development => Development Help Needed => Topic started by: shahiran12395 on July 25, 2019, 06:12:58 AM

Title: send post data to new view
Post by: shahiran12395 on July 25, 2019, 06:12:58 AM
hi there, im creating new condition where if user exist in system2 the login controller will fetch the data from the system2 and auto register the user. so how can i auto submit the fetch data to rt='account/create'?

below is my code. i just need to post the data to account/create

Code: [Select]
//execute the POST request
                $result = curl_exec($ch);

                //close cURL resource
                curl_close($ch);

                if($result=="false"){
                    header('Location: ' . url.'?rt=account/login&false_entry_login_detail=1');
                    die();

                }
                $user_data = json_decode($result);
Title: Re: send post data to new view
Post by: abolabo on July 26, 2019, 09:20:00 AM
Hi.
You should to use hooks of controller account/create.

//before controller run (init) you can check is request POST and do something.
see https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L33

Also you can do something after account creation  https://github.com/abantecart/abantecart-src/blob/master/public_html/storefront/controller/pages/account/create.php#L75
with updateData hook