Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 2.3.6.1

Version Description

  • 26/10/2020 =
    • Compatibility with WooCommerce 4.6.1
    • Compatibility with Wordpress 5.5.1
    • PHP warnings issue was raised in 2.3.6 by some users that is now resolved in 2.3.6.1.
Download this release

Release Info

Developer Tatvic
Plugin Icon 128x128 Enhanced Ecommerce Google Analytics Plugin for WooCommerce
Version 2.3.6.1
Comparing to
See all releases

Code changes from version 2.2.2 to 2.3.6.1

Files changed (47) hide show
  1. LICENSE.txt +0 -0
  2. admin/class-enhanced-ecommerce-google-analytics-admin.php +105 -24
  3. admin/class-enhanced-ecommerce-google-analytics-settings.php +47 -1
  4. admin/css/enhanced-ecommerce-google-analytics-admin.css +86 -1
  5. admin/images.zip +0 -0
  6. admin/images/adwords.png +0 -0
  7. admin/images/banner.png +0 -0
  8. admin/images/cotlw.gif +0 -0
  9. admin/images/cotlw.png +0 -0
  10. admin/images/discount.gif +0 -0
  11. admin/images/facebook.jpg +0 -0
  12. admin/images/google_optimize.png +0 -0
  13. admin/images/m1.png +0 -0
  14. admin/images/m2.png +0 -0
  15. admin/images/new-2.gif +0 -0
  16. admin/images/new-img.gif +0 -0
  17. admin/images/plugin_bk.png +0 -0
  18. admin/images/rating.png +0 -0
  19. admin/images/ratings.png +0 -0
  20. admin/images/shopify_new.png +0 -0
  21. admin/images/tatvic_logo.png +0 -0
  22. admin/images/woo.png +0 -0
  23. admin/images/woo_banner_adv.gif +0 -0
  24. admin/index.php +0 -0
  25. admin/js/enhanced-ecommerce-google-analytics-admin.js +10 -1
  26. admin/partials/about-plugin.php +23 -3
  27. admin/partials/enhanced-ecommerce-google-analytics-admin-display.php +19 -2
  28. admin/partials/general-fields.php +149 -87
  29. admin/partials/sidebar.php +20 -4
  30. enhanced-ecommerce-google-analytics.php +9 -4
  31. includes/class-enhanced-ecommerce-google-analytics-activator.php +0 -0
  32. includes/class-enhanced-ecommerce-google-analytics-deactivator.php +0 -0
  33. includes/class-enhanced-ecommerce-google-analytics-i18n.php +0 -0
  34. includes/class-enhanced-ecommerce-google-analytics-loader.php +0 -0
  35. includes/class-enhanced-ecommerce-google-analytics.php +20 -1
  36. includes/index.php +0 -0
  37. includes/json/client-secrets.json +26 -0
  38. includes/json/currency.json +252 -0
  39. index.php +0 -0
  40. languages/enhanced-ecommerce-google-analytics.pot +0 -0
  41. public/class-enhanced-ecommerce-google-analytics-public.php +56 -20
  42. public/css/enhanced-ecommerce-google-analytics-public.css +0 -0
  43. public/index.php +0 -0
  44. public/js/enhanced-ecommerce-google-analytics-public.js +0 -0
  45. public/partials/class-enhanced-ecommerce-google-analytics-public-display.php +0 -0
  46. readme.txt +481 -357
  47. uninstall.php +0 -0
LICENSE.txt CHANGED
File without changes
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -20,6 +20,8 @@
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
 
 
23
  class Enhanced_Ecommerce_Google_Analytics_Admin {
24
 
25
  /**
@@ -48,18 +50,75 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
48
  * @param string $version The version of this plugin.
49
  */
50
  protected $ga_id;
51
-
52
  protected $ga_LC;
53
-
54
  protected $ga_eeT;
 
55
 
56
- public function __construct( $plugin_name, $version ) {
57
 
58
  $this->plugin_name = $plugin_name;
59
  $this->version = $version;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
60
 
 
61
  }
62
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  /**
64
  * Register the stylesheets for the admin area.
65
  *
@@ -68,16 +127,17 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
68
  public function enqueue_styles() {
69
 
70
  $screen = get_current_screen();
71
- if ( $screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
72
- wp_register_style('font_awesome','//use.fontawesome.com/releases/v5.0.13/css/all.css');
73
  wp_enqueue_style('font_awesome');
74
  wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
75
  wp_enqueue_style('aga_bootstrap');
76
- wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all' );
 
 
77
  }
78
-
79
-
80
  }
 
81
  /**
82
  * Register the JavaScript for the admin area.
83
  *
@@ -86,14 +146,15 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
86
  public function enqueue_scripts() {
87
 
88
  $screen = get_current_screen();
89
- if ( $screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' ||(isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')){
90
  wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
91
  wp_enqueue_script('popper_bootstrap');
92
  wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
93
  wp_enqueue_script('aga_bootstrap');
94
- wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/enhanced-ecommerce-google-analytics-admin.js', array( 'jquery' ), $this->version, false );
 
 
95
  }
96
-
97
  }
98
 
99
  /**
@@ -103,17 +164,9 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
103
  */
104
  public function display_admin_page() {
105
  add_menu_page(
106
- 'Tatvic EE Plugin',
107
- 'Tatvic EE Plugin',
108
- 'manage_options',
109
- "enhanced-ecommerce-google-analytics-admin-display",
110
- array($this,'showPage'),
111
- plugin_dir_url(__FILE__) . 'images/tatvic_logo.png',
112
- 26
113
  );
114
-
115
  }
116
-
117
  /**
118
  * Display Tab page.
119
  *
@@ -121,13 +174,12 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
121
  */
122
  public function showPage() {
123
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
124
- if(!empty($_GET['tab'])){
125
  $get_action = $_GET['tab'];
126
- }
127
- else{
128
  $get_action = "general_settings";
129
  }
130
- if(method_exists($this, $get_action)) {
131
  $this->$get_action();
132
  }
133
  }
@@ -147,4 +199,33 @@ class Enhanced_Ecommerce_Google_Analytics_Admin {
147
  public function about_plugin() {
148
  require_once( 'partials/about-plugin.php');
149
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
150
  }
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
23
+ //require __DIR__ . '../includes/setup/CustomerClient.php';
24
+
25
  class Enhanced_Ecommerce_Google_Analytics_Admin {
26
 
27
  /**
50
  * @param string $version The version of this plugin.
51
  */
52
  protected $ga_id;
 
53
  protected $ga_LC;
 
54
  protected $ga_eeT;
55
+ protected $customerClient;
56
 
57
+ public function __construct($plugin_name, $version) {
58
 
59
  $this->plugin_name = $plugin_name;
60
  $this->version = $version;
61
+ if(isset($_SERVER['HTTPS']) && ($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
62
+ $protocol = 'https://';
63
+ } else {
64
+ $protocol = 'http://';
65
+ }
66
+ $server_name = $_SERVER['SERVER_NAME'];
67
+ $domain = $protocol.$server_name;
68
+ $woo_country = $this->woo_country();
69
+ $country = (!empty($woo_country)) ? $woo_country[0] : 'US';
70
+ $currency_code = $this->get_currency_code();
71
+ $timezone = get_option('timezone_string');
72
+ //sigin with google
73
+ $this->returnUrl = "estorenew.tatvic.com/tat_ee/ads-analytics-form.php?domain=".$domain."&country=".$country."&user_currency=".$currency_code."&timezone".$timezone;
74
+ $this->accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : '';
75
+ $this->refreshToken = isset($_GET['refresh_token']) ? $_GET['refresh_token'] : '';
76
+ $this->email = isset($_GET['email']) ? $_GET['email'] : '';
77
+
78
+ if(isset($_GET['property_id']) && isset($_GET['ads_id'])) {
79
+ $data = unserialize(get_option('ee_options'));
80
+ if(isset($data['ga_id']) && ($data['ga_id'] != $_GET['property_id'])) {
81
+ $_POST['ga_id'] = $_GET['property_id'];
82
+ $_POST['ads_id'] = $_GET['ads_id'];
83
+ } else if(isset($data['ga_id']) && ($data['ga_id'] == $_GET['property_id'])) {
84
+ if($_GET['ads_id'] != '') {
85
+ $_POST['ga_id'] = $_GET['property_id'];
86
+ $_POST['ads_id'] = $_GET['ads_id'];
87
+ } else {
88
+ $_POST['ga_id'] = $_GET['property_id'];
89
+ }
90
+ } else {
91
+ $_POST['ga_id'] = $_GET['property_id'];
92
+ $_POST['ads_id'] = $_GET['ads_id'];
93
+ }
94
+
95
+ Enhanced_Ecommerce_Google_Settings::update_analytics_options('ee_options');
96
+ }
97
 
98
+ $this->url = "https://estorenew.tatvic.com/tat_ee/ga_rdr_ee.php?return_url=" . $this->returnUrl;
99
  }
100
 
101
+ /**
102
+ * @return array
103
+ * Get woocommerce default set country
104
+ */
105
+ private function woo_country(){
106
+ // The country/state
107
+ $store_raw_country = get_option( 'woocommerce_default_country' );
108
+ // Split the country/state
109
+ $split_country = explode( ":", $store_raw_country );
110
+ return $split_country;
111
+ }
112
+ /**
113
+ * @return mixed
114
+ */
115
+ private function get_currency_code(){
116
+ $woo_country = $this->woo_country();
117
+ $country = (!empty($woo_country)) ? $woo_country[0] : 'US';
118
+ $getCurrency = file_get_contents(ENHANCAD_PLUGIN_DIR . 'includes/json/currency.json');
119
+ $contData = json_decode($getCurrency);
120
+ return $contData->{$country};
121
+ }
122
  /**
123
  * Register the stylesheets for the admin area.
124
  *
127
  public function enqueue_styles() {
128
 
129
  $screen = get_current_screen();
130
+ if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
131
+ wp_register_style('font_awesome', '//use.fontawesome.com/releases/v5.0.13/css/all.css');
132
  wp_enqueue_style('font_awesome');
133
  wp_register_style('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css');
134
  wp_enqueue_style('aga_bootstrap');
135
+ wp_register_style('aga_confirm', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css');
136
+ wp_enqueue_style('aga_confirm');
137
+ wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all');
138
  }
 
 
139
  }
140
+
141
  /**
142
  * Register the JavaScript for the admin area.
143
  *
146
  public function enqueue_scripts() {
147
 
148
  $screen = get_current_screen();
149
+ if ($screen->id == 'toplevel_page_enhanced-ecommerce-google-analytics-admin-display' || (isset($_GET['page']) && $_GET['page'] == 'enhanced-ecommerce-google-analytics-admin-display')) {
150
  wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
151
  wp_enqueue_script('popper_bootstrap');
152
  wp_register_script('aga_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js');
153
  wp_enqueue_script('aga_bootstrap');
154
+ wp_register_script('aga_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
155
+ wp_enqueue_script('aga_confirm_js');
156
+ wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/enhanced-ecommerce-google-analytics-admin.js', array('jquery'), $this->version, false);
157
  }
 
158
  }
159
 
160
  /**
164
  */
165
  public function display_admin_page() {
166
  add_menu_page(
167
+ 'Tatvic EE Plugin', 'Tatvic EE Plugin', 'manage_options', "enhanced-ecommerce-google-analytics-admin-display", array($this, 'showPage'), plugin_dir_url(__FILE__) . 'images/tatvic_logo.png', 26
 
 
 
 
 
 
168
  );
 
169
  }
 
170
  /**
171
  * Display Tab page.
172
  *
174
  */
175
  public function showPage() {
176
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
177
+ if (!empty($_GET['tab'])) {
178
  $get_action = $_GET['tab'];
179
+ } else {
 
180
  $get_action = "general_settings";
181
  }
182
+ if (method_exists($this, $get_action)) {
183
  $this->$get_action();
184
  }
185
  }
199
  public function about_plugin() {
200
  require_once( 'partials/about-plugin.php');
201
  }
202
+ public function country_location() {
203
+ // date function to hide 30% off sale after certain date
204
+ return date_default_timezone_set('Australia/Sydney'); // Change this depending on what timezone your in
205
+ }
206
+
207
+ public function today() {
208
+ $this->country_location();
209
+ return strtotime(date('Y-m-d'));
210
+ }
211
+
212
+ public function current_time() {
213
+ $this->country_location();
214
+ return strtotime(date('h:i A'));
215
+ }
216
+
217
+ public function start_date() {
218
+ $this->country_location();
219
+ return strtotime(date('Y') . '-09-01');
220
+ }
221
+
222
+ public function end_date() {
223
+ $this->country_location();
224
+ return strtotime(date('Y') . '-09-08');
225
+ }
226
+
227
+ public function end_time() {
228
+ $this->country_location();
229
+ return strtotime('11:59 PM');
230
+ }
231
  }
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -64,10 +64,56 @@ class Enhanced_Ecommerce_Google_Settings {
64
  self::admin_notice__success();
65
  }
66
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
67
  private static function admin_notice__success() {
68
  $class = 'notice notice-success';
69
  $message = __( 'Your settings have been saved.', 'sample-text-domain' );
70
  printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
71
 
72
  }
73
- }
 
 
 
 
 
 
 
64
  self::admin_notice__success();
65
  }
66
 
67
+ public static function update_analytics_options($settings) {
68
+ if ( !get_option($settings)) {
69
+ $ee_options = array();
70
+ if(is_array($_POST)) {
71
+ foreach ($_POST as $key => $value) {
72
+ if(!isset($_POST[$key])){
73
+ $_POST[$key] = $value;
74
+ }
75
+ if(isset($_POST[$key])) {
76
+ $ee_options[$key] = $_POST[$key];
77
+ }
78
+ }
79
+ }
80
+ add_option( $settings, serialize( $ee_options ) );
81
+ } else {
82
+ $get_ee_settings = unserialize(get_option($settings));
83
+ if(is_array($get_ee_settings)) {
84
+ foreach ($get_ee_settings as $key => $value) {
85
+ if(!isset($_POST[$key])){
86
+ $_POST[$key] = $value;
87
+ }
88
+ if( $_POST[$key] != $value && $_POST[$key] != '') {
89
+ $get_ee_settings[$key] = $_POST[$key];
90
+ }
91
+ }
92
+ }
93
+
94
+ if(is_array($_POST)) {
95
+ foreach($_POST as $key=>$value){
96
+ if(!array_key_exists($key,$get_ee_settings)){
97
+ $get_ee_settings[$key] = $value;
98
+ }
99
+ }
100
+ }
101
+ update_option($settings, serialize( $get_ee_settings ));
102
+ }
103
+ }
104
+
105
+
106
  private static function admin_notice__success() {
107
  $class = 'notice notice-success';
108
  $message = __( 'Your settings have been saved.', 'sample-text-domain' );
109
  printf( '<div class="%1$s"><p>%2$s</p></div>', esc_attr( $class ), esc_html( $message ) );
110
 
111
  }
112
+ public function show_message(){
113
+ echo '
114
+ <div class="notice notice-warning is-dismissible">
115
+ <strong><p>Get all the 9 GA - Enhanced Ecommerce reports, 20+ custom dimensions and metrics, google ads conversion tracking, FB pixel tracking, Google Optimize integration and many more advanced features in the <a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=TatvicEE&utm_medium=DashboardMsgText&utm_campaign=WPlisting" target="_blank">Premium Version</a>.</p></strong>
116
+ </div>
117
+ ';
118
+ }
119
+ }
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -43,6 +43,9 @@ input[type=checkbox]{
43
  -ms-transition: all 1.5s ease;
44
  transition: all 1.5s ease;
45
  }
 
 
 
