/** * If meta_data or shipping_address are empty, exclude them altogether. */ public function get_data() { $data = parent::get_data(); if (count($data['meta_data']) == 0) { unset($data['meta_data']); } if (count($data['shipping_address']) == 0) { unset($data['shipping_address']); } if (count($data['billing_address']) == 0) { unset($data['billing_address']); } return $data; }
public function get_data() { $data = parent::get_data(); $data['total'] = $this->total; return $data; }