这可能是一个非常简单的问题,但我找不到答案。我想将一个键/值对添加到OpenCart中的数组,但我似乎无法使其工作。我不确定我添加的内容是否已经是数组。OpenCart添加到阵列
在目录/控制器/帐户/在第66行history.php有一个阵列的定义: -
$this->data['orders'][] = array(
'order_id' => $result['order_id'],
'name' => $result['firstname'] . ' ' . $result['lastname'],
'status' => $result['status'],
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'products' => $product_total,
'total' => $this->currency->format($result['total'], $result['currency'], $result['value']),
'href' => HTTPS_SERVER . 'index.php?route=account/invoice&order_id=' . $result['order_id']
);
我要添加到使用VQMod此阵列。 VQMod不会让我在定义中替换一行。我不知道为什么,我已经尝试了几个小时,但它不会。所以我决定在它下面添加一行,如下所示: -
$ this-> data ['orders'] ['amountToPay'] = $ paymentState ['amountToPay'];
这不起作用。即使我直接在页面中输入它也没有。我认为我弄乱了语法,但没有看到如何,除非我不理解数组结构。
任何帮助表示赞赏。
您说得对。非常感谢:) – Craig 2011-04-04 18:43:25