0
我想加入Opencart的新的输入文字, 我看来payment_method.tpl我加未定义指数(Opencart的)
<label><?php echo $text_comments; ?></label>
<textarea name="comment" rows="8" style="width: 98%;"><?php echo $comment; ?></textarea>
<label><?php echo $text_referred; ?></label> // My Code
<input type="text" name="referred" value="<?php echo $referred; ?>" />
在控制器payment_method.tpl我加入
if (!$json) {
$this->session->data['payment_method'] = $this->session->data['payment_methods'][$this->request->post['payment_method']];
$this->session->data['comment'] = strip_tags($this->request->post['comment']);
$this->session->data['referred'] = $this->request->post['referred']; //My Code
}
和
if (isset($this->session->data['referred'])) {
$this->data['referred'] = $this->session->data['referred']; //Variable
} else {
$this->data['referred'] = '';
}
在我的模型Order.php
$this->db->query("INSERT INTO `" . DB_PREFIX . "order` SET invoice_prefix = '" . $this->db->escape($data['invoice_prefix']) . "', referred = '" . $this->db->escape($data['referred']) . "',
我的错误日志显示
2014-09-21 12:57:42 - PHP Notice: Undefined index: referred in /home/dlars/public_html/tempdir/vqmod/vqcache/vq2-catalog_controller_checkout_payment_method.php on line 212
2014-09-21 12:57:42 - PHP Notice: Undefined index: referred in /home/dlars/public_html/tempdir/vqmod/vqcache/vq2-catalog_model_checkout_order.php on line 4
我收集无论是在我的观点没有被贴到我的控制器,但是我不确定我可以定义的其他位置。 我认为与OC无论是在视图内定义,它张贴到控制器?
有人请帮助
在此先感谢
不错!环顾四周,并没有提及任何地方 – user2015172 2014-09-28 09:14:37