/var/www/html_uk/wp-content/plugins/automatewoo/admin/dashboard-widgets/analytics-conversions.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php

namespace AutomateWoo;

defined'ABSPATH' ) || exit;

/**
 * Dashboard_Widget_Analytics_Conversions class.
 *
 * @since 5.7.0
 */
class Dashboard_Widget_Analytics_Conversions extends Dashboard_Widget_Analytics {

    
/**
     * Widget's ID
     *
     * @var string
     */
    
public $id 'analytics-conversions';

    
/**
     * Report page id to be used for "view report" link.
     *
     * @var string
     */
    
protected $report_page_id 'conversions';

    
/**
     * Output the widget content.
     */
    
protected function output_content() {
        if ( ! 
$this->date_to || ! $this->date_from ) {
            return;
        }
        
?>

        <automatewoo-dashboard-chart
                aw-loading
                class="automatewoo-dashboard-chart"
                after="<?php echo esc_js$this->date_from->format'Y-m-d\TH:i:s' ) ); ?>"
                before="<?php echo esc_js$this->date_to->format'Y-m-d\TH:i:s' ) ); ?>"
                fields="net_revenue,orders_count"
                endpoint="/wc-analytics/reports/conversions/stats"
                is-currency="true,false"
                interval="<?php echo esc_js$this->get_interval() ); ?>">
            <div class="automatewoo-dashboard-chart__header">

                <div class="automatewoo-dashboard-chart__header-group">
                    <automatewoo-dashboard-chart__header-figure
                        class="automatewoo-dashboard-chart__header-figure"
                        name="net_revenue">-</automatewoo-dashboard-chart__header-figure>
                    <div class="automatewoo-dashboard-chart__header-text">
                        <span class="automatewoo-dashboard-chart__legend automatewoo-dashboard-chart__legend--blue"></span>
                        <?php esc_html_e'conversion revenue''automatewoo' ); ?>
                    </div>
                </div>

                <div class="automatewoo-dashboard-chart__header-group">
                    <automatewoo-dashboard-chart__header-figure
                        class="automatewoo-dashboard-chart__header-figure"
                        name="orders_count">-</automatewoo-dashboard-chart__header-figure>
                    <div class="automatewoo-dashboard-chart__header-text">
                        <span class="automatewoo-dashboard-chart__legend automatewoo-dashboard-chart__legend--purple"></span>
                        <?php esc_html_e'conversions''automatewoo' ); ?>
                    </div>
                </div>

                <?php $this->output_report_arrow_link(); ?>
            </div>

            <div class="automatewoo-dashboard-chart__tooltip"></div>

            <automatewoo-dashboard-chart__flot
                class="automatewoo-dashboard-chart__flot"><span class="aw-loader">&nbsp;</span></automatewoo-dashboard-chart__flot>

        </automatewoo-dashboard-chart>

        <?php
    
}
}

return new 
Dashboard_Widget_Analytics_Conversions();