I need to get the average order price of a customer in M1.
Getting the totals:
$customer = $this->getCustomer();
$customerTotals = Mage::getResourceModel('sales/sale_collection')
->setOrderStateFilter(Mage_Sales_Model_Order::STATE_CANCELED, true)
->setCustomerFilter($customer)
->load()
->getTotals();
Output:
[_data:protected] => Array
(
[lifetime] => 6
[base_lifetime] => 6
[base_avgsale] => 6
[num_orders] => 1
[avgsale] => 6
)
I know I can get:
lifetime
like- $customerTotals->getLifetime()
and
num_orders
like - $customerTotals->getNumOrders()
but how do I get avgsale
?