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
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Wcap_Atc_Dashboard' ) ) {
class Wcap_Atc_Dashboard {
public static function wcap_display_atc_dashboard( $wcap_atc_data ) {
$wcap_total_atc_open = ( isset( $wcap_atc_data[ 'wcap_atc_open' ] ) ) ? $wcap_atc_data[ 'wcap_atc_open' ] : 0 ;
$wcap_total_atc_has_email = ( isset ( $wcap_atc_data[ 'wcap_has_email' ] ) ) ? $wcap_atc_data[ 'wcap_has_email' ] : 0 ;
$wcap_total_atc_not_has_email = ( isset( $wcap_atc_data[ 'wcap_not_has_email' ] ) ) != '' ? $wcap_atc_data[ 'wcap_not_has_email' ] : 0;
$wcap_ratio_email_captured_from_atc = 0;
if ( $wcap_total_atc_open > 0 && $wcap_total_atc_has_email > 0 ) {
$wcap_ratio_email_captured_from_atc = ( $wcap_total_atc_has_email / $wcap_total_atc_open ) * 100;
$wcap_wc_decimal = get_option( 'woocommerce_price_num_decimals' );
$wcap_ratio_email_captured_from_atc = round ( $wcap_ratio_email_captured_from_atc, $wcap_wc_decimal );
}
Wcap_Atc_Dashboard::wcap_display_all_data( $wcap_total_atc_open, $wcap_total_atc_has_email, $wcap_ratio_email_captured_from_atc );
}
public static function wcap_display_all_data( $wcap_total_atc_open, $wcap_total_atc_has_email, $wcap_ratio_email_captured_from_atc ) {
?>
<span class = "wcap_atc_heading"> <h1> Add To Cart Popup </h1></span>
<br>
<div class = "wcap_three_cell">
<a href = "admin.php?page=woocommerce_ac_page&action=emailsettings&wcap_section=wcap_atc_settings" class = "wcap_redirect_atc_setting button button-primary"> Edit Settings </a>
<div class = "top">
<div class = "wcap_cell_box">
<span class = "wcap_num"><?php echo $wcap_total_atc_open; ?></span>
<span class = "wcap_label">Add to Carts</span>
</div>
<div class = "wcap_cell_box">
<span class = "wcap_num"><?php echo $wcap_total_atc_has_email; ?></span>
<span class = "wcap_label">Collected Emails</span>
</div>
</div>
<div class = "wcap_graphic"></div>
<div class = "wcap_bottom">
<div class = "wcap_cell_box">
<span class = "wcap_num"><?php echo $wcap_ratio_email_captured_from_atc . '%' ?></span>
<span class = "wcap_label">Conversion Rate</span>
</div>
</div>
</div>
<?php
}
}
}