I wanted to login user in opencart. I have json array with the data of customer. by which way i can loggin user with that json array.
I have a site having customer data. i bypass the data using curl on another opencart site. now when i load the open cart web site. it will have json array. using that user have to be logged in by itself. if database have already record of that user otherwise it will be registerd.
I fetched json array from the curl call in header file.
if(isset($_REQUEST['json'])) {
$json = json_decode($_REQUEST['json']);
$customer['customer_group_id'] = $json->customer_data->customer_group_id;
$customer['store_id'] = $json->customer_data->store_id;
$customer['language_id'] = $json->customer_data->language_id;
$customer['firstname'] = $json->customer_data->firstname;
$customer['lastname'] = $json->customer_data->lastname;
$customer['email'] = $json->customer_data->email;
$customer['telephone'] = $json->customer_data->telephone;
$customer['fax'] = $json->customer_data->fax;
$customer['password'] = $json->customer_data->password;
$customer['salt'] = $json->customer_data->salt;
$customer['code'] = $json->customer_data->code;
$this->model_account_customer->addCustomer($customer);}
Currently i am just inserting customer data to my database. but can anyone suggest me how to loggin user using this data if data is already available?
I would be greatful if anybody can help me with this login feature in opencart.
Thanks:)