I understand the CMV model but cannot make sense out of the coding. My former cart used 1file and a template and queries not all the $This stuff. So I thought I was trying to something simple to get my head around it, but a week later, I have a major headache.
What I started with was editing order_list.tpl which I figured out uses controller/order.php and model/order.php. I decided to remove the total and date added columns I really didn't need. Got that done no, problem.
Then I wanted to add a column for products that would pull in a list of all the model numbers that were ordered on each order to make it easy for myself to figure out who gets what when I get in a shipment.
Looking at the controller file, it looks like model is already defined, so in order_list.tpl, I added <td class="left"><?php echo $order['model']; ?></td> where I wanted it to be and nothing.
So I looked at the controller file and found the section starting... " private function getList() {" which I think generates the list the order_list.tpl shows.
I found an array in that section that looks like is what pulls the list for the tables:
Code: Select all
$this->data['orders'][] = array(
'order_id' => $result['order_id'],
'customer' => $result['customer'],
'status' => $result['status'],
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])),
'selected' => isset($this->request->post['selected']) && in_array($result['order_id'], $this->request->post['selected']),
'action' => $action
);
Code: Select all
$this->data['orders'][] = array(
'order_id' => $result['order_id'],
'customer' => $result['customer'],
'status' => $result['status'],
'model' => $result['model'],
'total' => $this->currency->format($result['total'], $result['currency_code'], $result['currency_value']),
'date_added' => date($this->language->get('date_format_short'), strtotime($result['date_added'])),
'date_modified' => date($this->language->get('date_format_short'), strtotime($result['date_modified'])),
'selected' => isset($this->request->post['selected']) && in_array($result['order_id'], $this->request->post['selected']),
'action' => $action
);