搜索
开启辅助访问 切换到宽版

QQ登录

只需一步,快速开始

扫一扫,访问微社区

注册 找回密码
查看: 6389|回复: 1
打印 上一主题 下一主题

新手求助,删除register,checkout时的选项

[复制链接]
楼主
发表于 2012-6-26 16:44:26 | 显示全部楼层
opencart是MVC模式,不像一般的程序。register.tpl里只是显示,不检查合法性。 catalog/controller/account/register.php 里有检查的代码,

函数private function validate()检查合法性,不合法的保存到先把警告语言保存到error对象中,$this->error['email'] = $this->language->get('error_email');  

if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {...}通过这段代码判断是否正确,如正确就保存到数据库$this->model_account_customer->addCustomer($this->request->post); 然后直接登录$this->customer->login($this->request->post['email'], $this->request->post['password']); 最后$this->redirect($this->url->link('account/success'));跳转到会员中心,如不正确则继续往下执行代码,不合法的地方就显示error对象中保存的信息。

比如
                if (isset($this->request->post['telephone'])) {
                    $this->data['telephone'] = $this->request->post['telephone'];
                } else {
                        $this->data['telephone'] = '';
                }

catalog/model/account/customer.php里是保存到数据库里的代码,函数public function addCustomer里的SQL命令根据需要修改
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐 上一条 /1 下一条

QQ|手机版|OpenCart - 中文官方网站 ( 蜀ICP备09033774号|人工智能

GMT+8, 2024-5-19 07:15 , Processed in 0.052077 second(s), 19 queries , Gzip On.

快速回复 返回顶部 返回列表