PluginProbe
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster / 1.6.2
SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster v1.6.2
2.6.0 trunk 1.1.0 1.1.4 1.2.1 1.2.2 1.2.3 1.2.5 1.2.9 1.3.1 1.3.2 1.5.0 1.5.1 1.5.4 1.5.7 1.5.8 1.5.9 1.6.2 1.6.5 1.6.8 1.7.2 1.7.4 1.7.5 1.7.9 1.8.1 All 42 releases
sellkit / includes / admin / components / analytics / coupon / base.php

base.php in SellKit – Funnel builder and checkout optimizer for WooCommerce to sell more, faster 1.6.2, at includes/admin/components/analytics/coupon/base.php

51 lines 795 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Sellkit\Admin\Components\Analytics\Coupon;
4
5 use Sellkit\Admin\Components\Analytics;
6
7 defined( 'ABSPATH' ) || die();
8
9 /**
10 * Components class.
11 *
12 * @since 1.1.0
13 */
14 abstract class Base {
15
16 /**
17 * Output data.
18 *
19 * @var $coupons array Discounts.
20 */
21 public $output;
22
23 /**
24 * Rule id.
25 *
26 * @var $rule_id int Rule id.
27 */
28 public $rule_id;
29
30 /**
31 * Getting chart data.
32 *
33 * @since 1.1.0
34 */
35 public function get_data() {
36 $chart_data = [];
37
38 for ( $i = Analytics::$date_range; $i >= 0; $i-- ) {
39 $time = strtotime( "-{$i} days" );
40 $date = date( 'M_d', $time );
41
42 $chart_data[] = [
43 'date' => str_replace( '_', ' ', $date ),
44 'value' => ! empty( $this->output[ $date ] ) ? floatval( $this->output[ $date ] ) : 0,
45 ];
46 }
47
48 return $chart_data;
49 }
50 }
51