46
  input[type=checkbox]:checked::before {
47
  height:16px;
48
  width:16px;
@@ -62,10 +65,92 @@ h5{
62
  .banner{
63
  width:100%;
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  }
66
  @media only screen and (min-width: 1920px){
67
  .container{
68
  margin-left: 6% !important;
69
  width:auto;
70
  }
71
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
43
  -ms-transition: all 1.5s ease;
44
  transition: all 1.5s ease;
45
  }
46
+ .align-middle{
47
+ font-size: 15px;
48
+ }
49
  input[type=checkbox]:checked::before {
50
  height:16px;
51
  width:16px;
65
  .banner{
66
  width:100%;
67
  }
68
+ .banner-new {
69
+ background: #253574;
70
+ margin-left: 10px;
71
+ padding: 10px;
72
+ }
73
+ .banner-new p {
74
+ color: #fff;
75
+ text-align: center;
76
+ font-size: 20px;
77
+ margin-bottom: 0;
78
+ }
79
+ .banner-new a {color: #fff;}
80
+ .clickhere-txt {vertical-align: middle;display: grid;}
81
+ .clickhere-txt a{font-size: 12px;text-decoration: underline;}
82
  }
83
  @media only screen and (min-width: 1920px){
84
  .container{
85
  margin-left: 6% !important;
86
  width:auto;
87
  }
88
+ }
89
+ .try-btn{
90
+ width: auto;
91
+ border: black;
92
+ text-align: center;
93
+ padding: 8px 10px 10px 10px;
94
+ font-size: 18px;
95
+ background-color: #00a32a;
96
+ float: right;
97
+ top: 60px;
98
+ height: 38px;
99
+ color: antiquewhite;
100
+ font-weight: bold;
101
+ border-radius: 4px;
102
+ -moz-box-shadow: 3px 3px 5px 6px #ccc;
103
+ -webkit-box-shadow: 3px 3px 5px 6px #ccc;
104
+ box-shadow: 0px 0px 7px 7px #ccc;
105
+ }
106
+ .top-btn{
107
+ float: right;
108
+ }
109
+ .new-img-blink{
110
+ width: 40px;
111
+ height: 25px;
112
+ }
113
+ .new-img-blink-side{
114
+ width: 40px;
115
+ height: 25px;
116
+ }
117
+ .banner-blink{width: 60px;
118
+ height: 35px;}
119
+ .rating {
120
+ unicode-bidi: bidi-override;
121
+ direction: rtl;
122
+ }
123
+ .rating > span {
124
+ display: inline-block;
125
+ position: relative;
126
+ width: 1.1em;
127
+ color: #2D73C5;
128
+ }
129
+ .rating > span:hover:before,
130
+ .rating > span:hover ~ span:before {
131
+ content: "\2605";
132
+ position: absolute;
133
+ }
134
+ .oauth-container{
135
+ display: inline-block;
136
+ width: 100%;
137
+ max-width: 100%;
138
+ padding: 5px;
139
+ border: 1px solid #bfbfbf;
140
+ height: 45px;
141
+ border-radius: 5px;
142
+ background-color: #fff;
143
+ }
144
+ .ee-oauth-container{
145
+ display: inline-block;
146
+ width: 50%;
147
+ max-width: 100%;
148
+ padding: 5px;
149
+ border: 1px solid #bfbfbf;
150
+ height: 45px;
151
+ border-radius: 5px;
152
+ background-color: #fff;
153
+ }
154
+ .left {
155
+ float: left;
156
+ }
admin/images.zip ADDED
Binary file
admin/images/adwords.png CHANGED
File without changes
admin/images/banner.png CHANGED
File without changes
admin/images/cotlw.gif CHANGED
File without changes
admin/images/cotlw.png CHANGED
File without changes
admin/images/discount.gif ADDED
Binary file
admin/images/facebook.jpg CHANGED
File without changes
admin/images/google_optimize.png CHANGED
File without changes
admin/images/m1.png CHANGED
File without changes
admin/images/m2.png CHANGED
File without changes
admin/images/new-2.gif ADDED
Binary file
admin/images/new-img.gif ADDED
Binary file
admin/images/plugin_bk.png CHANGED
File without changes
admin/images/rating.png ADDED
Binary file
admin/images/ratings.png ADDED
Binary file
admin/images/shopify_new.png CHANGED
File without changes
admin/images/tatvic_logo.png CHANGED
File without changes
admin/images/woo.png CHANGED
File without changes
admin/images/woo_banner_adv.gif CHANGED
File without changes
admin/index.php CHANGED
File without changes
admin/js/enhanced-ecommerce-google-analytics-admin.js CHANGED
@@ -29,5 +29,14 @@
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
 
32
-
 
 
 
 
 
 
 
 
 
33
  })( jQuery );
29
  * practising this, we should strive to set a better example in our own work.
30
  */
31
 
32
+ jQuery(document).ready(function(){
33
+ jQuery('.download').click(function(){
34
+ jQuery.confirm({
35
+ theme : 'supervan',
36
+ type: 'red',
37
+ title: 'Note !',
38
+ content: 'Deactivate the Enhanced Ecommerce Google analytics (Tatvic EE Plugin) before activating the free trial.',
39
+ });
40
+ });
41
+ });
42
  })( jQuery );
