In the Order View (the main screen when viewing a customer’s order), I would like to add a few table rows and add the Customer’s Lifetime Sales (Total Sales) and Total Amount of Orders.
The file I want to add the code is here: app/design/adminhtml/default/default/template/sales/order/view/info.phtml
In this file, below:
<?php foreach ($this->getCustomerAccountData() as $data):?>
<tr>
<td class="label"><label><?php echo $data['label'] ?></label></td>
<td class="value"><strong><?php echo $data['value'] ?></strong></td>
</tr>
<?php endforeach;?>
Is where I’d add my the rows/cells I need with the correct information. Could you please tell me how to get the necessary data?
this is how you get the lifetime sales:
This is a var_dump of $customerTotals:
You can place that code in a method on your block and call it in each row. Somthing like:
and in your code there you can add: