campaign.php
3 years ago
current_traffic.php
3 years ago
geo.php
3 years ago
page.php
3 years ago
page_author_archive.php
3 years ago
page_date_archive.php
3 years ago
page_home.php
3 years ago
page_not_found.php
3 years ago
page_post_type_archive.php
3 years ago
page_search.php
3 years ago
page_singular.php
3 years ago
page_term_archive.php
3 years ago
referrer.php
3 years ago
view_stats.php
3 years ago
visitor.php
3 years ago
wc_stats.php
3 years ago
wc_stats.php
45 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | trait WC_Stats |
| 6 | { |
| 7 | protected $wc_orders; |
| 8 | protected $wc_gross_sales; |
| 9 | protected $wc_refunds; |
| 10 | protected $wc_refunded_amount; |
| 11 | |
| 12 | final protected function set_wc_stats($row) |
| 13 | { |
| 14 | $this->wc_orders = floatval($row->wc_orders); |
| 15 | $this->wc_gross_sales = floatval($row->wc_gross_sales); |
| 16 | $this->wc_refunds = floatval($row->wc_refunds); |
| 17 | $this->wc_refunded_amount = floatval($row->wc_refunded_amount); |
| 18 | } |
| 19 | |
| 20 | final public function wc_orders() |
| 21 | { |
| 22 | return $this->wc_orders; |
| 23 | } |
| 24 | |
| 25 | final public function wc_gross_sales() |
| 26 | { |
| 27 | return $this->wc_gross_sales; |
| 28 | } |
| 29 | |
| 30 | final public function wc_refunds() |
| 31 | { |
| 32 | return $this->wc_refunds; |
| 33 | } |
| 34 | |
| 35 | public function wc_refunded_amount() |
| 36 | { |
| 37 | return $this->wc_refunded_amount; |
| 38 | } |
| 39 | |
| 40 | public function wc_net_sales() |
| 41 | { |
| 42 | return $this->wc_gross_sales - $this->wc_refunded_amount; |
| 43 | } |
| 44 | } |
| 45 |