admin/partials/about-plugin.php CHANGED
@@ -1,3 +1,13 @@
 
 
 
 
 
 
 
 
 
 
1
  <style>
2
  td{
3
  text-align: center !important;
@@ -16,6 +26,7 @@
16
  <div class="row" style="margin-left:-11%; !important;">
17
  <div class= "col col-9">
18
  <div class="card mw-100" style="padding:0;">
 
19
  <div class="card-header">
20
  <h5>Feature difference between <span style="font-weight: 800;">Free & Premium</span> Plugin</h5>
21
  </div>
@@ -116,7 +127,12 @@
116
  <td><i class="fa fa-check"></i></td>
117
  </tr>
118
  <tr>
119
- <td class="option">15+ Ready to Use Custom Dimensions/ Metrics</td>
 
 
 
 
 
120
  <td><i class="fa fa-times"></i></td>
121
  <td><i class="fa fa-check"></i></td>
122
  </tr>
@@ -144,8 +160,12 @@
144
  <tfoot class="thead-inverse">
145
  <tr>
146
  <th class="w-25"></th>
147
- <th class=""></th>
148
- <th class=""><a href="https://1.envato.market/Yvn3R" target="_blank"><button class="btn btn-primary"><strong>Buy Premium Plugin</strong></button></a></th>
 
 
 
 
149
  </tr>
150
  </tfoot>
151
  </table>
1
+ <?php
2
+ $message = new Enhanced_Ecommerce_Google_Settings();
3
+ $obj = new Enhanced_Ecommerce_Google_Analytics_Admin($plugin_name = 'enhanced-e-commerce-for-woocommerce-store', $version = PLUGIN_NAME_VERSION);
4
+ $today = $obj->today();
5
+ $start = $obj->start_date();
6
+ $end = $obj->end_date();
7
+ $currentime = $obj->current_time();
8
+ $endtime = $obj->end_time();
9
+ ?>
10
+
11
  <style>
12
  td{
13
  text-align: center !important;
26
  <div class="row" style="margin-left:-11%; !important;">
27
  <div class= "col col-9">
28
  <div class="card mw-100" style="padding:0;">
29
+ <?php $message->show_message();?>
30
  <div class="card-header">
31
  <h5>Feature difference between <span style="font-weight: 800;">Free & Premium</span> Plugin</h5>
32
  </div>
127
  <td><i class="fa fa-check"></i></td>
128
  </tr>
129
  <tr>
130
+ <td class="option">20 Ready to Use Custom Dimensions/ Metrics</td>
131
+ <td><i class="fa fa-times"></i></td>
132
+ <td><i class="fa fa-check"></i></td>
133
+ </tr>
134
+ <tr>
135
+ <td class="option">Premium Support</td>
136
  <td><i class="fa fa-times"></i></td>
137
  <td><i class="fa fa-check"></i></td>
138
  </tr>
160
  <tfoot class="thead-inverse">
161
  <tr>
162
  <th class="w-25"></th>
163
+ <th class="w-25"></th>
164
+ <th class=""><a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=TatvicEE&utm_medium=DashboardBuyBottom&utm_campaign=WPlisting" target="_blank"><button class="btn btn-primary"><strong>Get premium plugin</strong>
165
+ <?php if($today >= $start && $today <= $end && $currentime <= $endtime) {?>
166
+ <img class="new-img-blink-side" src='<?php echo plugins_url('../images/discount.gif', __FILE__ ) ?>' />
167
+ <?php }?>
168
+ </button></a></th>
169
  </tr>
170
  </tfoot>
171
  </table>
admin/partials/enhanced-ecommerce-google-analytics-admin-display.php CHANGED
@@ -32,13 +32,30 @@ else{
32
  if(empty($_GET['tab'])){
33
  $general_class_active = "active";
34
  }
 
 
 
 
 
 
 
35
  ?>
36
  <header class='background-color:#E8E8E8;height:500px;width:auto;margin-top:100px;margin-left:20px;'>
37
  <img class ="banner" src='<?php echo plugins_url('../images/banner.png', __FILE__ ) ?>' style="margin-left:10px;">
 
 
 
 
 
 
38
  </header>
39
  <ul class="nav nav-tabs nav-pills" style="margin-left: 10px;margin-top:20px;">
40
  <li class="nav-item">
41
- <a href="<?php echo $site_url.'general_settings'; ?>" class="border-left aga-tab nav-link <?php echo $general_class_active; ?>">General Setting</a>
42
  </li>
43
- <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium Plugin</a></li>
 
 
 
 
44
  </ul>
32
  if(empty($_GET['tab'])){
33
  $general_class_active = "active";
34
  }
35
+ // date function to hide 30% off sale after certain date
36
+ $obj = new Enhanced_Ecommerce_Google_Analytics_Admin($plugin_name = 'enhanced-e-commerce-for-woocommerce-store', $version = PLUGIN_NAME_VERSION);
37
+ $today = $obj->today();
38
+ $start = $obj->start_date();
39
+ $end = $obj->end_date();
40
+ $currentime = $obj->current_time();
41
+ $endtime = $obj->end_time();
42
  ?>
43
  <header class='background-color:#E8E8E8;height:500px;width:auto;margin-top:100px;margin-left:20px;'>
44
  <img class ="banner" src='<?php echo plugins_url('../images/banner.png', __FILE__ ) ?>' style="margin-left:10px;">
45
+ <?php if($today >= $start && $today <= $end && $currentime <= $endtime) { ?>
46
+ <div class="banner-new">
47
+ <p><img class="banner-blink" src='<?php echo plugins_url('../images/discount.gif', __FILE__ ) ?>' /> On the Premium Version Till 8th Sept 2020</p>
48
+ <p class="clickhere-txt"><a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=TatvicEE&utm_medium=DashboardBanner&utm_campaign=SeptCamp" target="_blank">Click here</a></p>
49
+ </div>
50
+ <?php } ?>
51
  </header>
52
  <ul class="nav nav-tabs nav-pills" style="margin-left: 10px;margin-top:20px;">
53
  <li class="nav-item">
54
+ <a href="<?php echo $site_url.'general_settings'; ?>" class="border-left aga-tab nav-link <?php echo $general_class_active; ?>">General Settings</a>
55
  </li>
56
+ <?php if($today >= $start && $today <= $end && $currentime <= $endtime) {?>
57
+ <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium <img class="new-img-blink" src='<?php echo plugins_url('../images/discount.gif', __FILE__ ) ?>' /></a></li>
58
+ <?php } else { ?>
59
+ <li class="nav-item"><a href="<?php echo $site_url.'about_plugin'; ?>" class="border-left aga-tab nav-link <?php echo $advanced_class_active; ?>">Premium <img class="new-img-blink" src='<?php echo plugins_url('../images/new-2.gif', __FILE__ ) ?>' /></a></li>
60
+ <?php } ?>
61
  </ul>
admin/partials/general-fields.php CHANGED
@@ -1,5 +1,6 @@
1
  <?php
2
- if(isset($_POST['ee_submit_plugin'])){
 
3
  Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
4
  }
5
  $data = unserialize(get_option('ee_options'));
@@ -8,97 +9,158 @@ $data = unserialize(get_option('ee_options'));
8
  <div class="row" style="margin-left:-11%; !important;">
9
  <div class= "col col-9" >
10
  <div class="card mw-100" style="padding:0px;">
 
11
  <div class="card-header">
12
- <h5>Enhanced Ecommerce Google Analytics</h5>
 
 
 
 
 
13
  </div>
14
  <div class="card-body">
15
  <form id="ee_plugin_form" method="post" action="" enctype="multipart/form-data" >
16
  <table class="table table-bordered">
17
  <tbody>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
 
19
- <tr>
20
- <td>
21
- <label class="align-middle" for="woocommerce_ee_google_analytics_ga_id">Google Analytics ID</label>
22
- </td>
23
- <td>
24
- <input type="text" id="ga_id" name = "ga_id" required = "required" value="<?php echo $data['ga_id'];?>">
25
- <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>
26
- </td>
27
- </tr>
28
- <tr>
29
- <td>
30
- <label class="align-middle" for="tracking_code">Tracking Code</label>
31
- </td>
32
- <td>
33
- <label class = "align-middle" for="ga_code">
34
- <?php $ga_ST = !empty($data['ga_ST'])? 'checked' : ''; ?>
35
- <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo $ga_ST; ?> >
36
- Add Global Site Tracking Code 'gtag.js'
37
- <p class="description">This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin.</p>
38
- </label><br/>
39
- <label class = "align-middle" for="ga_enhance_ecommerce">
40
- <?php $ga_eeT = !empty($data['ga_eeT'])? 'checked' : ''; ?>
41
- <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo $ga_eeT; ?> >
42
- Add Enhanced Ecommerce Tracking Code
43
- <p class="description">This feature adds Enhanced Ecommerce Tracking Code to your Store</p>
44
- </label><br/>
45
- <label class = "align-middle" for="ga_login_step">
46
- <?php $ga_gUser = !empty($data['ga_gUser'])? 'checked' : ''; ?>
47
- <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo $ga_gUser; ?> >
48
- Add Code to Track the Login Step of Guest Users (Optional)
49
- <p class="description">If you have Guest Check out enable, we recommend you to add this code</p>
50
- </label><br/>
51
- </td>
52
- </tr>
53
- <tr>
54
- <td>
55
- <label for="ga_Impr">Impression Thresold</label>
56
- </td>
57
- <td>
58
- <?php $ga_Impr = !empty($data['ga_Impr'])? $data['ga_Impr'] : 6; ?>
59
- <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo $ga_Impr; ?>"><br/>
60
- <p class="description">This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions. <br><b>Note : To avoid processing load on server we recommend upto 6 Impression Thresold.</b></p>
61
- </td>
62
- </tr>
63
- <tr>
64
- <td>
65
- <label class = "align-middle" for="ga_IPA">I.P. Anoymization</label>
66
- </td>
67
- <td>
68
- <label class = "align-middle" for="ga_IPA">
69
- <?php $ga_IPA = !empty($data['ga_IPA'])? 'checked' : ''; ?>
70
- <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo $ga_IPA; ?>>
71
- Enable I.P. Anonymization
72
- <p class="description">Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance</p>
73
- </label>
74
- </td>
75
- </tr>
76
- <tr>
77
- <td>
78
- <label class = "align-middle" for="ga_OPTOUT">Google Analytics Opt Out</label>
79
- </td>
80
- <td>
81
- <label class = "align-middle" for="ga_OPTOUT">
82
- <?php $ga_OPTOUT = !empty($data['ga_OPTOUT'])? 'checked' : ''; ?>
83
- <input class="" type="checkbox" name="ga_OPTOUT" id="ga_OPTOUT" <?php echo $ga_OPTOUT; ?>>
84
- Enable Google Analytics Opt Out (Optional)
85
- <p class="description">Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup</p>
86
- </label>
87
- </td>
88
- </tr>
89
- <tr>
90
- <td>
91
- <label class = "align-middle" for="ga_PrivacyPolicy">Privacy Policy</label>
92
- </td>
93
- <td>
94
- <label class = "align-middle" for="ga_PrivacyPolicy">
95
- <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy'])? 'checked' : ''; ?>
96
- <input type="checkbox" onchange="enableSubmit();" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo $ga_PrivacyPolicy; ?>>
97
- Accept Privacy Policy of Plugin
98
- <p class="description">By using Tatvic Plugin, you agree to Tatvic plugin's <a href= "https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></p>
99
- </label>
100
- </td>
101
- </tr>
102
  </tbody>
103
  </table>
104
  <p class="submit save-for-later" id="save-for-later">
@@ -108,6 +170,6 @@ $data = unserialize(get_option('ee_options'));
108
  </div>
109
  </div>
110
  </div>
111
- <?php require_once('sidebar.php');?>
112
  </div>
113
- </div>
1
  <?php
2
+ $message = new Enhanced_Ecommerce_Google_Settings();
3
+ if (isset($_POST['ee_submit_plugin'])) {
4
  Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
5
  }
6
  $data = unserialize(get_option('ee_options'));
9
  <div class="row" style="margin-left:-11%; !important;">
10
  <div class= "col col-9" >
11
  <div class="card mw-100" style="padding:0px;">
12
+ <?php $message->show_message(); ?>
13
  <div class="card-header">
14
+ <h3>Enhanced Ecommerce Google Analytics <a href = "https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/" target="_blank" style="float: right">
15
+ <div class="rating">
16
+ <span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>
17
+ </div>
18
+ </a>
19
+ </h3>
20
  </div>
21
  <div class="card-body">
22
  <form id="ee_plugin_form" method="post" action="" enctype="multipart/form-data" >
23
  <table class="table table-bordered">
24
  <tbody>
25
+ <tr>
26
+ <td>
27
+ <label class="align-middle" for="woocommerce_ee_google_analytics_ga_id">Google Analytics ID</label>
28
+ </td>
29
+ <td>
30
+ <!-- <input type="text" id="ga_id" name = "ga_id" required = "required" value="--><?php //echo $data['ga_id']; ?><!--">-->
31
+ <!-- <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>-->
32
+
33
+ <?php if(isset($data['ga_id']) && $data['ga_id'] != '') { ?>
34
+ <input style="border: none;box-shadow: none;width: 35%;" type="text" id="ga_id" name = "ga_id" required = "required" disabled value="<?= $data['ga_id']; ?>"/>
35
+ <p class="hint-text" style="color: #666;display: inline-block;float: right;padding-top: 5px;">To update analytics id, <a target="_blank" href="<?=esc_url($this->url)?>">click here</a></p>
36
+ <?php } else {?>
37
+ <!--signin with google-->
38
+ <a target="_blank" class="ee-oauth-container btn darken-4 white black-text" href="<?=esc_url($this->url)?>" style="text-transform:none">
39
+ <div class="left">
40
+ <img width="20px" style="margin-top:7px; margin-right:8px" alt="Google sign-in"
41
+ src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/512px-Google_%22G%22_Logo.svg.png" />
42
+ </div>
43
+ <p style="font-size: inherit; margin-top:5px; margin-right:8px; ">Sign In With Google</p>
44
+ </a>
45
+ <!--sigin with google end-->
46
+ <?php } ?>
47
+ </td>
48
+
49
+ </tr>
50
+ <tr>
51
+ <td>
52
+ <label class="align-middle" for="woocommerce_ee_google_analytics_ads_id">Linked Google Ads Account <i style="cursor: help;" class="fas fa-question-circle" title="To link Google Ads and Google Analytics, you’ll need administrative access to a Google Ads account and “Edit permissions” to a Google Analytics account.
53
+ Why link Google Ads and Analytics account?
54
+ When you link Google Ads and Analytics, you can:
55
+ See ad and site performance data in the Google Ads reports in Analytics.
56
+ Import Analytics goals and Ecommerce transactions into your Google Ads account.
57
+ Import cross-device conversions into your Google Ads account when you activate Google signals.
58
+ Import Analytics metrics like Bounce Rate, Avg. Session Duration, and Pages/Session into your Google Ads account.
59
+ Enhance your Google Ads remarketing with Analytics Remarketing and Dynamic Remarketing.
60
+ Get richer data in the Analytics Multi-Channel Funnels reports."></i></label>
61
+ </td>
62
+ <td>
63
+ <!-- <input type="text" id="ga_id" name = "ga_id" required = "required" value="--><?php //echo $data['ga_id']; ?><!--">-->
64
+ <!-- <i style="cursor: help;" class="fas fa-question-circle" title="Enter your Google Analytics ID here. You can login into your Google Analytics account to find your ID. e.g. UA-XXXXXX-XX"></i>-->
65
+
66
+ <?php if(isset($data['ads_id']) && $data['ads_id'] != '') { ?>
67
+ <input style="border: none;box-shadow: none;width: 35%;" type="text" id="ads_id" name = "ads_id" disabled value="<?= $data['ads_id']; ?>"/>
68
+ <p class="hint-text" style="color: #666;display: inline-block;float: right;padding-top: 5px;">To update ads account id, <a target="_blank" href="<?=esc_url($this->url)?>">click here</a></p>
69
+ <?php } else {?>
70
+ <!--signin with google-->
71
+ <a target="_blank" class="ee-oauth-container btn darken-4 white black-text" href="<?=esc_url($this->url)?>" style="text-transform:none">
72
+ <div class="left">
73
+ <img width="20px" style="margin-top:7px; margin-right:8px" alt="Google sign-in"
74
+ src="https://upload.wikimedia.org/wikipedia/commons/thumb/5/53/Google_%22G%22_Logo.svg/512px-Google_%22G%22_Logo.svg.png" />
75
+ </div>
76
+ <p style="font-size: inherit; margin-top:5px; margin-right:8px; ">Sign In With Google</p>
77
+ </a>
78
+ <!--sigin with google end-->
79
+ <?php } ?>
80
+ </td>
81
+
82
+ </tr>
83
+ <tr>
84
+ <td>
85
+ <label class="align-middle" for="tracking_code">Tracking Code</label>
86
+ </td>
87
+ <td>
88
+ <label class = "align-middle" for="ga_code">
89
+ <?php $ga_ST = !empty($data['ga_ST']) ? 'checked' : ''; ?>
90
+ <input type="checkbox" name="ga_ST" id="ga_ST" <?php echo $ga_ST; ?> >
91
+ Add Global Site Tracking Code 'gtag.js'
92
+ <i style="cursor: help;" class="fas fa-question-circle" title="This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin."></i>
93
+ <!--<p class="description">This feature adds new gtag.js tracking code to your store. You don't need to enable this if gtag.js is implemented via any third party analytics plugin.</p>-->
94
+ </label><br/>
95
+ <label class = "align-middle" for="ga_enhance_ecommerce">
96
+ <?php $ga_eeT = !empty($data['ga_eeT']) ? 'checked' : ''; ?>
97
+ <input type="checkbox" name="ga_eeT" id="ga_eeT" <?php echo $ga_eeT; ?> >
98
+ Add Enhanced Ecommerce Tracking Code
99
+ <i style="cursor: help;" class="fas fa-question-circle" title="This feature adds Enhanced Ecommerce Tracking Code to your Store"></i>
100
+ <!--<p class="description">This feature adds Enhanced Ecommerce Tracking Code to your Store</p>-->
101
+ </label><br/>
102
+ <label class = "align-middle" for="ga_login_step">
103
+ <?php $ga_gUser = !empty($data['ga_gUser']) ? 'checked' : ''; ?>
104
+ <input type="checkbox" name="ga_gUser" id="ga_gUser" <?php echo $ga_gUser; ?> >
105
+ Add Code to Track the Login Step of Guest Users (Optional)
106
+ <i style="cursor: help;" class="fas fa-question-circle" title="If you have Guest Check out enable, we recommend you to add this code"></i>
107
+ <!--<p class="description">If you have Guest Check out enable, we recommend you to add this code</p>-->
108
+ </label><br/>
109
+ </td>
110
+ </tr>
111
+ <tr>
112
+ <td>
113
+ <label for="ga_Impr">Impression Thresold</label>
114
+ </td>
115
+ <td>
116
+ <?php $ga_Impr = !empty($data['ga_Impr']) ? $data['ga_Impr'] : 6; ?>
117
+ <input type="number" min="1" id="ga_Impr" name = "ga_Impr" value = "<?php echo $ga_Impr; ?>">
118
+ <i style="cursor: help;" class="fas fa-question-circle" title="This feature sets Impression threshold for category page. It sends hit after these many numbers of products impressions."></i>
119
+ <p class="description"><br><b>Note : To avoid processing load on server we recommend upto 6 Impression Thresold.</b></p>
120
+ </td>
121
+ </tr>
122
+ <tr>
123
+ <td>
124
+ <label class = "align-middle" for="ga_IPA">I.P. Anoymization</label>
125
+ </td>
126
+ <td>
127
+ <label class = "align-middle" for="ga_IPA">
128
+ <?php $ga_IPA = !empty($data['ga_IPA']) ? 'checked' : ''; ?>
129
+ <input class="" type="checkbox" name="ga_IPA" id="ga_IPA" <?php echo $ga_IPA; ?>>
130
+ Enable I.P. Anonymization
131
+ <i style="cursor: help;" class="fas fa-question-circle" title="Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance"></i>
132
+ <!-- <p class="description">Use this feature to anonymize (or stop collecting) the I.P Address of your users in Google Analytics. Be in legal compliance by using I.P Anonymization which is important for EU countries As per the GDPR compliance</p>-->
133
+ </label>
134
+ </td>
135
+ </tr>
136
+ <tr>
137
+ <td>
138
+ <label class = "align-middle" for="ga_OPTOUT">Google Analytics Opt Out</label>
139
+ </td>
140
+ <td>
141
+ <label class = "align-middle" for="ga_OPTOUT">
142
+ <?php $ga_OPTOUT = !empty($data['ga_OPTOUT']) ? 'checked' : ''; ?>
143
+ <input class="" type="checkbox" name="ga_OPTOUT" id="ga_OPTOUT" <?php echo $ga_OPTOUT; ?>>
144
+ Enable Google Analytics Opt Out (Optional)
145
+ <i style="cursor: help;" class="fas fa-question-circle" title="Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup"></i>
146
+ <!--<p class="description">Use this feature to provide website visitors the ability to prevent their data from being used by Google Analytics As per the GDPR compliance.Go through the documentation to check the setup</p>-->
147
+ </label>
148
+ </td>
149
+ </tr>
150
+ <tr>
151
+ <td>
152
+ <label class = "align-middle" for="ga_PrivacyPolicy">Privacy Policy</label>
153
+ </td>
154
+ <td>
155
+ <label class = "align-middle" for="ga_PrivacyPolicy">
156
+ <?php $ga_PrivacyPolicy = !empty($data['ga_PrivacyPolicy']) ? 'checked' : ''; ?>
157
+ <input type="checkbox" onchange="enableSubmit();" name="ga_PrivacyPolicy" id="ga_PrivacyPolicy" required="required" <?php echo $ga_PrivacyPolicy; ?>>
158
+ Accept Privacy Policy of Plugin
159
+ <p class="description">By using Tatvic Plugin, you agree to Tatvic plugin's <a href= "https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_premium_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></p>
160
+ </label>
161
+ </td>
162
+ </tr>
163
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
164
  </tbody>
165
  </table>
166
  <p class="submit save-for-later" id="save-for-later">
170
  </div>
171
  </div>
172
  </div>
173
+ <?php require_once('sidebar.php'); ?>
174
  </div>
175
+ </div>
admin/partials/sidebar.php CHANGED
@@ -1,3 +1,12 @@
 
 
 
 
 
 
 
 
 
1
  <div class="col col-xs-3">
2
  <div class="card" style="padding: 0px;">
3
  <div class="card-header">
@@ -7,7 +16,7 @@
7
  <ul>
8
  <li style="padding-bottom:5px;"><a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Installation Instructions</a></li>
9
  <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a></li>
10
- <li style="padding-bottom:5px;"><a href="https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store" target="_blank">Support</a></li>
11
  <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></li>
12
  <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#developers" target="_blank">Change Logs</a></li>
13
  </ul>
@@ -19,7 +28,11 @@
19
  </div>
20
  <div class="card-body">
21
  <ul style="font-weight: 600">
22
- <li style="padding-bottom:5px;">Do you Like our Plugin? Please Spare few minutes to give <a href = "https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/" target="_blank">★★★★★</a> Rating..!!</li>
 
 
 
 
23
  </ul>
24
  </div>
25
  </div>
@@ -29,8 +42,11 @@
29
  </div>
30
  <div class="card-body">
31
  <ul>
32
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/woo.png', __FILE__ ) ?>' />&nbsp;<a href="http://1.envato.market/Yvn3R" target="_blank">Actionable Google Analytics for WooCommerce</a></li>
33
- <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/cotlw.png', __FILE__ ) ?>' />&nbsp;<a href="https://wordpress.org/plugins/woo-chrome-one-tap-login/" target="_blank">Chrome One Tap Login for Woocommerce</a>&nbsp;&nbsp;<img src='<?php echo plugins_url('../images/cotlw.gif', __FILE__ ) ?>' /></li>
 
 
 
34
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m1.png', __FILE__ ) ?>' />&nbsp;<a href="https://1.envato.market/79Oky" target="_blank">Actionable Google Analytics for Magento</a></li>
35
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m2.png', __FILE__ ) ?>' />&nbsp;<a href="https://marketplace.magento.com/tatvic-actionablegoogleanalytics.html" target="_blank">Actionable Google Analytics for Magento2</a></li>
36
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/shopify_new.png', __FILE__ ) ?>' />&nbsp;<a href="https://apps.shopify.com/google-universal-analytics-enhanced-ecommerce" target="_blank">Actionable Google Analytics for Shopify</a></li>
1
+ <?php
2
+ $obj = new Enhanced_Ecommerce_Google_Analytics_Admin($plugin_name = 'enhanced-e-commerce-for-woocommerce-store', $version = PLUGIN_NAME_VERSION);
3
+ $today = $obj->today();
4
+ $start = $obj->start_date();
5
+ $end = $obj->end_date();
6
+ $currentime = $obj->current_time();
7
+ $endtime = $obj->end_time();
8
+
9
+ ?>
10
  <div class="col col-xs-3">
11
  <div class="card" style="padding: 0px;">
12
  <div class="card-header">
16
  <ul>
17
  <li style="padding-bottom:5px;"><a href="http://plugins.tatvic.com/downloads/EE-Woocommerce-Plugin-Documentation.pdf" target="_blank">Installation Instructions</a></li>
18
  <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" target="_blank">FAQ</a></li>
19
+ <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/contact/?utm_source=TatvicEE&utm_medium=Dashboard&utm_campaign=WPlisting" target="_blank">Support</a></li>
20
  <li style="padding-bottom:5px;"><a href="https://www.tatvic.com/privacy-policy/?ref=plugin_policy&utm_source=plugin_backend&utm_medium=woo_free_plugin&utm_campaign=GDPR_complaince_ecomm_plugins" target="_blank">Privacy Policy</a></li>
21
  <li style="padding-bottom:5px;"><a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#developers" target="_blank">Change Logs</a></li>
22
  </ul>
28
  </div>
29
  <div class="card-body">
30
  <ul style="font-weight: 600">
31
+ <li style="padding-bottom:5px;">Do you Like our Plugin? Please Spare few minutes to give <h3><a href = "https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/" target="_blank" style="float: right">
32
+ <div class="rating">
33
+ <span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>
34
+ </div>
35
+ </a></h3> Rating..!!</li>
36
  </ul>
37
  </div>
38
  </div>
42
  </div>
43
  <div class="card-body">
44
  <ul>
45
+ <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/woo.png', __FILE__ ) ?>' />&nbsp;<a href="https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=TatvicEE&utm_medium=DashboardSide&utm_campaign=WPlisting
46
+ " target="_blank">Actionable Google Analytics for WooCommerce - Premium Version</a>
47
+ <?php if($today >= $start && $today <= $end && $currentime <= $endtime) {?>
48
+ <img class="new-img-blink-side" src='<?php echo plugins_url('../images/discount.gif', __FILE__ ) ?>' /><?php } ?></li>
49
+ <li style="padding-bottom:5px;"><img style="width:25px;height: 25px;" src='<?php echo plugins_url('../images/tatvic_logo.png', __FILE__ ) ?>' />&nbsp;<a href="https://codecanyon.net/item/google-feed-manager-for-woocommerce-by-tatvic/27104089?utm_source=TatvicEE&utm_medium=Side&utm_campaign=SideGMC" target="_blank">Google Feed Manager For WooCommerce</a></li>
50
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m1.png', __FILE__ ) ?>' />&nbsp;<a href="https://1.envato.market/79Oky" target="_blank">Actionable Google Analytics for Magento</a></li>
51
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/m2.png', __FILE__ ) ?>' />&nbsp;<a href="https://marketplace.magento.com/tatvic-actionablegoogleanalytics.html" target="_blank">Actionable Google Analytics for Magento2</a></li>
52
  <li style="padding-bottom:5px;"><img src='<?php echo plugins_url('../images/shopify_new.png', __FILE__ ) ?>' />&nbsp;<a href="https://apps.shopify.com/google-universal-analytics-enhanced-ecommerce" target="_blank">Actionable Google Analytics for Shopify</a></li>
enhanced-ecommerce-google-analytics.php CHANGED
@@ -1,4 +1,5 @@
1
  <?php
 
2
  /**
3
  * The plugin bootstrap file
4
  *
@@ -14,8 +15,8 @@
14
  * @wordpress-plugin
15
  * Plugin Name: Enhanced E-commerce for Woocommerce store
16
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
17
- * Description: Allows Enhanced E-commerce Google Analytics tracking code to be inserted into WooCommerce store pages.
18
- * Version: 2.2.2
19
  * Author: Tatvic
20
  * Author URI: www.tatvic.com
21
  * License: GPL-2.0+
@@ -23,7 +24,7 @@
23
  * Text Domain: www.tatvic.com
24
  * Domain Path: /languages
25
  * WC requires at least: 1.4.1
26
- * WC tested up to: 3.7.0
27
  */
28
 
29
  /**
@@ -32,13 +33,17 @@
32
  if ( ! defined( 'WPINC' ) ) {
33
  die;
34
  }
 
 
 
 
35
 
36
  /**
37
  * Currently plugin version.
38
  * Start at version 1.0.0 and use SemVer - https://semver.org
39
  * Rename this for your plugin and update it as you release new versions.
40
  */
41
- define( 'PLUGIN_NAME_VERSION', '2.2.2' );
42
  /**
43
  * The code that runs during plugin activation.
44
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
1
  <?php
2
+
3
  /**
4
  * The plugin bootstrap file
5
  *
15
  * @wordpress-plugin
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
+ * Description: Automates Enhanced Ecommerce tracking in Google Analytics using gtag.js.
19
+ * Version: 2.3.6.1
20
  * Author: Tatvic
21
  * Author URI: www.tatvic.com
22
  * License: GPL-2.0+
24
  * Text Domain: www.tatvic.com
25
  * Domain Path: /languages
26
  * WC requires at least: 1.4.1
27
+ * WC tested up to: 4.6.1
28
  */
29
 
30
  /**
33
  if ( ! defined( 'WPINC' ) ) {
34
  die;
35
  }
36
+ // Store the directory of the plugin
37
+ if ( ! defined( 'ENHANCAD_PLUGIN_DIR' ) ) {
38
+ define( 'ENHANCAD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
39
+ }
40
 
41
  /**
42
  * Currently plugin version.
43
  * Start at version 1.0.0 and use SemVer - https://semver.org
44
  * Rename this for your plugin and update it as you release new versions.
45
  */
46
+ define( 'PLUGIN_NAME_VERSION', '2.3.6.1' );
47
  /**
48
  * The code that runs during plugin activation.
49
  * This action is documented in includes/class-enhanced-ecommerce-google-analytics-activator.php
includes/class-enhanced-ecommerce-google-analytics-activator.php CHANGED
File without changes
includes/class-enhanced-ecommerce-google-analytics-deactivator.php CHANGED
File without changes
includes/class-enhanced-ecommerce-google-analytics-i18n.php CHANGED
File without changes
includes/class-enhanced-ecommerce-google-analytics-loader.php CHANGED
File without changes
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -27,6 +27,10 @@
27
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
28
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
29
  */
 
 
 
 
30
  class Enhanced_Ecommerce_Google_Analytics {
31
 
32
  /**
@@ -70,13 +74,14 @@ class Enhanced_Ecommerce_Google_Analytics {
70
  if ( defined( 'PLUGIN_NAME_VERSION' ) ) {
71
  $this->version = PLUGIN_NAME_VERSION;
72
  } else {
73
- $this->version = '2.2.1';
74
  }
75
  $this->plugin_name = 'enhanced-ecommerce-google-analytics';
76
  $this->load_dependencies();
77
  $this->set_locale();
78
  $this->define_admin_hooks();
79
  $this->define_public_hooks();
 
80
  add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ), array($this,'tvc_plugin_action_links'),10 );
81
  }
82
 
@@ -227,6 +232,7 @@ class Enhanced_Ecommerce_Google_Analytics {
227
  * @since 1.0.0
228
  * @return Enhanced_Ecommerce_Google_Analytics_Loader Orchestrates the hooks of the plugin.
229
  */
 
230
  public function get_loader() {
231
  return $this->loader;
232
  }
@@ -237,6 +243,7 @@ class Enhanced_Ecommerce_Google_Analytics {
237
  * @since 1.0.0
238
  * @return string The version number of the plugin.
239
  */
 
240
  public function get_version() {
241
  return $this->version;
242
  }
@@ -249,4 +256,16 @@ class Enhanced_Ecommerce_Google_Analytics {
249
  $links[] = '<a href="https://1.envato.market/Yvn3R" target="_blank"><b>Upgrade to Premium</b></a>';
250
  return $links;
251
  }
 
 
 
 
 
 
 
 
 
 
 
 
252
  }
27
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
28
  * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
29
  */
30
+
31
+
32
+
33
+
34
  class Enhanced_Ecommerce_Google_Analytics {
35
 
36
  /**
74
  if ( defined( 'PLUGIN_NAME_VERSION' ) ) {
75
  $this->version = PLUGIN_NAME_VERSION;
76
  } else {
77
+ $this->version = '2.0';
78
  }
79
  $this->plugin_name = 'enhanced-ecommerce-google-analytics';
80
  $this->load_dependencies();
81
  $this->set_locale();
82
  $this->define_admin_hooks();
83
  $this->define_public_hooks();
84
+ $this->check_dependency();
85
  add_filter( 'plugin_action_links_' .plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ), array($this,'tvc_plugin_action_links'),10 );
86
  }
87
 
232
  * @since 1.0.0
233
  * @return Enhanced_Ecommerce_Google_Analytics_Loader Orchestrates the hooks of the plugin.
234
  */
235
+
236
  public function get_loader() {
237
  return $this->loader;
238
  }
243
  * @since 1.0.0
244
  * @return string The version number of the plugin.
245
  */
246
+
247
  public function get_version() {
248
  return $this->version;
249
  }
256
  $links[] = '<a href="https://1.envato.market/Yvn3R" target="_blank"><b>Upgrade to Premium</b></a>';
257
  return $links;
258
  }
259
+
260
+ /**
261
+ * Check Enhance E-commerce Plugin is Activated
262
+ * Free Plugin
263
+ */
264
+
265
+ public function check_dependency(){
266
+ if ( function_exists('run_actionable_google_analytics')) {
267
+ _e('<div class="error"><p><strong>'. wp_sprintf( 'Note: ' ) .'</strong>'. wp_sprintf( 'It seems <strong>Actionable Google Analytics Plugin</strong> is active on your store. Kindly deactivate it in order to avoid data duplication in GA.' ) .'</p></div>');
268
+ die();
269
+ }
270
+ }
271
  }
includes/index.php CHANGED
File without changes
includes/json/client-secrets.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "web": {
3
+ "client_id": "929004569091-pq3q5mve6nsmhg5lfu2vu5gq44acfp45.apps.googleusercontent.com",
4
+ "project_id": "tatvic.com:api-project-929004569091",
5
+ "auth_uri": "https://accounts.google.com/o/oauth2/auth",
6
+ "token_uri": "https://oauth2.googleapis.com/token",
7
+ "auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
8
+ "client_secret": "fpZsRhxOq4slRF0advdaT6ZS",
9
+ "manager_customer_id": "6847954029",
10
+ "manager_refresh_token": "1//0g7GDPfnauJb1CgYIARAAGBASNwF-L9IrqRrwDXC1EZLd_hOzUko6lPxJ-uZ9DlEltKV6QDcY3q9nbDlqFDPFut_2i0vKWGbTtc8",
11
+ "developer_token": "Pz7O94tto128j0u1Nl7DAg",
12
+ "redirect_uris": [
13
+ "https://plugins.tatvic.com/ga_rdr.php",
14
+ "https://plugins.tatvic.com/tatdev/ga_rdr.php",
15
+ "https://plugins.tatvic.com/tatprod/ga_rdr.php",
16
+ "https://plugins.tatvic.com/tat_ga/ga_rdr.php",
17
+ "https://plugins.tatvic.com/tat_ga/ga_rdr_new.php",
18
+ "https://plugins.tatvic.com/tat_ga/ga_rdr_ee.php",
19
+ "https://estorenew.tatvic.com/tat_ee/ga_rdr_ee.php",
20
+ "https://estorenew.tatvic.com/test/ga_rdr_ee.php"
21
+ ],
22
+ "javascript_origins": [
23
+ "https://plugins.tatvic.com"
24
+ ]
25
+ }
26
+ }
includes/json/currency.json ADDED
@@ -0,0 +1,252 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "BD": "BDT",
3
+ "BE": "EUR",
4
+ "BF": "XOF",
5
+ "BG": "BGN",
6
+ "BA": "BAM",
7
+ "BB": "BBD",
8
+ "WF": "XPF",
9
+ "BL": "EUR",
10
+ "BM": "BMD",
11
+ "BN": "BND",
12
+ "BO": "BOB",
13
+ "BH": "BHD",
14
+ "BI": "BIF",
15
+ "BJ": "XOF",
16
+ "BT": "BTN",
17
+ "JM": "JMD",
18
+ "BV": "NOK",
19
+ "BW": "BWP",
20
+ "WS": "WST",
21
+ "BQ": "USD",
22
+ "BR": "BRL",
23
+ "BS": "BSD",
24
+ "JE": "GBP",
25
+ "BY": "BYR",
26
+ "BZ": "BZD",
27
+ "RU": "RUB",
28
+ "RW": "RWF",
29
+ "RS": "RSD",
30
+ "TL": "USD",
31
+ "RE": "EUR",
32
+ "TM": "TMT",
33
+ "TJ": "TJS",
34
+ "RO": "RON",
35
+ "TK": "NZD",
36
+ "GW": "XOF",
37
+ "GU": "USD",
38
+ "GT": "GTQ",
39
+ "GS": "GBP",
40
+ "GR": "EUR",
41
+ "GQ": "XAF",
42
+ "GP": "EUR",
43
+ "JP": "JPY",
44
+ "GY": "GYD",
45
+ "GG": "GBP",
46
+ "GF": "EUR",
47
+ "GE": "GEL",
48
+ "GD": "XCD",
49
+ "GB": "GBP",
50
+ "GA": "XAF",
51
+ "SV": "USD",
52
+ "GN": "GNF",
53
+ "GM": "GMD",
54
+ "GL": "DKK",
55
+ "GI": "GIP",
56
+ "GH": "GHS",
57
+ "OM": "OMR",
58
+ "TN": "TND",
59
+ "JO": "JOD",
60
+ "HR": "HRK",
61
+ "HT": "HTG",
62
+ "HU": "HUF",
63
+ "HK": "HKD",
64
+ "HN": "HNL",
65
+ "HM": "AUD",
66
+ "VE": "VEF",
67
+ "PR": "USD",
68
+ "PS": "ILS",
69
+ "PW": "USD",
70
+ "PT": "EUR",
71
+ "SJ": "NOK",
72
+ "PY": "PYG",
73
+ "IQ": "IQD",
74
+ "PA": "PAB",
75
+ "PF": "XPF",
76
+ "PG": "PGK",
77
+ "PE": "PEN",
78
+ "PK": "PKR",
79
+ "PH": "PHP",
80
+ "PN": "NZD",
81
+ "PL": "PLN",
82
+ "PM": "EUR",
83
+ "ZM": "ZMK",
84
+ "EH": "MAD",
85
+ "EE": "EUR",
86
+ "EG": "EGP",
87
+ "ZA": "ZAR",
88
+ "EC": "USD",
89
+ "IT": "EUR",
90
+ "VN": "VND",
91
+ "SB": "SBD",
92
+ "ET": "ETB",
93
+ "SO": "SOS",
94
+ "ZW": "ZWL",
95
+ "SA": "SAR",
96
+ "ES": "EUR",
97
+ "ER": "ERN",
98
+ "ME": "EUR",
99
+ "MD": "MDL",
100
+ "MG": "MGA",
101
+ "MF": "EUR",
102
+ "MA": "MAD",
103
+ "MC": "EUR",
104
+ "UZ": "UZS",
105
+ "MM": "MMK",
106
+ "ML": "XOF",
107
+ "MO": "MOP",
108
+ "MN": "MNT",
109
+ "MH": "USD",
110
+ "MK": "MKD",
111
+ "MU": "MUR",
112
+ "MT": "EUR",
113
+ "MW": "MWK",
114
+ "MV": "MVR",
115
+ "MQ": "EUR",
116
+ "MP": "USD",
117
+ "MS": "XCD",
118
+ "MR": "MRO",
119
+ "IM": "GBP",
120
+ "UG": "UGX",
121
+ "TZ": "TZS",
122
+ "MY": "MYR",
123
+ "MX": "MXN",
124
+ "IL": "ILS",
125
+ "FR": "EUR",
126
+ "IO": "USD",
127
+ "SH": "SHP",
128
+ "FI": "EUR",
129
+ "FJ": "FJD",
130
+ "FK": "FKP",
131
+ "FM": "USD",
132
+ "FO": "DKK",
133
+ "NI": "NIO",
134
+ "NL": "EUR",
135
+ "NO": "NOK",
136
+ "NA": "NAD",
137
+ "VU": "VUV",
138
+ "NC": "XPF",
139
+ "NE": "XOF",
140
+ "NF": "AUD",
141
+ "NG": "NGN",
142
+ "NZ": "NZD",
143
+ "NP": "NPR",
144
+ "NR": "AUD",
145
+ "NU": "NZD",
146
+ "CK": "NZD",
147
+ "XK": "EUR",
148
+ "CI": "XOF",
149
+ "CH": "CHF",
150
+ "CO": "COP",
151
+ "CN": "CNY",
152
+ "CM": "XAF",
153
+ "CL": "CLP",
154
+ "CC": "AUD",
155
+ "CA": "CAD",
156
+ "CG": "XAF",
157
+ "CF": "XAF",
158
+ "CD": "CDF",
159
+ "CZ": "CZK",
160
+ "CY": "EUR",
161
+ "CX": "AUD",
162
+ "CR": "CRC",
163
+ "CW": "ANG",
164
+ "CV": "CVE",
165
+ "CU": "CUP",
166
+ "SZ": "SZL",
167
+ "SY": "SYP",
168
+ "SX": "ANG",
169
+ "KG": "KGS",
170
+ "KE": "KES",
171
+ "SS": "SSP",
172
+ "SR": "SRD",
173
+ "KI": "AUD",
174
+ "KH": "KHR",
175
+ "KN": "XCD",
176
+ "KM": "KMF",
177
+ "ST": "STD",
178
+ "SK": "EUR",
179
+ "KR": "KRW",
180
+ "SI": "EUR",
181
+ "KP": "KPW",
182
+ "KW": "KWD",
183
+ "SN": "XOF",
184
+ "SM": "EUR",
185
+ "SL": "SLL",
186
+ "SC": "SCR",
187
+ "KZ": "KZT",
188
+ "KY": "KYD",
189
+ "SG": "SGD",
190
+ "SE": "SEK",
191
+ "SD": "SDG",
192
+ "DO": "DOP",
193
+ "DM": "XCD",
194
+ "DJ": "DJF",
195
+ "DK": "DKK",
196
+ "VG": "USD",
197
+ "DE": "EUR",
198
+ "YE": "YER",
199
+ "DZ": "DZD",
200
+ "US": "USD",
201
+ "UY": "UYU",
202
+ "YT": "EUR",
203
+ "UM": "USD",
204
+ "LB": "LBP",
205
+ "LC": "XCD",
206
+ "LA": "LAK",
207
+ "TV": "AUD",
208
+ "TW": "TWD",
209
+ "TT": "TTD",
210
+ "TR": "TRY",
211
+ "LK": "LKR",
212
+ "LI": "CHF",
213
+ "LV": "EUR",
214
+ "TO": "TOP",
215
+ "LT": "LTL",
216
+ "LU": "EUR",
217
+ "LR": "LRD",
218
+ "LS": "LSL",
219
+ "TH": "THB",
220
+ "TF": "EUR",
221
+ "TG": "XOF",
222
+ "TD": "XAF",
223
+ "TC": "USD",
224
+ "LY": "LYD",
225
+ "VA": "EUR",
226
+ "VC": "XCD",
227
+ "AE": "AED",
228
+ "AD": "EUR",
229
+ "AG": "XCD",
230
+ "AF": "AFN",
231
+ "AI": "XCD",
232
+ "VI": "USD",
233
+ "IS": "ISK",
234
+ "IR": "IRR",
235
+ "AM": "AMD",
236
+ "AL": "ALL",
237
+ "AO": "AOA",
238
+ "AQ": "",
239
+ "AS": "USD",
240
+ "AR": "ARS",
241
+ "AU": "AUD",
242
+ "AT": "EUR",
243
+ "AW": "AWG",
244
+ "IN": "INR",
245
+ "AX": "EUR",
246
+ "AZ": "AZN",
247
+ "IE": "EUR",
248
+ "ID": "IDR",
249
+ "UA": "UAH",
250
+ "QA": "QAR",
251
+ "MZ": "MZN"
252
+ }
index.php CHANGED
File without changes
languages/enhanced-ecommerce-google-analytics.pot CHANGED
File without changes
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Public {
24
  /**
@@ -28,7 +28,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
28
  * @return void
29
  */
30
  //set plugin version
31
- public $tvc_eeVer = '2.2.0';
32
 
33
  protected $tvc_aga;
34
 
@@ -242,17 +242,30 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
242
  $order = new WC_Order($order_id);
243
  //Get Applied Coupon Codes
244
  $coupons_list = '';
245
- if ($order->get_used_coupons()) {
246
- $coupons_count = count($order->get_used_coupons());
247
- $i = 1;
248
- foreach ($order->get_used_coupons() as $coupon) {
249
- $coupons_list .= $coupon;
250
- if ($i < $coupons_count)
251
- $coupons_list .= ', ';
252
- $i++;
 
 
253
  }
 
 
 
 
 
 
 
 
 
 
 
254
  }
255
-
256
  //get domain name if value is set
257
  if (!empty($this->ga_Dname)) {
258
  $set_domain_name = esc_js($this->ga_Dname);
@@ -263,10 +276,16 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
263
  // Order items
264
  if ($order->get_items()) {
265
  foreach ($order->get_items() as $item) {
266
- $_product = $order->get_product_from_item($item);
267
  if (isset($_product->variation_data)) {
268
- $categories=esc_js(wc_get_formatted_variation($_product->get_variation_attributes(), true));
269
-
 
 
 
 
 
 
270
  } else {
271
  $out = array();
272
  if(version_compare($woocommerce->version, "2.7", "<")){
@@ -283,25 +302,38 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
283
  $categories=esc_js(join(",", $out));
284
  }
285
  //orderpage Prod json
286
- if(version_compare($woocommerce->version, "2.7", "<")){
287
  $orderpage_prod_Array[get_permalink($_product->ID)]=array(
288
  "tvc_id" => esc_html($_product->ID),
289
  "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->ID),
290
  "tvc_n" => html_entity_decode($item["name"]),
291
  "tvc_p" => esc_js($order->get_item_total($item)),
292
  "tvc_c" => $categories,
 
293
  "tvc_q"=>esc_js($item["qty"])
294
  );
295
- }else{
296
- $orderpage_prod_Array[get_permalink($_product->get_id())]=array(
 
 
 
 
 
 
 
 
 
 
297
  "tvc_id" => esc_html($_product->get_id()),
298
  "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->get_id()),
299
  "tvc_n" => html_entity_decode($_product->get_title()),
300
  "tvc_p" => esc_js($order->get_item_total($item)),
301
  "tvc_c" => $categories,
302
  "tvc_q"=>esc_js($item["qty"])
303
- );
 
304
  }
 
305
  }
306
  //make json for prod meta data on order page
307
  $this->wc_version_compare("tvc_oc=" . json_encode($orderpage_prod_Array) . ";");
@@ -334,6 +366,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
334
  "id": tvc_oc[t_item].tvc_i,
335
  "name": tvc_oc[t_item].tvc_n,
336
  "category": tvc_oc[t_item].tvc_c,
 
337
  "price": tvc_oc[t_item].tvc_p,
338
  "quantity": tvc_oc[t_item].tvc_q,
339
  });
@@ -367,7 +400,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
367
  function add_to_cart() {
368
  if ($this->disable_tracking($this->ga_eeT))
369
  return;
370
- //return if not product page
371
  if (!is_single())
372
  return;
373
  global $product,$woocommerce;
@@ -574,7 +607,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
574
  }
575
 
576
  } else {
577
- //else prod add in homepage recent json
578
  if(version_compare($woocommerce->version, "2.7", "<")){
579
  $homepage_json_rp[get_permalink($product->id)] =array(
580
  "tvc_id" => esc_html($product->id),
@@ -1015,6 +1048,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1015
  "id": tvc_ch[t_item].tvc_i,
1016
  "name": tvc_ch[t_item].tvc_n,
1017
  "category": tvc_ch[t_item].tvc_c,
 
1018
  "price": tvc_ch[t_item].tvc_p,
1019
  "quantity": tvc_ch[t_item].tvc_q
1020
  });
@@ -1045,6 +1079,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1045
  "id": tvc_ch[t_item].tvc_i,
1046
  "name": tvc_ch[t_item].tvc_n,
1047
  "category": tvc_ch[t_item].tvc_c,
 
1048
  "price": tvc_ch[t_item].tvc_p,
1049
  "quantity": tvc_ch[t_item].tvc_q
1050
  });
@@ -1081,6 +1116,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
1081
  "id": tvc_ch[t_item].tvc_i,
1082
  "name": tvc_ch[t_item].tvc_n,
1083
  "category": tvc_ch[t_item].tvc_c,
 
1084
  "price": tvc_ch[t_item].tvc_p,
1085
  "quantity": tvc_ch[t_item].tvc_q
1086
  });
