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