dongzhan2461 2019-06-10 19:39
浏览 52

如何在opencart中使用json对象登录用户?

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:)

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 用hfss做微带贴片阵列天线的时候分析设置有问题
    • ¥50 我撰写的python爬虫爬不了 要爬的网址有反爬机制
    • ¥15 Centos / PETSc / PETGEM
    • ¥15 centos7.9 IPv6端口telnet和端口监控问题
    • ¥120 计算机网络的新校区组网设计
    • ¥20 完全没有学习过GAN,看了CSDN的一篇文章,里面有代码但是完全不知道如何操作
    • ¥15 使用ue5插件narrative时如何切换关卡也保存叙事任务记录
    • ¥20 海浪数据 南海地区海况数据,波浪数据
    • ¥20 软件测试决策法疑问求解答
    • ¥15 win11 23H2删除推荐的项目,支持注册表等