<
18
  *
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/public
21
+ * @author Chetan Rode <chetan@tatvic.com>
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Public {
24
  /**
28
  * @return void
29
  */
30
  //set plugin version
31
+ public $tvc_eeVer = '2.3.6.1';
32
 
33
  protected $tvc_aga;
34
 
242
  $order = new WC_Order($order_id);
243
  //Get Applied Coupon Codes
244
  $coupons_list = '';
245
+ if(version_compare($woocommerce->version, "3.7", ">")){
246
+ if ($order->get_coupon_codes()) {
247
+ $coupons_count = count($order->get_coupon_codes());
248
+ $i = 1;
249
+ foreach ($order->get_coupon_codes() as $coupon) {
250
+ $coupons_list .= $coupon;
251
+ if ($i < $coupons_count)
252
+ $coupons_list .= ', ';
253
+ $i++;
254
+ }
255
  }
256
+ }else{
257
+ if ($order->get_used_coupons()) {
258
+ $coupons_count = count($order->get_used_coupons());
259
+ $i = 1;
260
+ foreach ($order->get_used_coupons() as $coupon) {
261
+ $coupons_list .= $coupon;
262
+ if ($i < $coupons_count)
263
+ $coupons_list .= ', ';
264
+ $i++;
265
+ }
266
+ }
267
  }
268
+
269
  //get domain name if value is set
270
  if (!empty($this->ga_Dname)) {
271
  $set_domain_name = esc_js($this->ga_Dname);
276
  // Order items
277
  if ($order->get_items()) {
278
  foreach ($order->get_items() as $item) {
279
+ $_product = $item->get_product();
280
  if (isset($_product->variation_data)) {
281
+ $categories=get_the_terms($_product->get_parent_id(), "product_cat");
282
+ $attributes=esc_js(wc_get_formatted_variation($_product->get_variation_attributes(), true));
283
+ if ($categories) {
284
+ foreach ($categories as $category) {
285
+ $out[] = $category->name;
286
+ }
287
+ }
288
+ $categories=esc_js(join(",", $out));
289
  } else {
290
  $out = array();
291
  if(version_compare($woocommerce->version, "2.7", "<")){
302
  $categories=esc_js(join(",", $out));
303
  }
304
  //orderpage Prod json
305
+ if (isset($_product->variation_data)) {
306
  $orderpage_prod_Array[get_permalink($_product->ID)]=array(
307
  "tvc_id" => esc_html($_product->ID),
308
  "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->ID),
309
  "tvc_n" => html_entity_decode($item["name"]),
310
  "tvc_p" => esc_js($order->get_item_total($item)),
311
  "tvc_c" => $categories,
312
+ "tvc_attr" => $attributes,
313
  "tvc_q"=>esc_js($item["qty"])
314
  );
315
+ } else {
316
+ if(version_compare($woocommerce->version, "2.7", "<")){
317
+ $orderpage_prod_Array[get_permalink($_product->ID)]=array(
318
+ "tvc_id" => esc_html($_product->ID),
319
+ "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->ID),
320
+ "tvc_n" => html_entity_decode($item["name"]),
321
+ "tvc_p" => esc_js($order->get_item_total($item)),
322
+ "tvc_c" => $categories,
323
+ "tvc_q"=>esc_js($item["qty"])
324
+ );
325
+ }else{
326
+ $orderpage_prod_Array[get_permalink($_product->get_id())]=array(
327
  "tvc_id" => esc_html($_product->get_id()),
328
  "tvc_i" => esc_js($_product->get_sku() ? $_product->get_sku() : $_product->get_id()),
329
  "tvc_n" => html_entity_decode($_product->get_title()),
330
  "tvc_p" => esc_js($order->get_item_total($item)),
331
  "tvc_c" => $categories,
332
  "tvc_q"=>esc_js($item["qty"])
333
+ );
334
+ }
335
  }
336
+
337
  }
338
  //make json for prod meta data on order page
339
  $this->wc_version_compare("tvc_oc=" . json_encode($orderpage_prod_Array) . ";");
366
  "id": tvc_oc[t_item].tvc_i,
367
  "name": tvc_oc[t_item].tvc_n,
368
  "category": tvc_oc[t_item].tvc_c,
369
+ "attributes": tvc_oc[t_item].tvc_attr,
370
  "price": tvc_oc[t_item].tvc_p,
371
  "quantity": tvc_oc[t_item].tvc_q,
372
  });
400
  function add_to_cart() {
401
  if ($this->disable_tracking($this->ga_eeT))
402
  return;
403
+ //return if not product page
404
  if (!is_single())
405
  return;
406
  global $product,$woocommerce;
607
  }
608
 
609
  } else {
610
+ //else prod add in homepage recent json
611
  if(version_compare($woocommerce->version, "2.7", "<")){
612
  $homepage_json_rp[get_permalink($product->id)] =array(
613
  "tvc_id" => esc_html($product->id),
1048
  "id": tvc_ch[t_item].tvc_i,
1049
  "name": tvc_ch[t_item].tvc_n,
1050
  "category": tvc_ch[t_item].tvc_c,
1051
+ "attributes": tvc_ch[t_item].tvc_attr,
1052
  "price": tvc_ch[t_item].tvc_p,
1053
  "quantity": tvc_ch[t_item].tvc_q
1054
  });
1079
  "id": tvc_ch[t_item].tvc_i,
1080
  "name": tvc_ch[t_item].tvc_n,
1081
  "category": tvc_ch[t_item].tvc_c,
1082
+ "attributes": tvc_ch[t_item].tvc_attr,
1083
  "price": tvc_ch[t_item].tvc_p,
1084
  "quantity": tvc_ch[t_item].tvc_q
1085
  });
1116
  "id": tvc_ch[t_item].tvc_i,