Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.0

Version Description

Download this release

Release Info

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

Code changes from version 3.1.3 to 4.0

Files changed (50) hide show
  1. admin/class-.txt +0 -276
  2. admin/class-enhanced-ecommerce-google-analytics-admin.php +47 -15
  3. admin/class-enhanced-ecommerce-google-analytics-settings.php +1 -1
  4. admin/class-tvc-admin-db-helper.php +1 -1
  5. admin/class-tvc-admin-helper.php +4 -2
  6. admin/css/custom-style.css +344 -9
  7. admin/css/enhanced-ecommerce-google-analytics-admin.css +41 -6
  8. admin/images/adwords.png +0 -0
  9. admin/images/check.png +0 -0
  10. admin/images/close.png +0 -0
  11. admin/images/cotlw.png +0 -0
  12. admin/images/discount.gif +0 -0
  13. admin/images/exclaimation.png +0 -0
  14. admin/images/facebook.jpg +0 -0
  15. admin/images/google_optimize.png +0 -0
  16. admin/images/icon/google-shopping.svg +1 -0
  17. admin/images/icon/woocommerce.svg +1 -0
  18. admin/images/logo.png +0 -0
  19. admin/images/m1.png +0 -0
  20. admin/images/m2.png +0 -0
  21. admin/images/rating.png +0 -0
  22. admin/images/ratings.png +0 -0
  23. admin/images/shopify_new.png +0 -0
  24. admin/images/tatvic_logo.png +0 -0
  25. admin/images/woo.png +0 -0
  26. admin/partials/about-plugin.php +0 -184
  27. admin/partials/enhanced-ecommerce-google-analytics-admin-display.php +20 -1
  28. admin/partials/general-fields.php +2 -3
  29. admin/partials/pricings.php +364 -0
  30. enhanced-ecommerce-google-analytics.php +2 -2
  31. includes/class-enhanced-ecommerce-google-analytics-activator.php +1 -1
  32. includes/class-enhanced-ecommerce-google-analytics-deactivator.php +1 -1
  33. includes/class-enhanced-ecommerce-google-analytics-i18n.php +1 -1
  34. includes/class-enhanced-ecommerce-google-analytics-loader.php +1 -1
  35. includes/class-enhanced-ecommerce-google-analytics.php +9 -5
  36. includes/data/class-tvc-ajax-file.php +224 -79
  37. includes/setup/CustomApi.php +36 -1
  38. includes/setup/ShoppingApi.php +60 -70
  39. includes/setup/account.php +180 -0
  40. includes/setup/add-campaign.php +33 -35
  41. includes/setup/class-tatvic-category-selector-element.php +11 -12
  42. includes/setup/class-tvc-product-sync-helper.php +780 -0
  43. includes/setup/google-shopping-feed-gaa-config.php +25 -357
  44. includes/setup/google-shopping-feed-shopping-campaigns.php +1 -1
  45. includes/setup/google-shopping-feed-sync-product.php +83 -426
  46. includes/setup/google-shopping-feed.php +2 -1
  47. public/class-enhanced-ecommerce-google-analytics-public-pro.php +76 -86
  48. public/class-enhanced-ecommerce-google-analytics-public.php +25 -6
  49. public/js/tvc-ee-google-analytics.js +81 -63
  50. readme.txt +67 -31
admin/class-.txt DELETED
@@ -1,276 +0,0 @@
1
- <?php
2
- if ( ! class_exists( 'TVC_Survey' ) ) {
3
-
4
- class TVC_Survey {
5
- public $api_url = '';
6
- public $name;
7
- public $plugin;
8
- public function __construct( $name = '', $plugin = '' ){
9
- $this->name = $name;
10
- $this->plugin = $plugin;
11
- if ( $this->is_dev_url() ) {
12
- return;
13
- }
14
-
15
- add_action( 'admin_print_scripts', array( $this, 'tvc_js' ), 20 );
16
- add_action( 'admin_print_scripts', array( $this, 'tvc_css' ) );
17
- add_action( 'admin_footer', array( $this, 'tvc_modal' ) );
18
- }
19
- public function is_dev_url() {
20
- $url = network_site_url( '/' );
21
- $is_local_url = false;
22
- // Trim it up
23
- $url = strtolower( trim( $url ) );
24
- if ( false === strpos( $url, 'http://' ) && false === strpos( $url, 'https://' ) ) {
25
- $url = 'http://' . $url;
26
- }
27
- $url_parts = parse_url( $url );
28
- $host = ! empty( $url_parts['host'] ) ? $url_parts['host'] : false;
29
- if ( ! empty( $url ) && ! empty( $host ) ) {
30
- if ( false !== ip2long( $host ) ) {
31
- if ( ! filter_var( $host, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE ) ) {
32
- $is_local_url = true;
33
- }
34
- } else if ( 'localhost' === $host ) {
35
- $is_local_url = true;
36
- }
37
-
38
- $tlds_to_check = array( '.dev', '.local', ':8888' );
39
- foreach ( $tlds_to_check as $tld ) {
40
- if ( false !== strpos( $host, $tld ) ) {
41
- $is_local_url = true;
42
- continue;
43
- }
44
-
45
- }
46
- if ( substr_count( $host, '.' ) > 1 ) {
47
- $subdomains_to_check = array( 'dev.', '*.staging.', 'beta.', 'test.' );
48
- foreach ( $subdomains_to_check as $subdomain ) {
49
- $subdomain = str_replace( '.', '(.)', $subdomain );
50
- $subdomain = str_replace( array( '*', '(.)' ), '(.*)', $subdomain );
51
- if ( preg_match( '/^(' . $subdomain . ')/', $host ) ) {
52
- $is_local_url = true;
53
- continue;
54
- }
55
- }
56
- }
57
- }
58
- return $is_local_url;
59
- }
60
- public function is_plugin_page() {
61
- $screen = function_exists( 'get_current_screen' ) ? get_current_screen() : false;
62
- if ( empty( $screen ) ) {
63
- return false;
64
- }
65
- return ( ! empty( $screen->id ) && in_array( $screen->id, array( 'plugins', 'plugins-network' ), true ) );
66
- }
67
- public function tvc_js() {
68
-
69
- if ( ! $this->is_plugin_page() ) {
70
- return;
71
- }
72
- ?>
73
- <script type="text/javascript">
74
- jQuery(function($){
75
- var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
76
- $overlay = $('#ee-survey-<?php echo $this->plugin; ?>'),
77
- $form = $overlay.find('form'),
78
- formOpen = false;
79
- // Plugin listing table deactivate link.
80
- $deactivateLink.on('click', function(event) {
81
- event.preventDefault();
82
- $overlay.css('display', 'table');
83
- formOpen = true;
84
- $form.find('.ee-survey-option:first-of-type input[type=radio]').focus();
85
- });
86
- // Survey radio option selected.
87
- $form.on('change', 'input[type=radio]', function(event) {
88
- event.preventDefault();
89
- $form.find('input[type=text], .error').hide();
90
- $form.find('.ee-survey-option').removeClass('selected');
91
- $(this).closest('.ee-survey-option').addClass('selected').find('input[type=text]').show();
92
- });
93
- // Survey Skip & Deactivate.
94
- $form.on('click', '.ee-survey-deactivate', function(event) {
95
- event.preventDefault();
96
- location.href = $deactivateLink.attr('href');
97
- });
98
- // Survey submit.
99
- $form.submit(function(event) {
100
- event.preventDefault();
101
- if (! $form.find('input[type=radio]:checked').val()) {
102
- $form.find('.ee-survey-footer').prepend('<span class="error"><?php echo esc_js( __( 'Please select an option', 'google-analytics-for-wordpress' ) ); ?></span>');
103
- return;
104
- }
105
- var data = {
106
- code: $form.find('.selected input[type=radio]').val(),
107
- reason: $form.find('.selected .ee-survey-option-reason').text(),
108
- details: $form.find('.selected input[type=text]').val(),
109
- site: '<?php echo esc_url( home_url() ); ?>',
110
- plugin: '<?php echo sanitize_key( $this->name ); ?>'
111
- }
112
- var submitSurvey = $.post('<?php echo $this->api_url; ?>', data);
113
- submitSurvey.always(function() {
114
- location.href = $deactivateLink.attr('href');
115
- });
116
- });
117
- // Exit key closes survey when open.
118
- $(document).keyup(function(event) {
119
- if (27 === event.keyCode && formOpen) {
120
- $overlay.hide();
121
- formOpen = false;
122
- $deactivateLink.focus();
123
- }
124
- });
125
- });
126
- </script>
127
- <?php
128
- }
129
- public function tvc_css() {
130
-
131
- if ( ! $this->is_plugin_page() ) {
132
- return;
133
- }
134
- ?>
135
- <style type="text/css">
136
- .ee-survey-modal {
137
- display: none;
138
- table-layout: fixed;
139
- position: fixed;
140
- z-index: 9999;
141
- width: 100%;
142
- height: 100%;
143
- text-align: center;
144
- font-size: 14px;
145
- top: 0;
146
- left: 0;
147
- background: rgba(0,0,0,0.8);
148
- }
149
- .ee-survey-wrap {
150
- display: table-cell;
151
- vertical-align: middle;
152
- }
153
- .ee-survey {
154
- background-color: #fff;
155
- max-width: 550px;
156
- margin: 0 auto;
157
- padding: 30px;
158
- text-align: left;
159
- }
160
- .ee-survey .error {
161
- display: block;
162
- color: red;
163
- margin: 0 0 10px 0;
164
- }
165
- .ee-survey-title {
166
- display: block;
167
- font-size: 18px;
168
- font-weight: 700;
169
- text-transform: uppercase;
170
- border-bottom: 1px solid #ddd;
171
- padding: 0 0 18px 0;
172
- margin: 0 0 18px 0;
173
- }
174
- .ee-survey-title span {
175
- color: #999;
176
- margin-right: 10px;
177
- }
178
- .ee-survey-desc {
179
- display: block;
180
- font-weight: 600;
181
- margin: 0 0 18px 0;
182
- }
183
- .ee-survey-option {
184
- margin: 0 0 10px 0;
185
- }
186
- .ee-survey-option-input {
187
- margin-right: 10px !important;
188
- }
189
- .ee-survey-option-details {
190
- display: none;
191
- width: 90%;
192
- margin: 10px 0 0 30px;
193
- }
194
- .ee-survey-footer {
195
- margin-top: 18px;
196
- }
197
- .ee-survey-deactivate {
198
- float: right;
199
- font-size: 13px;
200
- color: #ccc;
201
- text-decoration: none;
202
- padding-top: 7px;
203
- }
204
- </style>
205
- <?php
206
- }
207
- public function tvc_modal() {
208
-
209
- if ( ! $this->is_plugin_page() ) {
210
- return;
211
- }
212
-
213
- $options = array(
214
- 1 => array(
215
- "title" => esc_html__("No longer need the plugin","enhanced-e-commerce-for-woocommerce-store"),
216
- ),
217
- 2 => array(
218
- 'title' => esc_html__("Switching to a different plugin","enhanced-e-commerce-for-woocommerce-store"),
219
- 'details' => esc_html__( 'Please share which plugin', 'google-analytics-for-wordpress' ),
220
- ),
221
- 3 => array(
222
- 'title' => esc_html__("Couldn't get the plugin to work","enhanced-e-commerce-for-woocommerce-store"),
223
- ),
224
- 4 => array(
225
- 'title' => esc_html__("It's a temporary deactivation","enhanced-e-commerce-for-woocommerce-store"),
226
- ),
227
- 5 => array(
228
- 'title' => esc_html__("No longer need the plugin","enhanced-e-commerce-for-woocommerce-store"),
229
- 'details' => esc_html__( 'Please share the reason', 'google-analytics-for-wordpress' ),
230
- ),
231
- );
232
- ?>
233
- <div class="ee-survey-modal" id="ee-survey-<?php echo $this->plugin; ?>">
234
- <div class="ee-survey-wrap">
235
- <form class="ee-survey" method="post">
236
- <span class="ee-survey-title"><span class="dashicons dashicons-testimonial"></span><?php echo ' ' . esc_html__( 'Quick Feedback', 'google-analytics-for-wordpress' ); ?></span>
237
- <span class="ee-survey-desc">
238
- <?php
239
- // Translators: Placeholder for the plugin name.
240
- echo sprintf( esc_html__('If you have a moment, please share why you are deactivating %s:', 'google-analytics-for-wordpress' ), $this->name );
241
- ?>
242
- </span>
243
- <div class="ee-survey-options">
244
- <?php foreach ( $options as $id => $option ) : ?>
245
- <div class="ee-survey-option">
246
- <label for="ee-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="ee-survey-option-label">
247
- <input id="ee-survey-option-<?php echo $this->plugin; ?>-<?php echo $id; ?>" class="ee-survey-option-input" type="radio" name="code" value="<?php echo $id; ?>" />
248
- <span class="ee-survey-option-reason"><?php echo $option['title']; ?></span>
249
- </label>
250
- <?php if ( ! empty( $option['details'] ) ) : ?>
251
- <input class="ee-survey-option-details" type="text" placeholder="<?php echo $option['details']; ?>" />
252
- <?php endif; ?>
253
- </div>
254
- <?php endforeach; ?>
255
- </div>
256
- <div class="ee-survey-footer">
257
- <button type="submit" class="ee-survey-submit button button-primary button-large">
258
- <?php
259
- // Translators: Adds an ampersand.
260
- echo sprintf( esc_html__('Submit %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
261
- ?>
262
- </button>
263
- <a href="#" class="ee-survey-deactivate">
264
- <?php
265
- // Translators: Adds an ampersand.
266
- echo sprintf( esc_html__('Skip %s Deactivate', 'google-analytics-for-wordpress' ), '&amp;' );
267
- ?>
268
- </a>
269
- </div>
270
- </form>
271
- </div>
272
- </div>
273
- <?php
274
- }
275
- }
276
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -18,7 +18,7 @@
18
  *
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
22
  */
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
@@ -53,12 +53,14 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
53
  protected $ga_eeT;
54
  protected $site_url;
55
  protected $pro_plan_site;
 
56
  public function __construct($plugin_name, $version) {
57
  $this->plugin_name = $plugin_name;
58
  $this->version = $version;
59
  $this->url = $this->get_connect_url();
60
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
61
  $this->pro_plan_site = $this->get_pro_plan_site();
 
62
  }
63
  public function tvc_admin_notice(){
64
  // add fixed message notification
@@ -66,11 +68,11 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
66
  $ee_additional_data = $this->get_ee_additional_data();
67
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_a']) && $ee_additional_data['dismissed_ee_adimin_notic_a'] == 1){
68
  }else{
69
- if(!$this->get_subscriptionId()){
70
- echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
71
- <p>Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster. <a href="admin.php?page=enhanced-ecommerce-google-analytics-admin-display"><b><u>CONFIGURE NOW</u></b></a></p>
72
- </div>';
73
- }
74
  }
75
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_b']) && $ee_additional_data['dismissed_ee_adimin_notic_b'] == 1){
76
  }else{
@@ -190,7 +192,15 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
190
  *
191
  * @since 1.0.0
192
  */
193
- public function display_admin_page() {
 
 
 
 
 
 
 
 
194
  add_menu_page(
195
  '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
196
  );
@@ -211,10 +221,27 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
211
  'enhanced-ecommerce-google-analytics-admin-display&tab=google_shopping_feed',
212
  array($this, 'showPage')
213
  );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
214
  }
215
- protected function create_head(){
216
- $google_detail = $this->get_ee_options_data();
217
- $googleDetail = "";
218
  if(isset($google_detail['setting'])){
219
  $googleDetail = $google_detail['setting'];
220
  }
@@ -243,12 +270,12 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
243
  <div class="header-section">
244
  <?php if($plan_id == 1){?>
245
  <div class="top-section">
246
- <p>You are using free plugin. To unlock more features consider <a href="<?php echo $this->pro_plan_site; ?>" target="_blank" class="text-underline">upgrading to pro</a>..!!!</p>
247
  </div>
248
  <?php } ?>
249
  <nav class="navbar navbar-section">
250
  <a class="navbar-brand">
251
- <img src="https://d3rv1nmzvje89q.cloudfront.net/optimized_v5/2017/02/logo_optimize-1024x310.png"/>
252
  </a>
253
  <div class="form-inline">
254
  <span class="nav-btn">
@@ -270,12 +297,13 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
270
  $html.="<li>
271
  <section class=\"tvc-msg plain\">
272
  <div class=\"tvc-msg_wrapper\">
273
- <div class=\"tvc-msg_content\">".$m_date . $m_title.$m_html."</div>
274
  <div class=\"tvc-msg_actions\">
275
  ".$m_link."
276
  <div class=\"tvc-dropdown\">
277
  <button type=\"button\" data-id=".$key." class=\"tvc-notification-button is-tertiary is-dismissible-notification\">Dismiss</button>
278
  </div>
 
279
  </div>
280
  </div>
281
  </section>
@@ -386,11 +414,15 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
386
  return $msg_false;
387
  }
388
  }
389
- /*public function account(){
 
 
 
 
390
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
391
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/account.php');
392
  new TVC_Account();
393
- }*/
394
  public function general_settings() {
395
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
396
  require_once( 'partials/general-fields.php');
18
  *
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
21
+ * @author Tatvic
22
  */
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
53
  protected $ga_eeT;
54
  protected $site_url;
55
  protected $pro_plan_site;
56
+ protected $google_detail;
57
  public function __construct($plugin_name, $version) {
58
  $this->plugin_name = $plugin_name;
59
  $this->version = $version;
60
  $this->url = $this->get_connect_url();
61
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
62
  $this->pro_plan_site = $this->get_pro_plan_site();
63
+ $this->google_detail = $this->get_ee_options_data();
64
  }
65
  public function tvc_admin_notice(){
66
  // add fixed message notification
68
  $ee_additional_data = $this->get_ee_additional_data();
69
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_a']) && $ee_additional_data['dismissed_ee_adimin_notic_a'] == 1){
70
  }else{
71
+ if(!$this->get_subscriptionId()){
72
+ echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
73
+ <p>Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster. <a href="admin.php?page=enhanced-ecommerce-google-analytics-admin-display"><b><u>CONFIGURE NOW</u></b></a></p>
74
+ </div>';
75
+ }
76
  }
77
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_b']) && $ee_additional_data['dismissed_ee_adimin_notic_b'] == 1){
78
  }else{
192
  *
193
  * @since 1.0.0
194
  */
195
+ public function display_admin_page() {
196
+ $google_detail = $this->google_detail;
197
+ $plan_id = 1;
198
+ if(isset($google_detail['setting'])){
199
+ $googleDetail = $google_detail['setting'];
200
+ if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
201
+ $plan_id = $googleDetail->plan_id;
202
+ }
203
+ }
204
  add_menu_page(
205
  '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
206
  );
221
  'enhanced-ecommerce-google-analytics-admin-display&tab=google_shopping_feed',
222
  array($this, 'showPage')
223
  );
224
+ add_submenu_page(
225
+ 'enhanced-ecommerce-google-analytics-admin-display',
226
+ esc_html__('Account Summary', 'enhanced-ecommerce-google-analytics-admin-display'),
227
+ esc_html__('Account Summary', 'enhanced-ecommerce-google-analytics-admin-display'),
228
+ 'manage_options',
229
+ 'enhanced-ecommerce-google-analytics-admin-display&tab=account',
230
+ array($this, 'showPage')
231
+ );
232
+ if($plan_id == 1){
233
+ add_submenu_page(
234
+ 'enhanced-ecommerce-google-analytics-admin-display',
235
+ esc_html__('Free Vs Pro', 'enhanced-ecommerce-google-analytics-admin-display'),
236
+ esc_html__('Free Vs Pro', 'enhanced-ecommerce-google-analytics-admin-display'),
237
+ 'manage_options',
238
+ 'enhanced-ecommerce-google-analytics-admin-display&tab=pricings',
239
+ array($this, 'showPage')
240
+ );
241
+ }
242
  }
243
+ protected function create_head(){
244
+ $google_detail = $this->google_detail;
 
245
  if(isset($google_detail['setting'])){
246
  $googleDetail = $google_detail['setting'];
247
  }
270
  <div class="header-section">
271
  <?php if($plan_id == 1){?>
272
  <div class="top-section">
273
+ <p>You are using free plugin. <a href="<?php echo $this->pro_plan_site.'?utm_source=EE+Plugin+User+Interface&utm_medium=Top+Bar+upgrading+to+pro&utm_campaign=Upsell+at+Conversios'; ?>" target="_blank" class="text-underline">Try premium features at no cost for 1 Month..!!</a>..!!!</p>
274
  </div>
275
  <?php } ?>
276
  <nav class="navbar navbar-section">
277
  <a class="navbar-brand">
278
+ <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/logo.png'; ?>"/>
279
  </a>
280
  <div class="form-inline">
281
  <span class="nav-btn">
297
  $html.="<li>
298
  <section class=\"tvc-msg plain\">
299
  <div class=\"tvc-msg_wrapper\">
300
+ <div class=\"tvc-msg_content\">".$m_title.$m_html."</div>
301
  <div class=\"tvc-msg_actions\">
302
  ".$m_link."
303
  <div class=\"tvc-dropdown\">
304
  <button type=\"button\" data-id=".$key." class=\"tvc-notification-button is-tertiary is-dismissible-notification\">Dismiss</button>
305
  </div>
306
+ ".$m_date."
307
  </div>
308
  </div>
309
  </section>
414
  return $msg_false;
415
  }
416
  }
417
+ public function pricings(){
418
+ require_once(ENHANCAD_PLUGIN_DIR . 'admin/partials/pricings.php');
419
+ new TVC_Pricings();
420
+ }
421
+ public function account(){
422
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
423
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/account.php');
424
  new TVC_Account();
425
+ }
426
  public function general_settings() {
427
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
428
  require_once( 'partials/general-fields.php');
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -17,7 +17,7 @@
17
  *
18
  * @package Enhanced_Ecommerce_Google_Analytics
19
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
20
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
21
  */
22
  if ( ! defined( 'ABSPATH' ) ) {
23
  exit();
17
  *
18
  * @package Enhanced_Ecommerce_Google_Analytics
19
  * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
20
+ * @author Tatvic
21
  */
22
  if ( ! defined( 'ABSPATH' ) ) {
23
  exit();
admin/class-tvc-admin-db-helper.php CHANGED
@@ -139,7 +139,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
139
  global $wpdb;
140
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) );
141
  if ( $wpdb->get_var( $query ) === $table ) {
142
- $wpdb->query("TRUNCATE TABLE IF EXISTS ".$table);
143
  }
144
  }
145
  }
139
  global $wpdb;
140
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $table ) );
141
  if ( $wpdb->get_var( $query ) === $table ) {
142
+ $wpdb->query("TRUNCATE TABLE ".$table);
143
  }
144
  }
145
  }
admin/class-tvc-admin-helper.php CHANGED
@@ -143,6 +143,7 @@ Class TVC_Admin_Helper{
143
  $syncProductStat = array("total" =>0, "approved" => 0, "disapproved" => 0, "pending" => 0 );
144
  }
145
  if(isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ""){
 
146
  $shopping_api = new ShoppingApi();
147
  $campaigns_list_res = $shopping_api->getCampaigns();
148
  if(isset($campaigns_list_res->data) && isset($campaigns_list_res->status) && $campaigns_list_res->status == 200) {
@@ -937,7 +938,7 @@ Class TVC_Admin_Helper{
937
  );
938
  $nofifications["tvc_f_notif_2"] = array(
939
  "tittle"=>"Share your feedback.",
940
- "html"=>"Your feedback is very important to us. Please write about your experience and the the new feature requests here.",
941
  "link"=>"https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/",
942
  "link_title"=>"Share Feedback",
943
  "link_type"=>"external"
@@ -1001,7 +1002,7 @@ Class TVC_Admin_Helper{
1001
  }
1002
 
1003
  public function get_pro_plan_site(){
1004
- return "https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=TatvicEE&utm_medium=DashboardBuyBottom&utm_campaign=WPlisting";
1005
  }
1006
 
1007
  public function is_ga_property(){
@@ -1021,6 +1022,7 @@ Class TVC_Admin_Helper{
1021
  return $this->plan_id;
1022
  }else{
1023
  $plan_id = 1;
 
1024
  if(isset($google_detail['setting'])){
1025
  $googleDetail = $google_detail['setting'];
1026
  if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
143
  $syncProductStat = array("total" =>0, "approved" => 0, "disapproved" => 0, "pending" => 0 );
144
  }
145
  if(isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != ""){
146
+ $this->update_remarketing_snippets();
147
  $shopping_api = new ShoppingApi();
148
  $campaigns_list_res = $shopping_api->getCampaigns();
149
  if(isset($campaigns_list_res->data) && isset($campaigns_list_res->status) && $campaigns_list_res->status == 200) {
938
  );
939
  $nofifications["tvc_f_notif_2"] = array(
940
  "tittle"=>"Share your feedback.",
941
+ "html"=>"Your feedback is very important to us. Please write about your experience and the new feature requests here.",
942
  "link"=>"https://wordpress.org/support/plugin/enhanced-e-commerce-for-woocommerce-store/reviews/",
943
  "link_title"=>"Share Feedback",
944
  "link_type"=>"external"
1002
  }
1003
 
1004
  public function get_pro_plan_site(){
1005
+ return "https://conversios.io/pricings/";
1006
  }
1007
 
1008
  public function is_ga_property(){
1022
  return $this->plan_id;
1023
  }else{
1024
  $plan_id = 1;
1025
+ $google_detail = $this->get_ee_options_data();
1026
  if(isset($google_detail['setting'])){
1027
  $googleDetail = $google_detail['setting'];
1028
  if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
admin/css/custom-style.css CHANGED
@@ -739,7 +739,8 @@ section {
739
  }
740
 
741
  .header-section .navbar-section {
742
- padding: 15px 0;
 
743
  margin-bottom: 0;
744
  }
745
 
@@ -748,8 +749,8 @@ section {
748
  }
749
 
750
  .header-section .navbar-section .navbar-brand img {
751
- max-width: 150px;
752
- max-height: 30px;
753
  }
754
 
755
  .header-section .navbar-section .nav-btn {
@@ -1451,20 +1452,21 @@ textarea.form-control, .select2.select2-container--default textarea.select2-sele
1451
 
1452
  .wizard-section.campaign-wizard .wizard-content .wizard .content .card-wrapper .row:first-child {
1453
  background-color: #000338;
1454
- padding: 15px;
1455
  margin-bottom: 1rem;
1456
  margin-left: 0;
1457
  margin-right: 0;
1458
  border-radius: calc(15px - 1px) calc(15px - 1px) 0 0;
1459
  }
1460
-
 
 
1461
  .wizard-section.campaign-wizard .wizard-content .wizard .content .card-wrapper .row:first-child .heading-tbl {
1462
  margin-bottom: 0;
1463
  font-size: 15px;
1464
  color: #FFFFFF;
1465
  text-decoration: none;
1466
  font-weight: normal;
1467
- border-right: 1px solid #FFFFFF;
1468
  text-align: center;
1469
  }
1470
 
@@ -1544,6 +1546,8 @@ textarea.form-control, .select2.select2-container--default textarea.select2-sele
1544
  text-align: center;
1545
  border-radius: 0;
1546
  background-color: transparent;
 
 
1547
  }
1548
 
1549
  .sync-new-product .product-card .col:after {
@@ -1551,8 +1555,8 @@ textarea.form-control, .select2.select2-container--default textarea.select2-sele
1551
  border-right: 1px solid #A9A9A9;
1552
  display: block;
1553
  position: absolute;
1554
- top: 25px;
1555
- bottom: 5px;
1556
  right: 0;
1557
  }
1558
  .sync-new-product .product-card .col:last-child:after {
@@ -2656,4 +2660,335 @@ textarea.form-control, .select2.select2-container--default textarea.select2-sele
2656
  .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key_change{display: table-cell; vertical-align: middle;}
2657
  .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key{display: table-cell; letter-spacing: 8px;
2658
  font-size: 15px; width: calc(100% - 110px); vertical-align: middle; font-weight: 400;}
2659
- .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key_title{vertical-align: middle; display: table-cell;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
739
  }
740
 
741
  .header-section .navbar-section {
742
+ /* padding: 15px 0;*/
743
+ padding: 10px 0 2px 0;
744
  margin-bottom: 0;
745
  }
746
 
749
  }
750
 
751
  .header-section .navbar-section .navbar-brand img {
752
+ width: auto;
753
+ max-height: 45px;
754
  }
755
 
756
  .header-section .navbar-section .nav-btn {
1452
 
1453
  .wizard-section.campaign-wizard .wizard-content .wizard .content .card-wrapper .row:first-child {
1454
  background-color: #000338;
1455
+ padding: 3px;
1456
  margin-bottom: 1rem;
1457
  margin-left: 0;
1458
  margin-right: 0;
1459
  border-radius: calc(15px - 1px) calc(15px - 1px) 0 0;
1460
  }
1461
+ .wizard-section.campaign-wizard .wizard-content .wizard .content .card-wrapper .row:first-child .col-6:first-child{
1462
+ border-right: 1px solid #FFFFFF;
1463
+ }
1464
  .wizard-section.campaign-wizard .wizard-content .wizard .content .card-wrapper .row:first-child .heading-tbl {
1465
  margin-bottom: 0;
1466
  font-size: 15px;
1467
  color: #FFFFFF;
1468
  text-decoration: none;
1469
  font-weight: normal;
 
1470
  text-align: center;
1471
  }
1472
 
1546
  text-align: center;
1547
  border-radius: 0;
1548
  background-color: transparent;
1549
+ box-shadow: none;
1550
+ margin: 0;
1551
  }
1552
 
1553
  .sync-new-product .product-card .col:after {
1555
  border-right: 1px solid #A9A9A9;
1556
  display: block;
1557
  position: absolute;
1558
+ top: 8px;
1559
+ bottom: 8px;
1560
  right: 0;
1561
  }
1562
  .sync-new-product .product-card .col:last-child:after {
2660
  .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key_change{display: table-cell; vertical-align: middle;}
2661
  .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key{display: table-cell; letter-spacing: 8px;
2662
  font-size: 15px; width: calc(100% - 110px); vertical-align: middle; font-weight: 400;}
2663
+ .tvc_licence_key_change_wapper.google-account-analytics .acc-num .tvc_licence_key_title{vertical-align: middle; display: table-cell;}
2664
+
2665
+ /*price Table*/
2666
+ .tvc-price-table-features{
2667
+ width: 100%;
2668
+ padding-top: 60px;
2669
+ }
2670
+ .tvc-price-table-features .container {
2671
+ width: 1300px;
2672
+ min-width: 1000px;
2673
+ margin: 0 auto;
2674
+ padding-left: 20px;
2675
+ padding-right: 20px;
2676
+ position: relative;
2677
+ }
2678
+ .tvc-price-table-features .column {
2679
+ float: left;
2680
+ border-right: 1px solid #ebebeb;
2681
+ position: relative;
2682
+ text-align: center;
2683
+ }
2684
+ .tvc-price-table-features .row-heading .column {
2685
+ border-top: 1px solid #ebebeb;
2686
+ }
2687
+ .tvc-price-table-features.columns-5 .column {
2688
+ width: 20%;
2689
+ }
2690
+ .tvc-price-table-features .column:nth-child(2) {
2691
+ border-left: 1px solid #ebebeb;
2692
+ }
2693
+
2694
+ .tvc-price-table-features .row-heading .column:first-of-type {
2695
+ border-top: none;
2696
+ }
2697
+
2698
+ .tvc-price-table-features .row-heading .column:first-child{
2699
+ border-right: 1px solid transparent;
2700
+ }
2701
+ .tvc-price-table-features .row-feature .column:first-child, .tvc-price-table-features .row-footer .column:first-child{
2702
+ border-right: 1px solid transparent;
2703
+ text-align: left;
2704
+ }
2705
+ .tvc-price-table-features .row-heading {
2706
+ display: -webkit-box;
2707
+ display: -ms-flexbox;
2708
+ display: flex;
2709
+ -webkit-box-align: stretch;
2710
+ -ms-flex-align: stretch;
2711
+ align-items: stretch;
2712
+ border-top: 1px solid transparent;
2713
+ border-left: 1px solid transparent;
2714
+ border-width: 1px 0 1px 1px;
2715
+ border-style: solid;
2716
+ border-color: #ebebeb;
2717
+ border-bottom: 0;
2718
+ }
2719
+
2720
+ .tvc-price-table-features .row-feature .column{
2721
+ padding: 12px 20px 12px 20px;
2722
+
2723
+ }
2724
+ /*.tvc-price-table-features .row.feature .column:first-of-type{
2725
+ text-align: left;
2726
+ padding-right: 5px;
2727
+ padding-left: 15px;
2728
+ }*/
2729
+ .tvc-price-table-features .row-feature .column:first-child{
2730
+ border-right: 1px solid transparent;.tvc-price-table-features .row-feature .column:first-child, .tvc-price-table-features .row-footer .column:first-child
2731
+ }
2732
+ .tvc-price-table-features .row-feature{
2733
+ font-size: 14px;
2734
+ border-width: 1px 0 1px 1px;
2735
+ border-style: solid;
2736
+ border-color: #ebebeb;
2737
+ border-bottom: 0;
2738
+ display: -webkit-box;
2739
+ display: -ms-flexbox;
2740
+ display: flex;
2741
+ -webkit-box-align: stretch;
2742
+ -ms-flex-align: stretch;
2743
+ align-items: stretch;
2744
+ }
2745
+
2746
+ .tvc-price-table-features .column .name-wrap {
2747
+ background: #f9f9f9;
2748
+ padding: 12px;
2749
+ margin: 0 0 16px 0;
2750
+ }
2751
+ .tvc-price-table-features .column .name {
2752
+ font-size: 23px;
2753
+ font-weight: 600;
2754
+ color: #060221;
2755
+ line-height: 44px;
2756
+ letter-spacing: 0px;
2757
+ }
2758
+ .tvc-price-table-features .column .price-normal {
2759
+ text-align: center;
2760
+ font-weight: 300;
2761
+ font-size: 15px;
2762
+ line-height: 1;
2763
+ margin: 0 0 10px 0;
2764
+ }
2765
+ .tvc-price-table-features .column .price-normal span {
2766
+ position: relative;
2767
+ font-size: 17px;
2768
+ }
2769
+ .tvc-price-table-features .column .price-normal span:after {
2770
+ content: ' ';
2771
+ width: 100%;
2772
+ height: 1px;
2773
+ border-bottom: 1px solid red;
2774
+ position: absolute;
2775
+ top: 55%;
2776
+ left: 0;
2777
+ }
2778
+ .clearfix:after {
2779
+ clear: both;
2780
+ content: " ";
2781
+ display: table;
2782
+ }
2783
+
2784
+
2785
+ .tvc-price-table-features .row-subheading{
2786
+ border-width: 1px 0 1px 1px;
2787
+ border-style: solid;
2788
+ border-color: #ebebeb;
2789
+ border-bottom: 0;}
2790
+ .tvc-price-table-features .row-subheading {
2791
+ font-weight: 700;
2792
+ font-size: 16px;
2793
+ padding: 10px 15px;
2794
+ background: #ebebeb;
2795
+ text-align: center;
2796
+ }
2797
+ .tvc-price-table-features .row-footer {
2798
+ display: flex;
2799
+ }
2800
+ .tvc-price-table-features .row-footer {
2801
+ border-width: 1px 0 1px 1px;
2802
+ border-style: solid;
2803
+ border-color: #ebebeb;
2804
+ }
2805
+ .tvc-price-table-features .row-footer .column {
2806
+ padding: 20px 20px 18px 20px;
2807
+ }
2808
+ .tvc-guarantee .guarantee {
2809
+ border: 1px solid #ebebeb;
2810
+ background-color: #0137FC;
2811
+ color: #fff;
2812
+ padding: 30px;
2813
+ margin: 40px 0 0 0;
2814
+
2815
+ }
2816
+ .tvc-guarantee .guarantee .title{ font-size: 18px;
2817
+ font-weight: 600;}
2818
+ .tvc-guarantee .guarantee .title span{font-size: 23px;
2819
+ font-style: italic;
2820
+ margin-right: 20px;
2821
+ font-weight: bold;
2822
+ }
2823
+ .tvc-price-table-features .tvc-list-price{
2824
+ border-bottom: 1px solid #ebebeb;
2825
+ padding: 0px 0 10px 0;
2826
+ }
2827
+
2828
+ .tvc-price-table-features .tvc-list-price .price-current{
2829
+ font-size: 30px;
2830
+ font-weight: 700;
2831
+ color: #0137FC;
2832
+ }
2833
+ .tvc-price-table-features .tvc-list-price .price-current .inner span{
2834
+ font-size: 12px;
2835
+ }
2836
+ .tvc-btn{background-color: #0137FC !important;
2837
+ border-style: solid;
2838
+ border-radius: 26px 26px 26px 26px !important;
2839
+ color: #fff !important;
2840
+ display: inline-block;
2841
+ line-height: 1;
2842
+ font-size: 15px;
2843
+ padding: 12px 24px;
2844
+ fill: #fff;
2845
+ text-align: center;
2846
+ -webkit-transition: all .3s;
2847
+ -o-transition: all .3s;
2848
+ transition: all .3s;
2849
+ text-decoration:none;
2850
+ margin: 10px 0;
2851
+ }
2852
+ .tvc-blank-col span{position: absolute;
2853
+ bottom: 5px;
2854
+ font-size: 18px;
2855
+ text-align: center;
2856
+ left: 0;
2857
+ right: 0;
2858
+ font-weight: 600;}
2859
+ .tvc-free-plan span{
2860
+ position: absolute;
2861
+ bottom: 0px;
2862
+ font-size: 18px;
2863
+ text-align: center;
2864
+ left: 0;
2865
+ right: 0;
2866
+ font-weight: 600;
2867
+ }
2868
+ .tvc-free-plan .tvc-list-price .price-current span{
2869
+ position: relative;
2870
+ font-size: 30px;
2871
+ font-weight: 700;
2872
+ color: #0137FC;
2873
+ margin-top: 43px;
2874
+ display: block;
2875
+ }
2876
+
2877
+ .tvc_popular{background-color: #EE345E;
2878
+ color: white;
2879
+ font-style: normal;
2880
+ font-weight: bold;
2881
+ font-size: 12px;
2882
+ text-align: center;
2883
+ text-transform: uppercase;
2884
+ position: absolute;
2885
+ right: -41px;
2886
+ top: 2px;
2887
+ transform: rotate( 45deg );
2888
+ width: 138px;
2889
+ letter-spacing: 2px;
2890
+ clip-path: polygon(22% 0, 77% 0, 101% 100%, 0 95%);
2891
+ padding-top: 9px;
2892
+ padding-bottom: 9px;
2893
+ }
2894
+ .tvc-price-table-features .column.popular {
2895
+ background-color: #f1f9ff;
2896
+ }
2897
+ .tvc-price-table-features .column img{height: 18px;}
2898
+ .elementor-column-wrap.active{ background-color: #0137FC;}
2899
+ .elementor-column-wrap.active h5.elementor-heading-title{
2900
+ color: #fff !important;
2901
+ }
2902
+ .selected-plan-info .tvc_price_cancel{margin: 0 8px 10px 0;}
2903
+ .paypal_plan_type{float: right;
2904
+ margin-right: 20px;}
2905
+ .selected-plan-info .tvc_month_free{
2906
+ display: inline-block;
2907
+ width: 110px;
2908
+ margin-left: 5px;
2909
+ }
2910
+ a.elementor-button-link{
2911
+ text-decoration: none;
2912
+ }
2913
+ .tvc-plan-off{
2914
+ display: inline-block;
2915
+ margin-left: 5px;
2916
+ color: #2FBB0E;
2917
+ font-weight: 600;
2918
+ }
2919
+ .tvc_month_free{
2920
+ text-align: center;
2921
+ background-color: #2FBB0E;
2922
+ color: #fff;
2923
+ width: 119px;
2924
+ font-size: 14px;
2925
+ line-height: 21px;
2926
+ font-weight: 600;
2927
+ margin: 0 auto;
2928
+ }
2929
+ .tvc-plan-price span{font-size: 12px;}
2930
+ .tvc-price-table-features .tvc_popular{
2931
+ width: 100%;
2932
+ top: -35px;
2933
+ right: 0;
2934
+ left: 0;
2935
+ transform: none;
2936
+ clip-path:none;
2937
+ }
2938
+ .paypal-message-box ol{padding-left: 25px;}
2939
+ .paypal-message-box a {text-decoration: underline;}
2940
+ .tvc-list-price-month a, .tvc-list-price-year a {
2941
+ font-weight: bold;
2942
+ }
2943
+
2944
+ /*End price Table*/
2945
+ .tvc-new-freevspro{
2946
+ /* background-color: #EE345E;
2947
+ color: white;
2948
+ font-style: normal;
2949
+ font-weight: bold;
2950
+ font-size: 12px;
2951
+ height: 40px;
2952
+ text-align: center;
2953
+ text-transform: uppercase;
2954
+ position: absolute;
2955
+
2956
+ top: -7px;
2957
+ left: -25px;
2958
+ padding-top: 33px;
2959
+
2960
+ transform: rotate( 314deg );
2961
+ width: 63px;
2962
+ letter-spacing: 2px;
2963
+ /*clip-path: polygon(50% 0%, 53% 0, 109% 109%, -4% 99%);
2964
+ clip-path: polygon(50% 0%, 53% 0, 112% 97%, -11% 99%);
2965
+ padding-top: 19.5px;*/
2966
+ background-color: #EE345E;
2967
+ color: white;
2968
+ font-style: normal;
2969
+ font-weight: bold;
2970
+ font-size: 12px;
2971
+ height: 38px;
2972
+ text-align: center;
2973
+ text-transform: uppercase;
2974
+ position: absolute;
2975
+
2976
+ top: -8px;
2977
+ left: 11px;
2978
+ left: 119px;
2979
+ padding-top: 33px;
2980
+
2981
+ transform: rotate(
2982
+ 43deg
2983
+ );
2984
+ width: 70px;
2985
+ letter-spacing: 2px;
2986
+ clip-path: polygon(50% 0%, 53% 0, 109% 109%, -4% 99%);
2987
+ /* clip-path: polygon(50% 0%, 53% 0, 112% 97%, -11% 99%); */
2988
+ padding-top: 19.5px;
2989
+
2990
+ }
2991
+ .tvc_plugin_container .nav-link{position: relative;}
2992
+ .tvc-new-freevspro-nav-item{
2993
+ width: 169px;
2994
+ }
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -569,6 +569,8 @@ button.tvc_animate_btn:hover::after, button.tvc_animate_btn:focus::after {
569
  }
570
  #tvc-account-page .tvc-table{margin-top:30px; }
571
  #productSync .shop-category{text-align: right;}
 
 
572
 
573
  .tvc_plugin_container .notice, div.error, div.updated {margin: 0;}
574
  .select2-container--default .select2-selection--single .select2-selection__arrow b{top: 35%; border: solid #2f3d4a !important; border-width: 0 2px 2px 0 !important;}
@@ -576,17 +578,17 @@ button.tvc_animate_btn:hover::after, button.tvc_animate_btn:focus::after {
576
  .tvc-notification-dropdown-menu{
577
  width: 420px;
578
  right: 0;
579
- left: auto;
580
- background: #F1F1F1;
581
-
582
  }
 
583
  .tvc-notification .tvc-msg.plain{ position: relative;
584
  color: #757575;
585
- background: #fff;
586
  border-radius: 2px;
587
  font-size: 13px;
588
  font-size: .8125rem;
589
- margin: 7px; padding: 0px 10px;}
 
590
  /*.tvc-notification li:last-child .tvc-msg.plain,*/
591
  .tvc-notification li:last-child{margin-bottom: 0;}
592
  .tvc-notification .tvc-msg_title{color: #1e1e1e;
@@ -604,7 +606,7 @@ button.tvc_animate_btn:hover::after, button.tvc_animate_btn:focus::after {
604
  .tvc-notification .tvc-notification-button.is-secondary{
605
  box-shadow: inset 0 0 0 1px #007cba;
606
  outline: 1px solid transparent;}
607
- .tvc-notification .dropdown-menu{padding: 0; margin-top: 10px; border: 0.5px solid #A9A9A9;}
608
  .tvc-notification .dropdown-menu:before {
609
  content: "";
610
  position: absolute;
@@ -664,4 +666,37 @@ img{
664
  image-rendering: -webkit-optimize-contrast;
665
  image-rendering: crisp-edges;
666
  -ms-interpolation-mode: nearest-neighbor;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
667
  }
569
  }
570
  #tvc-account-page .tvc-table{margin-top:30px; }
571
  #productSync .shop-category{text-align: right;}
572
+ /*#productSync .card-wrapper .row .col-6 h6{display: inline-block;}*/
573
+ #productSync .card-wrapper .row .col-6 .gmc-image-heading{padding: 5px 0;}
574
 
575
  .tvc_plugin_container .notice, div.error, div.updated {margin: 0;}
576
  .select2-container--default .select2-selection--single .select2-selection__arrow b{top: 35%; border: solid #2f3d4a !important; border-width: 0 2px 2px 0 !important;}
578
  .tvc-notification-dropdown-menu{
579
  width: 420px;
580
  right: 0;
581
+ left: auto;
 
 
582
  }
583
+ .tvc-msg_wrapper .tvc-msg_date{float: right; padding: 6px;}
584
  .tvc-notification .tvc-msg.plain{ position: relative;
585
  color: #757575;
586
+ background: #F1F1F1;
587
  border-radius: 2px;
588
  font-size: 13px;
589
  font-size: .8125rem;
590
+ margin: 7px; padding: 0px 10px;
591
+ border-radius: 10px;}
592
  /*.tvc-notification li:last-child .tvc-msg.plain,*/
593
  .tvc-notification li:last-child{margin-bottom: 0;}
594
  .tvc-notification .tvc-msg_title{color: #1e1e1e;
606
  .tvc-notification .tvc-notification-button.is-secondary{
607
  box-shadow: inset 0 0 0 1px #007cba;
608
  outline: 1px solid transparent;}
609
+ .tvc-notification .dropdown-menu{padding: 0; margin-top: 10px; border: 0.5px solid #A9A9A9; border-radius: 15px;}
610
  .tvc-notification .dropdown-menu:before {
611
  content: "";
612
  position: absolute;
666
  image-rendering: -webkit-optimize-contrast;
667
  image-rendering: crisp-edges;
668
  -ms-interpolation-mode: nearest-neighbor;
669
+ }
670
+ .progress{background-color: #ffff; border-radius: 8px;}
671
+ /*.tvc-sync-progress-db{display: none; margin-top: 5px;}*/
672
+ .tvc-sync-progress-gmc{display: none; margin-top: 5px;}
673
+ /*.tvc-progress-info{display: none;}*/
674
+ .progress-bar-wapper{display:none;}
675
+ .tvc-sync-count{display: inline-block; text-align: left; float: left;}
676
+ .tvc-total-count{display: inline-block; text-align: right; float: right;}
677
+ .tvc-sync-message{
678
+ display: block;
679
+ font-weight: 700;
680
+ text-align: left;
681
+ margin: 0 0 10px 0;
682
+ }
683
+ .tvc-progress-info{padding: 0 5px;}
684
+ .progress-bar-wapper.open{
685
+ height: 100px;
686
+ width: 500px;
687
+ overflow: hidden;
688
+ background: #EEEEEE;
689
+ box-shadow: 0 0 10px black;
690
+ border-radius: 10px;
691
+ position: fixed;
692
+ top: 30%;
693
+ left: 50%;
694
+ margin-top: 100px;
695
+ transform: translate(-50%, -50%);
696
+ z-index: 9999;
697
+ padding: 20px;
698
+ text-align: center;
699
+ display: block;
700
+ animation: tvc_popup_box_open 0.5s;
701
+ -webkit-animation: tvc_popup_box_open 0.5s;
702
  }
admin/images/adwords.png DELETED
Binary file
admin/images/check.png ADDED
Binary file
admin/images/close.png ADDED
Binary file
admin/images/cotlw.png DELETED
Binary file
admin/images/discount.gif DELETED
Binary file
admin/images/exclaimation.png CHANGED
Binary file
admin/images/facebook.jpg DELETED
Binary file
admin/images/google_optimize.png DELETED
Binary file
admin/images/icon/google-shopping.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg height="30" viewBox=".381 -4.99021715 516.22889793 516.22821715" width="30" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><path d="m411.503 136.66c20.182 0 36.545-16.362 36.545-36.544s-16.363-36.544-36.545-36.544-36.544 16.362-36.544 36.544 16.362 36.544 36.544 36.544zm-258.888-11.155 112.108-112.108c8.552-8.552 20.428-13.777 33.493-13.777h166.276a47.343 47.343 0 0 1 47.508 47.507v166.276c0 13.065-5.226 24.942-14.015 33.493l-111.937 112.044z" fill="#4285f4"/><path d="m386.048 358.94-138.153 138.283c-8.79 8.551-20.666 14.015-33.73 14.015s-24.942-5.464-33.493-14.015l-166.277-166.275c-8.789-8.552-14.014-20.428-14.014-33.493 0-13.302 5.463-25.179 14.014-33.73l138.22-138.22z" fill="#34a853"/><path d="m95.085 411.637-80.69-80.69c-8.789-8.549-14.014-20.427-14.014-33.491 0-13.302 5.463-25.179 14.014-33.73l138.22-138.22 114.3 114.302z" fill="#fbbc05"/><path d="m495.595 11.127a47.344 47.344 0 0 0 -31.103-11.507h-166.276c-13.065 0-24.941 5.225-33.493 13.777l-112.108 112.108 114.3 114.302 116.415-116.415a36.394 36.394 0 0 1 -8.37-23.276c0-20.182 16.361-36.544 36.543-36.544a36.394 36.394 0 0 1 23.277 8.37z" fill="#ea4335"/><circle cx="266.849" cy="252.764" fill="#4285f4" r="74.23"/><path d="m367.983 230.928h-98.726v42.358h56.828c-5.298 26.91-27.45 42.358-56.828 42.358-34.675 0-62.607-28.903-62.607-64.783s27.932-64.783 62.607-64.783c14.93 0 28.414 5.482 39.009 14.452l30.822-31.894c-18.782-16.943-42.862-27.408-69.831-27.408-58.754 0-105.95 48.837-105.95 109.633s47.196 109.633 105.95 109.633c52.975 0 101.134-39.867 101.134-109.633 0-6.478-.963-13.455-2.408-19.933z" fill="#fff"/></g></svg>
admin/images/icon/woocommerce.svg ADDED
@@ -0,0 +1 @@
 
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="40px" height="40px"><path fill="#a64a7b" d="M43,11H5c-2.209,0-4,1.791-4,4v16c0,2.209,1.791,4,4,4h19l8,4l-2-4h13c2.209,0,4-1.791,4-4V15 C47,12.791,45.209,11,43,11z"/><path fill="#fff" d="M40.443 19c.041 0 .132.005.277.038.342.077.559.198.82.686C41.85 20.283 42 21.007 42 21.939c0 1.398-.317 2.639-.973 3.802C40.321 27 39.805 27 39.557 27c-.041 0-.132-.005-.277-.038-.342-.077-.559-.198-.809-.666C38.158 25.722 38 24.963 38 24.043c0-1.399.314-2.63.963-3.765C39.691 19 40.218 19 40.443 19M40.443 16c-1.67 0-3.026.931-4.087 2.793C35.452 20.375 35 22.125 35 24.043c0 1.434.278 2.662.835 3.686.626 1.173 1.548 1.88 2.783 2.16C38.948 29.963 39.261 30 39.557 30c1.687 0 3.043-.931 4.087-2.793C44.548 25.606 45 23.856 45 21.939c0-1.452-.278-2.662-.835-3.668-.626-1.173-1.548-1.88-2.783-2.16C41.052 16.037 40.739 16 40.443 16L40.443 16zM28.443 19c.041 0 .132.005.268.036.333.076.571.207.829.689C29.85 20.283 30 21.007 30 21.939c0 1.398-.317 2.639-.973 3.802C28.321 27 27.805 27 27.557 27c-.041 0-.132-.005-.277-.038-.342-.077-.559-.198-.809-.666C26.158 25.722 26 24.963 26 24.043c0-1.399.314-2.63.963-3.765C27.691 19 28.218 19 28.443 19M28.443 16c-1.67 0-3.026.931-4.087 2.793C23.452 20.375 23 22.125 23 24.043c0 1.434.278 2.662.835 3.686.626 1.173 1.548 1.88 2.783 2.16C26.948 29.963 27.261 30 27.557 30c1.687 0 3.043-.931 4.087-2.793C32.548 25.606 33 23.856 33 21.939c0-1.452-.278-2.662-.835-3.668-.626-1.173-1.565-1.88-2.783-2.16C29.052 16.037 28.739 16 28.443 16L28.443 16zM18.5 32c-.421 0-.832-.178-1.123-.505-2.196-2.479-3.545-5.735-4.34-8.343-1.144 2.42-2.688 5.515-4.251 8.119-.309.515-.894.792-1.491.715-.596-.083-1.085-.513-1.242-1.093-2.212-8.127-3.007-13.95-3.039-14.194-.11-.82.466-1.575 1.286-1.686.831-.108 1.576.465 1.687 1.286.007.049.571 4.177 2.033 10.199 2.218-4.208 4.078-8.535 4.102-8.59.267-.62.919-.989 1.58-.895.668.09 1.194.615 1.285 1.283.007.052.542 3.825 2.245 7.451.719-7.166 2.873-10.839 2.982-11.021.427-.711 1.35-.941 2.058-.515.711.426.941 1.348.515 2.058C22.762 16.313 20 21.115 20 30.5c0 .623-.386 1.182-.968 1.402C18.858 31.968 18.679 32 18.5 32z"/></svg>
admin/images/logo.png ADDED
Binary file
admin/images/m1.png DELETED
Binary file
admin/images/m2.png DELETED
Binary file
admin/images/rating.png DELETED
Binary file
admin/images/ratings.png DELETED
Binary file
admin/images/shopify_new.png DELETED
Binary file
admin/images/tatvic_logo.png CHANGED
Binary file
admin/images/woo.png DELETED
Binary file
admin/partials/about-plugin.php DELETED
@@ -1,184 +0,0 @@
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_TVC_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;
14
- }
15
- th{
16
- text-align: center !important;
17
- }
18
- .fa-times{
19
- color:red;
20
- }
21
- .fa-check{
22
- color:green;
23
- }
24
- </style>
25
- <div class="container-fluid">
26
- <div class="row">
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>
33
- <div class="card-body">
34
- <div class="row">
35
- <div class="col-md-10 my-4 mx-auto">
36
- <div class="row">
37
- <div class="col-lg-12">
38
- <div class="table-responsve">
39
- <table class="table table-striped table-hover">
40
- <thead class="thead-inverse">
41
- <tr>
42
- <th class="w-25" style="font-weight: 900;">Features</th>
43
- <th class="" style="font-weight: 900;">Free</th>
44
- <th class="" style="font-weight: 900;">Premium</th>
45
- </tr>
46
- </thead>
47
- <tbody>
48
- <tr>
49
- <td class="w-25 option">Basic UA Tracking (Pageviews)</td>
50
- <td><i class="fa fa-check"></i></td>
51
- <td><i class="fa fa-check"></i></td>
52
- </tr>
53
- <tr>
54
- <td class="option">Enhanced Ecommerce</td>
55
- <td><strong>Only 4 Reports</strong></td>
56
- <td><strong>All reports</strong></td>
57
- </tr>
58
- <tr>
59
- <td class="option">I.P. Anonymization</td>
60
- <td><i class="fa fa-check"></i></td>
61
- <td><i class="fa fa-check"></i></td>
62
- </tr>
63
- <tr>
64
- <td class="option">Google Opt-Out</td>
65
- <td><i class="fa fa-check"></i></td>
66
- <td><i class="fa fa-check"></i></td>
67
- </tr>
68
- <tr>
69
- <td class="option">Product List Performance</td>
70
- <td><i class="fa fa-times"></i></td>
71
- <td><i class="fa fa-check"></i></td>
72
- </tr>
73
- <tr>
74
- <td class="option">Display Feature</td>
75
- <td><i class="fa fa-times"></i></td>
76
- <td><i class="fa fa-check"></i></td>
77
- </tr>
78
- <tr>
79
- <td class="option">Product Variations (eg. color,size)</td>
80
- <td><i class="fa fa-times"></i></td>
81
- <td><i class="fa fa-check"></i></td>
82
- </tr>
83
- <tr>
84
- <td class="option">Automated Product Refund (from Admin Panel)</td>
85
- <td><i class="fa fa-times"></i></td>
86
- <td><i class="fa fa-check"></i></td>
87
- </tr>
88
- <tr>
89
- <td class="option">Google Adwords Conversion Tracking</td>
90
- <td><i class="fa fa-times"></i></td>
91
- <td><i class="fa fa-check"></i></td>
92
- </tr>
93
- <tr>
94
- <td class="option">Facebook Pixel Implementation (Standard Ecommerce Events)</td>
95
- <td><i class="fa fa-times"></i></td>
96
- <td><i class="fa fa-check"></i></td>
97
- </tr>
98
- <tr>
99
- <td class="option">Add Google Optimize Snippet</td>
100
- <td><i class="fa fa-times"></i></td>
101
- <td><i class="fa fa-check"></i></td>
102
- </tr>
103
- <tr>
104
- <td class="option">Site Speed Sample Rate</td>
105
- <td><i class="fa fa-times"></i></td>
106
- <td><i class="fa fa-check"></i></td>
107
- </tr>
108
- <tr>
109
- <td class="option">User ID Tracking</td>
110
- <td><i class="fa fa-times"></i></td>
111
- <td><i class="fa fa-check"></i></td>
112
- </tr>
113
- <tr>
114
- <td class="option">Form Field Tracking</td>
115
- <td><i class="fa fa-times"></i></td>
116
- <td><i class="fa fa-check"></i></td>
117
- </tr>
118
- <tr>
119
- <td class="option">Content Grouping</td>
120
- <td><i class="fa fa-times"></i></td>
121
- <td><i class="fa fa-check"></i></td>
122
- </tr>
123
-
124
- <tr>
125
- <td class="option">Internal Promotion</td>
126
- <td><i class="fa fa-times"></i></td>
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>
139
- <tr>
140
- <td class="option">Child / Custom Theme Support</td>
141
- <td><i class="fa fa-times"></i></td>
142
- <td><i class="fa fa-check"></i></td>
143
- </tr>
144
- <tr>
145
- <td class="option">Quick Expert Support ( Query Support)</td>
146
- <td><i class="fa fa-times"></i></td>
147
- <td><i class="fa fa-check"></i></td>
148
- </tr>
149
- <tr>
150
- <td class="option">Paid Customization (As per the requirement)</td>
151
- <td><i class="fa fa-times"></i></td>
152
- <td><i class="fa fa-check"></i></td>
153
- </tr>
154
- <tr>
155
- <td class="option">Data Studio Dashboards (Paid)</td>
156
- <td><i class="fa fa-times"></i></td>
157
- <td><i class="fa fa-check"></i></td>
158
- </tr>
159
- </tbody>
160
- <tfoot class="thead-inverse">
161
- <tr>
162
- <th class="w-25"></th>
163
- <th class="w-25"></th>
164
- <th class=""><a href="#" 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>
172
- <p class="description" style="font-size: 15px;"><strong>Feel free to contact us regarding premium version inquiry at <span style="color:blue;font-size:15px;">analytics2@tatvic.com<span></strong>.<br/>Agencies & Marketers can also contact us for the bulk licenses for their clients.</p>
173
- </div>
174
- </div>
175
- </div>
176
- </div>
177
- </div>
178
- <hr>
179
- </div>
180
- </div>
181
- </div>
182
- <?php require_once('sidebar.php');?>
183
- </div>
184
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
admin/partials/enhanced-ecommerce-google-analytics-admin-display.php CHANGED
@@ -17,10 +17,11 @@ if (!defined('ABSPATH')) {
17
  class TVC_Tabs {
18
  protected $TVC_Admin_Helper;
19
  protected $site_url;
 
20
  public function __construct() {
21
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
22
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
23
-
24
  $this->create_tabs();
25
  }
26
  protected function info_htnml($validation){
@@ -40,6 +41,16 @@ class TVC_Tabs {
40
 
41
  protected function create_tabs(){
42
  $setting_status = $this->TVC_Admin_Helper->check_setting_status();
 
 
 
 
 
 
 
 
 
 
43
  ?>
44
  <ul class="nav nav-pills nav-justified">
45
  <li class="nav-item">
@@ -85,6 +96,14 @@ class TVC_Tabs {
85
  <a href="<?php echo $this->site_url.'google_shopping_feed'; ?>" class="">Google Shopping</a>
86
  </div>
87
  </li>
 
 
 
 
 
 
 
 
88
  <li class="tvc-help-need">
89
  For any query, reach out to us at <a href="tel:+1 (415) 968-6313">+1 (415) 968-6313</a>
90
  </li>
17
  class TVC_Tabs {
18
  protected $TVC_Admin_Helper;
19
  protected $site_url;
20
+ protected $google_detail;
21
  public function __construct() {
22
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
23
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
24
+ $this->google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
25
  $this->create_tabs();
26
  }
27
  protected function info_htnml($validation){
41
 
42
  protected function create_tabs(){
43
  $setting_status = $this->TVC_Admin_Helper->check_setting_status();
44
+ $googleDetail = [];
45
+ $plan_id = 1;
46
+ if(isset($this->google_detail['setting'])){
47
+ if ($this->google_detail['setting']) {
48
+ $googleDetail = $this->google_detail['setting'];
49
+ if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
50
+ $plan_id = $googleDetail->plan_id;
51
+ }
52
+ }
53
+ }
54
  ?>
55
  <ul class="nav nav-pills nav-justified">
56
  <li class="nav-item">
96
  <a href="<?php echo $this->site_url.'google_shopping_feed'; ?>" class="">Google Shopping</a>
97
  </div>
98
  </li>
99
+ <?php if($plan_id ==1){?>
100
+ <li class="nav-item tvc-new-freevspro-nav-item">
101
+ <div class="nav-link <?php echo $this->is_active_tabs('pricings'); ?>">
102
+ <span class="tvc-new-freevspro">New</span>
103
+ <a href="<?php echo $this->site_url.'pricings'; ?>" class="">Free Vs Pro</a>
104
+ </div>
105
+ </li>
106
+ <?php } ?>
107
  <li class="tvc-help-need">
108
  For any query, reach out to us at <a href="tel:+1 (415) 968-6313">+1 (415) 968-6313</a>
109
  </li>
admin/partials/general-fields.php CHANGED
@@ -194,8 +194,7 @@ if(isset($google_detail['setting'])){
194
  <div class="licence tvc-licence" >
195
  <div class="tvc_licence_key_wapper <?php if($plan_id != 1){?>tvc-hide<?php }?>">
196
  <p>You are using our free plugin, no licence needed ! Happy analyzing..!! :)</p>
197
- <p class="font-weight-bold">To unlock more features of google products, consider our <a href="<?php echo $TVC_Admin_Helper->get_pro_plan_site(); ?>" target="_blank">pro version.</a></p>
198
- <?php /*
199
  <form method="post" name="google-analytic" id="tvc-licence-active">
200
  <div class="input-group">
201
  <input type="text" id="licence_key" name="licence_key" class="form-control" placeholder="Already purchased? Enter licence key" required="">
@@ -204,7 +203,7 @@ if(isset($google_detail['setting'])){
204
  </div>
205
  </div>
206
  </form>
207
- */ ?>
208
  </div>
209
  </div>
210
  <?php }?>
194
  <div class="licence tvc-licence" >
195
  <div class="tvc_licence_key_wapper <?php if($plan_id != 1){?>tvc-hide<?php }?>">
196
  <p>You are using our free plugin, no licence needed ! Happy analyzing..!! :)</p>
197
+ <p class="font-weight-bold">To unlock more features of google products, consider our <a href="<?php echo $TVC_Admin_Helper->get_pro_plan_site().'?utm_source=EE+Plugin+User+Interface&utm_medium=Google+Analytics+Screen+pro+version&utm_campaign=Upsell+at+Conversios'; ?>" target="_blank">pro version.</a></p>
 
198
  <form method="post" name="google-analytic" id="tvc-licence-active">
199
  <div class="input-group">
200
  <input type="text" id="licence_key" name="licence_key" class="form-control" placeholder="Already purchased? Enter licence key" required="">
203
  </div>
204
  </div>
205
  </form>
206
+
207
  </div>
208
  </div>
209
  <?php }?>
admin/partials/pricings.php ADDED
@@ -0,0 +1,364 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TVC_Pricings {
3
+ protected $TVC_Admin_Helper="";
4
+ protected $url = "";
5
+ protected $subscriptionId = "";
6
+ protected $google_detail;
7
+ protected $customApiObj;
8
+ protected $pro_plan_site;
9
+
10
+ public function __construct() {
11
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
12
+ $this->customApiObj = new CustomApi();
13
+ $this->url = $this->TVC_Admin_Helper->get_connect_url();
14
+ $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
15
+ $this->google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
16
+ $this->TVC_Admin_Helper->add_spinner_html();
17
+ $this->pro_plan_site = $this->TVC_Admin_Helper->get_pro_plan_site();
18
+ $this->create_form();
19
+ }
20
+
21
+ public function create_form() {
22
+ $message = ""; $class="";
23
+ $googleDetail = [];
24
+ $plan_id = 1;
25
+ if(isset($this->google_detail['setting'])){
26
+ if ($this->google_detail['setting']) {
27
+ $googleDetail = $this->google_detail['setting'];
28
+ if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
29
+ $plan_id = $googleDetail->plan_id;
30
+ }
31
+ }
32
+ }
33
+
34
+ $close_icon =ENHANCAD_PLUGIN_URL.'/admin/images/close.png';
35
+ $check_icon =ENHANCAD_PLUGIN_URL.'/admin/images/check.png';
36
+ ?>
37
+ <div class="tab-content">
38
+ <?php if($message){
39
+ printf('<div class="%1$s"><div class="alert">%2$s</div></div>', esc_attr($class), esc_html($message));
40
+ }?>
41
+ <div class="tab-pane show active" id="tvc-account-page">
42
+ <div class="tab-card" >
43
+ <div class="tvc-price-table-features columns-5">
44
+ <div class="tvc-container">
45
+ <div class="clearfix">
46
+ <div class="row-heading clearfix">
47
+ <div class="column tvc-blank-col"><span>Features</span></div>
48
+ <div class="column discounted tvc-free-plan">
49
+ <div class="name-wrap"><div class="name">STARTER</div></div>
50
+ <div class="tvc-list-price">
51
+ <div class="price-current"><span class="inner">FREE</span></div>
52
+ <div class="tvc_month_free">FOREVER FREE</div>
53
+ </div>
54
+ <span>
55
+ <a href="javascript:void(0)" class="btn tvc-btn">Currently Active</a>
56
+ </span>
57
+ </div>
58
+ <div class="column discounted ">
59
+ <div class="name-wrap"><div class="name">HUSTLE</div></div>
60
+ <div class="tvc-list-price-month">
61
+ <div class="tvc-list-price">
62
+ <div class="price-normal">
63
+ <span>$19.00</span>
64
+ <div class="tvc-plan-off">50% OFF</div>
65
+ </div>
66
+ <div class="price-current"><span class="inner">$9<span>/month</span></span></div>
67
+ <div class="tvc_month_free">Limited Offer</div>
68
+ </div>
69
+ <a target="_blank" href="https://conversios.io/checkout/?pid=plan_1_m&utm_source=EE+Plugin+User+Interface&utm_medium=HUSTLE&utm_campaign=Upsell+at+Conversios" class="btn tvc-btn">Try 1 Month Free</a>
70
+ </div>
71
+ </div>
72
+ <div class="column discounted popular">
73
+ <div class="tvc_popular">
74
+ <div class="tvc_popular_inner">POPULAR</div>
75
+ </div>
76
+ <div class="name-wrap">
77
+ <div class="name">GROWTH</div>
78
+ </div>
79
+ <div class="tvc-list-price-month">
80
+ <div class="tvc-list-price">
81
+ <div class="price-normal"><span>$39.00</span>
82
+ <div class="tvc-plan-off">50% OFF</div>
83
+ </div>
84
+ <div class="price-current"><span class="inner">$19<span>/month</span></span></div>
85
+ <div class="tvc_month_free">Limited Offer</div>
86
+ </div>
87
+ <a target="_blank" href="https://conversios.io/checkout/?pid=plan_2_m&utm_source=EE+Plugin+User+Interface&utm_medium=GROWTH&utm_campaign=Upsell+at+Conversios" class="btn tvc-btn">Try 1 Month Free</a>
88
+ </div>
89
+ </div>
90
+ <div class="column discounted ">
91
+ <div class="name-wrap">
92
+ <div class="name">LEAP</div>
93
+ </div>
94
+ <div class="tvc-list-price-month">
95
+ <div class="tvc-list-price">
96
+ <div class="price-normal"><span>$59.00</span>
97
+ <div class="tvc-plan-off">50% OFF</div>
98
+ </div>
99
+ <div class="price-current"><span class="inner">$29<span>/month</span></span></div>
100
+ <div class="tvc_month_free">Limited Offer</div>
101
+ </div>
102
+ <a target="_blank" href="https://conversios.io/checkout/?pid=plan_3_m&utm_source=EE+Plugin+User+Interface&utm_medium=LEAP&utm_campaign=Upsell+at+Conversios" class="btn tvc-btn">Try 1 Month Free</a>
103
+ </div>
104
+ </div>
105
+ </div>
106
+ <div class="row-subheading clearfix">Google Analytics</div>
107
+ <div class="row-feature clearfix">
108
+ <div class="column">Universal Analytics Tracking</div>
109
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
110
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
111
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
112
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
113
+ </div>
114
+ <div class="row-feature clearfix">
115
+ <div class="column">Google Analytics 4 Tracking</div>
116
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
117
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
118
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
119
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
120
+ </div>
121
+ <div class="row-feature clearfix">
122
+ <div class="column">Dual Set up (UA + GA4)</div>
123
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
124
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
125
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
126
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
127
+ </div>
128
+ <div class="row-feature clearfix">
129
+ <div class="column">eCommerce tracking</div>
130
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Limited)</div>
131
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
132
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
133
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
134
+ </div><div class="row-feature clearfix">
135
+ <div class="column">Shopping Behavior Analysis</div>
136
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Limited)</div>
137
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
138
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
139
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
140
+ </div><div class="row-feature clearfix">
141
+ <div class="column">Checkout Behavior Tracking</div>
142
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Limited)</div>
143
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
144
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
145
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
146
+ </div><div class="row-feature clearfix">
147
+ <div class="column">Channel Performance Analysis</div>
148
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Limited)</div>
149
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
150
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
151
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
152
+ </div><div class="row-feature clearfix">
153
+ <div class="column">All Pages tracking</div>
154
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
155
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
156
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
157
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
158
+ </div><div class="row-feature clearfix">
159
+ <div class="column">Google Analytics and Google Ads linking</div>
160
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
161
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
162
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
163
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
164
+ </div><div class="row-feature clearfix">
165
+ <div class="column">Custom dimensions tracking</div>
166
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
167
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
168
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
169
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
170
+ </div><div class="row-feature clearfix">
171
+ <div class="column">Custom metrics tracking</div>
172
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
173
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
174
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
175
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
176
+ </div><div class="row-feature clearfix">
177
+ <div class="column">User id tracking</div>
178
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
179
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
180
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
181
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
182
+ </div><div class="row-feature clearfix">
183
+ <div class="column">client id tracking</div>
184
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
185
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
186
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
187
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
188
+ </div><div class="row-feature clearfix">
189
+ <div class="column">Scroll tracking</div>
190
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
191
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
192
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
193
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
194
+ </div>
195
+ <div class="row-feature clearfix">
196
+ <div class="column">Affiliate performance tracking</div>
197
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
198
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
199
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
200
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
201
+ </div>
202
+ <div class="row-feature clearfix">
203
+ <div class="column">Coupon Performance Tracking</div>
204
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
205
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
206
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
207
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
208
+ </div>
209
+ <div class="row-feature clearfix">
210
+ <div class="column">Actionable Dashboard</div>
211
+ <div class="column">(Upcoming)</div>
212
+ <div class="column">(Upcoming)</div>
213
+ <div class="column popular">(Upcoming)</div>
214
+ <div class="column">(Upcoming)</div>
215
+ </div>
216
+ <div class="row-feature clearfix">
217
+ <div class="column">Menu tracking</div>
218
+ <div class="column">(Upcoming)</div>
219
+ <div class="column">(Upcoming)</div>
220
+ <div class="column popular">(Upcoming)</div>
221
+ <div class="column">(Upcoming)</div>
222
+ </div>
223
+ <div class="row-feature clearfix">
224
+ <div class="column">Search Query Tracking</div>
225
+ <div class="column">(Upcoming)</div>
226
+ <div class="column">(Upcoming)</div>
227
+ <div class="column popular">(Upcoming)</div>
228
+ <div class="column">(Upcoming)</div>
229
+ </div>
230
+ <div class="row-subheading clearfix">Google Shopping</div>
231
+ <div class="row-feature clearfix">
232
+ <div class="column">Google Merchant Center account management</div>
233
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
234
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
235
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
236
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
237
+ </div><div class="row-feature clearfix">
238
+ <div class="column">Site verification</div>
239
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
240
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
241
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
242
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
243
+ </div><div class="row-feature clearfix">
244
+ <div class="column">Domain claim</div>
245
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
246
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
247
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
248
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
249
+ </div><div class="row-feature clearfix">
250
+ <div class="column">Products Sync via Content API</div>
251
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 100)</div>
252
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 1000)</div>
253
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 5000)</div>
254
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Unlimited)</div>
255
+ </div><div class="row-feature clearfix">
256
+ <div class="column">Automatic Products Update</div>
257
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 100)</div>
258
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 1000)</div>
259
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(upto 5000)</div>
260
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Unlimited)</div>
261
+ </div><div class="row-feature clearfix">
262
+ <div class="column">Schedule Product Sync</div>
263
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
264
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
265
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
266
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
267
+ </div><div class="row-feature clearfix">
268
+ <div class="column">Smart Shopping Campaign management</div>
269
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
270
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
271
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
272
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
273
+ </div><div class="row-feature clearfix">
274
+ <div class="column">Smart Shopping reports</div>
275
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
276
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
277
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
278
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
279
+ </div><div class="row-feature clearfix">
280
+ <div class="column">Google Ads and Google Merchant Center account linking</div>
281
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
282
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
283
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
284
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
285
+ </div><div class="row-feature clearfix">
286
+ <div class="column">Remarketing tags</div>
287
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
288
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
289
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
290
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
291
+ </div><div class="row-feature clearfix">
292
+ <div class="column">Dynamic Remarketing Tags for eCommerce events</div>
293
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Limited)</div>
294
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
295
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
296
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"><br>(Complete)</div>
297
+ </div><div class="row-feature clearfix">
298
+ <div class="column">Google Ads Conversion tracking</div>
299
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
300
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
301
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
302
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
303
+ </div><div class="row-feature clearfix">
304
+ <div class="column">Product filters for selected products sync</div>
305
+ <div class="column">(Upcoming)</div>
306
+ <div class="column">(Upcoming)</div>
307
+ <div class="column popular">(Upcoming)</div>
308
+ <div class="column">(Upcoming)</div>
309
+ </div><div class="row-feature clearfix">
310
+ <div class="column">Product filter for Smart Shopping Campaign</div>
311
+ <div class="column">(Upcoming)</div>
312
+ <div class="column">(Upcoming)</div>
313
+ <div class="column popular">(Upcoming)</div>
314
+ <div class="column">(Upcoming)</div>
315
+ </div>
316
+ <div class="row-feature clearfix">
317
+ <div class="column">Rule Based Shopping Campaigns</div>
318
+ <div class="column">(Upcoming)</div>
319
+ <div class="column">(Upcoming)</div>
320
+ <div class="column popular">(Upcoming)</div>
321
+ <div class="column">(Upcoming)</div>
322
+ </div>
323
+ <div class="row-subheading clearfix">Support</div>
324
+ <div class="row-feature clearfix">
325
+ <div class="column">Free Google Analytics Audit</div>
326
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
327
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
328
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
329
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
330
+ </div><div class="row-feature clearfix">
331
+ <div class="column">Free Consultation with Shopping Expert</div>
332
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
333
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
334
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
335
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
336
+ </div><div class="row-feature clearfix">
337
+ <div class="column">Dedicated Customer Success Manager</div>
338
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
339
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
340
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
341
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
342
+ </div><div class="row-footer clearfix">
343
+ <div class="column">Premium Support (24*7)</div>
344
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
345
+ <div class="column"><img src="<?php echo $close_icon; ?>" alt="no"></div>
346
+ <div class="column popular "><img src="<?php echo $check_icon; ?>" alt="yes"></div>
347
+ <div class="column"><img src="<?php echo $check_icon; ?>" alt="yes"></div>
348
+ </div>
349
+ </div>
350
+ </div>
351
+ </div>
352
+ <div class="tvc-guarantee">
353
+ <div class="guarantee">
354
+ <div class="title"><span>15 Days</span>100% No-Risk Money Back Guarantee!</div>
355
+ <div class="description">You are fully protected by our 100% No-Risk-Double-Guarantee. If you don’t like over the next 15 days, then we will happily refund 100% of your money. No questions asked.</div>
356
+ </div>
357
+ </div>
358
+ </div>
359
+ </div>
360
+ </div>
361
+ <?php
362
+ }
363
+ }
364
+ ?>
enhanced-ecommerce-google-analytics.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
19
- * Version: 3.1.3
20
  * Author: Tatvic
21
  * Author URI: www.tatvic.com
22
  * License: GPL-2.0+
@@ -38,7 +38,7 @@ if ( ! defined( 'WPINC' ) ) {
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_TVC_VERSION', '3.1.3' );
42
  $fullName = plugin_basename( __FILE__ );
43
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
44
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
19
+ * Version: 4.0
20
  * Author: Tatvic
21
  * Author URI: www.tatvic.com
22
  * License: GPL-2.0+
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_TVC_VERSION', '4.0' );
42
  $fullName = plugin_basename( __FILE__ );
43
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
44
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
includes/class-enhanced-ecommerce-google-analytics-activator.php CHANGED
@@ -18,7 +18,7 @@
18
  * @since 1.0.0
19
  * @package Enhanced_Ecommerce_Google_Analytics_Activator
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics_Activator/includes
21
- * @author Chiranjiv Pathak <chiranijv@tatvic.com>
22
  */
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Activator {
18
  * @since 1.0.0
19
  * @package Enhanced_Ecommerce_Google_Analytics_Activator
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics_Activator/includes
21
+ * @author Tatvic
22
  */
23
 
24
  class Enhanced_Ecommerce_Google_Analytics_Activator {
includes/class-enhanced-ecommerce-google-analytics-deactivator.php CHANGED
@@ -18,7 +18,7 @@
18
  * @since 1.0.0
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
21
- * @author Chiranjiv Pathak <chiranijv@tatvic.com>
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Deactivator {
24
 
18
  * @since 1.0.0
19
  * @package Enhanced_Ecommerce_Google_Analytics
20
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
21
+ * @author Tatvic
22
  */
23
  class Enhanced_Ecommerce_Google_Analytics_Deactivator {
24
 
includes/class-enhanced-ecommerce-google-analytics-i18n.php CHANGED
@@ -22,7 +22,7 @@
22
  * @since 1.0.0
23
  * @package Enhanced_Ecommerce_Google_Analytics
24
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
25
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
26
  */
27
  class Enhanced_Ecommerce_Google_Analytics_i18n {
28
 
22
  * @since 1.0.0
23
  * @package Enhanced_Ecommerce_Google_Analytics
24
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
25
+ * @author Tatvic
26
  */
27
  class Enhanced_Ecommerce_Google_Analytics_i18n {
28
 
includes/class-enhanced-ecommerce-google-analytics-loader.php CHANGED
@@ -19,7 +19,7 @@
19
  *
20
  * @package Enhanced_Ecommerce_Google_Analytics
21
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
22
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
23
  */
24
  class Enhanced_Ecommerce_Google_Analytics_Loader {
25
 
19
  *
20
  * @package Enhanced_Ecommerce_Google_Analytics
21
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
22
+ * @author Tatvic
23
  */
24
  class Enhanced_Ecommerce_Google_Analytics_Loader {
25
 
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -25,7 +25,7 @@
25
  * @since 1.0.0
26
  * @package Enhanced_Ecommerce_Google_Analytics
27
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
28
- * @author Chiranjiv Pathak <chiranjiv@tatvic.com>
29
  */
30
  class Enhanced_Ecommerce_Google_Analytics {
31
 
@@ -138,7 +138,7 @@ class Enhanced_Ecommerce_Google_Analytics {
138
  if($plan_id == 1){
139
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
140
  }else{
141
- require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
142
  }
143
  $this->loader = new Enhanced_Ecommerce_Google_Analytics_Loader();
144
 
@@ -188,7 +188,7 @@ class Enhanced_Ecommerce_Google_Analytics {
188
  */
189
  private function define_public_hooks() {
190
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
191
- $this->loader->add_action("wp_head", $plugin_public, "enqueue_scripts");
192
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
193
  $this->loader->add_action("wp_head", $plugin_public, "add_google_site_verification_tag",1);
194
 
@@ -209,7 +209,7 @@ class Enhanced_Ecommerce_Google_Analytics {
209
 
210
  //Add Dev ID
211
  $this->loader->add_action("wp_head", $plugin_public, "add_dev_id");
212
- $this->loader->add_action("wp_footer",$plugin_public, "tvc_store_meta_data");
213
  }
214
 
215
  /**
@@ -267,11 +267,15 @@ class Enhanced_Ecommerce_Google_Analytics {
267
  }
268
 
269
  public function tvc_plugin_action_links($links) {
 
 
270
  $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=general_settings';
271
  $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
 
272
  $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#faq" target="_blank">FAQ</a>';
273
  $links[] = '<a href="http://plugins.tatvic.com/help-center/Installation-Manual.pdf" target="_blank">Documentation</a>';
274
- $links[] = '<a href="https://1.envato.market/Yvn3R" target="_blank"><b>Upgrade to Premium</b></a>';
 
275
  return $links;
276
  }
277
 
25
  * @since 1.0.0
26
  * @package Enhanced_Ecommerce_Google_Analytics
27
  * @subpackage Enhanced_Ecommerce_Google_Analytics/includes
28
+ * @author Tatvic
29
  */
30
  class Enhanced_Ecommerce_Google_Analytics {
31
 
138
  if($plan_id == 1){
139
  require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public.php';
140
  }else{
141
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-enhanced-ecommerce-google-analytics-public-pro.php';
142
  }
143
  $this->loader = new Enhanced_Ecommerce_Google_Analytics_Loader();
144
 
188
  */
189
  private function define_public_hooks() {
190
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
191
+ /* $this->loader->add_action("wp_head", $plugin_public, "enqueue_scripts");
192
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
193
  $this->loader->add_action("wp_head", $plugin_public, "add_google_site_verification_tag",1);
194
 
209
 
210
  //Add Dev ID
211
  $this->loader->add_action("wp_head", $plugin_public, "add_dev_id");
212
+ $this->loader->add_action("wp_footer",$plugin_public, "tvc_store_meta_data");*/
213
  }
214
 
215
  /**
267
  }
268
 
269
  public function tvc_plugin_action_links($links) {
270
+ $deactivate_link = $links['deactivate'];
271
+ unset($links['deactivate']);
272
  $setting_url = 'admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=general_settings';
273
  $links[] = '<a href="' . get_admin_url(null, $setting_url) . '">Settings</a>';
274
+
275
  $links[] = '<a href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/#faq" target="_blank">FAQ</a>';
276
  $links[] = '<a href="http://plugins.tatvic.com/help-center/Installation-Manual.pdf" target="_blank">Documentation</a>';
277
+ $links[] = '<a href="https://conversios.io/pricings/?utm_source=EE+Plugin+User+Interface&utm_medium=Plugins+Listing+Page+Upgrade+to+Premium&utm_campaign=Upsell+at+Conversios" target="_blank"><b>Upgrade to Premium</b></a>';
278
+ $links['deactivate'] = $deactivate_link;
279
  return $links;
280
  }
281
 
includes/data/class-tvc-ajax-file.php CHANGED
@@ -37,6 +37,178 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
37
  add_action('wp_ajax_tvc_call_notification_dismiss', array($this, 'tvc_call_notification_dismiss'));
38
  add_action('wp_ajax_tvc_call_active_licence', array($this, 'tvc_call_active_licence'));
39
  add_action('wp_ajax_tvc_call_add_survey', array($this, 'tvc_call_add_survey'));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
40
  }
41
 
42
  public function tvc_call_add_survey(){
@@ -188,13 +360,11 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
188
  $campaignId = filter_input(INPUT_POST, 'campaignId');
189
 
190
  $url = $this->apiDomain.'/campaigns/delete';
191
-
192
  $data = [
193
  'merchant_id' => $merchantId,
194
  'customer_id' => $customerId,
195
  'campaign_id' => $campaignId
196
  ];
197
-
198
  $args = array(
199
  'headers' => array(
200
  'Authorization' => "Bearer MTIzNA==",
@@ -203,7 +373,6 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
203
  'method' => 'DELETE',
204
  'body' => wp_json_encode($data)
205
  );
206
-
207
  // Send remote request
208
  $request = wp_remote_request($url, $args);
209
 
@@ -215,22 +384,12 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
215
  if((isset($response_body->error) && $response_body->error == '')){
216
  $message = $response_body->message;
217
  echo json_encode(['status' => 'success', 'message' => $message]);
218
- // return new WP_REST_Response(
219
- // array(
220
- // 'status' => $response_code,
221
- // 'message' => $response_message,
222
- // 'data' => $response_body->data
223
- // )
224
- // );
225
  }else{
226
  $message = is_array($response_body->errors) ? $response_body->errors[0] : "Face some unprocessable entity";
227
  echo json_encode(['status' => 'error', 'message' => $message]);
228
  // return new WP_Error($response_code, $response_message, $response_body);
229
  }
230
-
231
- // echo json_encode( $categories );
232
  }
233
- // IMPORTANT: don't forget to exit
234
  exit;
235
  }
236
 
@@ -238,75 +397,61 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
238
  * Update the campaign status pause/active
239
  */
240
  public function tvcajax_update_campaign_status(){
241
- // make sure this call is legal
242
- if($this->safe_ajax_call(filter_input(INPUT_POST, 'campaignStatusNonce'), 'tvcajax-update-campaign-status-nonce')){
243
-
244
- if(!class_exists('ShoppingApi')){
245
- //require_once(__DIR__ . '/ShoppingApi.php');
246
- include(ENHANCAD_PLUGIN_DIR . 'includes/setup/ShoppingApi.php');
247
- }
248
-
249
- $merchantId = filter_input(INPUT_POST, 'merchantId');
250
- $customerId = filter_input(INPUT_POST, 'customerId');
251
- $campaignId = filter_input(INPUT_POST, 'campaignId');
252
- $budgetId = filter_input(INPUT_POST, 'budgetId');
253
- $campaignName = filter_input(INPUT_POST, 'campaignName');
254
- $budget = filter_input(INPUT_POST, 'budget');
255
- $status = filter_input(INPUT_POST, 'status');
256
- $url = $this->apiDomain.'/campaigns/update';
257
- $shoppingObj = new ShoppingApi();
258
- $campaignData = $shoppingObj->getCampaignDetails($campaignId);
259
-
260
- $data = [
261
- 'merchant_id' => $merchantId,
262
- 'customer_id' => $customerId,
263
- 'campaign_id' => $campaignId,
264
- 'account_budget_id' => $budgetId,
265
- 'campaign_name' => $campaignName,
266
- 'budget' => $budget,
267
- 'status' => $status,
268
- 'target_country' => $campaignData->data['data']->targetCountry,
269
- 'ad_group_id' => $campaignData->data['data']->adGroupId,
270
- 'ad_group_resource_name' => $campaignData->data['data']->adGroupResourceName
271
- ];
272
-
273
- $args = array(
274
- 'headers' => array(
275
- 'Authorization' => "Bearer MTIzNA==",
276
- 'Content-Type' => 'application/json'
277
- ),
278
- 'method' => 'PATCH',
279
- 'body' => wp_json_encode($data)
280
- );
281
-
282
- // Send remote request
283
- $request = wp_remote_request($url, $args);
284
 
285
- // Retrieve information
286
- $response_code = wp_remote_retrieve_response_code($request);
287
- $response_message = wp_remote_retrieve_response_message($request);
288
- $response_body = json_decode(wp_remote_retrieve_body($request));
289
- if((isset($response_body->error) && $response_body->error == '')){
290
- $message = $response_body->message;
291
- echo json_encode(['status' => 'success', 'message' => $message]);
292
- // return new WP_REST_Response(
293
- // array(
294
- // 'status' => $response_code,
295
- // 'message' => $response_message,
296
- // 'data' => $response_body->data
297
- // )
298
- // );
299
- }else{
300
- $message = is_array($response_body->errors) ? $response_body->errors[0] : "Face some unprocessable entity";
301
- echo json_encode(['status' => 'error', 'message' => $message]);
302
- // return new WP_Error($response_code, $response_message, $response_body);
303
- }
304
 
305
- // echo json_encode( $categories );
306
- }
 
 
 
 
 
 
 
 
307
 
308
- // IMPORTANT: don't forget to exit
309
- exit;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
310
  }
311
 
312
  /**
37
  add_action('wp_ajax_tvc_call_notification_dismiss', array($this, 'tvc_call_notification_dismiss'));
38
  add_action('wp_ajax_tvc_call_active_licence', array($this, 'tvc_call_active_licence'));
39
  add_action('wp_ajax_tvc_call_add_survey', array($this, 'tvc_call_add_survey'));
40
+
41
+ add_action('wp_ajax_tvcajax_product_sync_bantch_wise', array($this, 'tvcajax_product_sync_bantch_wise'));
42
+ }
43
+
44
+ public function tvcajax_product_sync_bantch_wise(){
45
+ global $wpdb;
46
+ // barch size for inser data in DB
47
+ $product_db_batch_size = 100;
48
+ // barch size for inser product in GMC
49
+ $product_batch_size = 100;
50
+ if(!class_exists('CustomApi')){
51
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
52
+ }
53
+ if(!class_exists('TVCProductSyncHelper')){
54
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/class-tvc-product-sync-helper.php');
55
+ }
56
+ $customObj = new CustomApi();
57
+ $TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
58
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
59
+ $TVCProductSyncHelper = new TVCProductSyncHelper();
60
+ //sleep(3);
61
+ $prouct_pre_sync_table = $wpdb->prefix ."ee_prouct_pre_sync_data";
62
+
63
+ $sync_produt = ""; $sync_produt_p = ""; $is_synced_up = ""; $sync_message = "";
64
+ $sync_progressive_data = isset($_POST['sync_progressive_data'])?$_POST['sync_progressive_data']:"";
65
+ $sync_produt = isset($sync_progressive_data['sync_produt'])?$sync_progressive_data['sync_produt']:"";
66
+ $sync_step = isset($sync_progressive_data['sync_step'])?$sync_progressive_data['sync_step']:"1";
67
+ $total_product =isset($sync_progressive_data['total_product'])?$sync_progressive_data['total_product']:"0";
68
+ $last_sync_product_id =isset($sync_progressive_data['last_sync_product_id'])?$sync_progressive_data['last_sync_product_id']:"";
69
+ $skip_products =isset($sync_progressive_data['skip_products'])?$sync_progressive_data['skip_products']:"0";
70
+
71
+ //print_r($_POST);
72
+ $merchant_id = isset($_POST['tvc_data'])?$_POST['tvc_data']:"";
73
+ $account_id = isset($_POST['account_id'])?$_POST['account_id']:"";
74
+ $customer_id = isset($_POST['customer_id'])?$_POST['customer_id']:"";
75
+ $subscription_id = isset($_POST['subscription_id'])?$_POST['subscription_id']:"";
76
+ $data = isset($_POST['tvc_data'])?$_POST['tvc_data']:"";
77
+
78
+
79
+ if( $sync_progressive_data == "" && $TVC_Admin_DB_Helper->tvc_row_count("ee_prouct_pre_sync_data") > 0 ){
80
+ $TVC_Admin_DB_Helper->tvc_safe_truncate_table($prouct_pre_sync_table);
81
+ }
82
+ /*
83
+ * step one start
84
+ */
85
+ if($total_product <= $sync_produt && $sync_step == 1){
86
+ $sync_step = 2;
87
+ $sync_produt = 0;
88
+ }
89
+ if($sync_step == 1){
90
+ parse_str($data, $formArray);
91
+ $mappedCatsDB = [];
92
+ $mappedCats = [];
93
+ $mappedAttrs = [];
94
+ $skipProducts = [];
95
+ foreach($formArray as $key => $value){
96
+ if(preg_match("/^category-name-/i", $key)){
97
+ if($value != ''){
98
+ $keyArray = explode("name-", $key);
99
+ $mappedCatsDB[$keyArray[1]]['name'] = $value;
100
+ }
101
+ unset($formArray[$key]);
102
+ }else if(preg_match("/^category-/i", $key)){
103
+ if($value != '' && $value > 0){
104
+ $keyArray = explode("-", $key);
105
+ $mappedCats[$keyArray[1]] = $value;
106
+ $mappedCatsDB[$keyArray[1]]['id'] = $value;
107
+ }
108
+ unset($formArray[$key]);
109
+ }else{
110
+ if($value){
111
+ $mappedAttrs[$key] = $value;
112
+ }
113
+ }
114
+ }
115
+ //add/update data in defoult profile
116
+ $profile_data = array("profile_title"=>"Default","g_attribute_mapping"=>json_encode($mappedAttrs),"update_date"=>date('Y-m-d'));
117
+ if($TVC_Admin_DB_Helper->tvc_row_count("ee_product_sync_profile") ==0){
118
+ $TVC_Admin_DB_Helper->tvc_add_row("ee_product_sync_profile",$profile_data);
119
+ }else{
120
+ $TVC_Admin_DB_Helper->tvc_update_row("ee_product_sync_profile",$profile_data,array("id"=>1));
121
+ }
122
+ update_option("ee_prod_mapped_cats", serialize($mappedCatsDB));
123
+ update_option("ee_prod_mapped_attrs", serialize($mappedAttrs));
124
+
125
+ /*
126
+ * start product add in DB
127
+ * start clategory list
128
+ */
129
+ if(!empty($mappedCats)){
130
+ $batch_count =0;
131
+ $values = array();
132
+ $place_holders = array();
133
+ foreach($mappedCats as $mc_key => $mappedCat){
134
+ $all_products = get_posts(array(
135
+ 'post_type' => 'product',
136
+ 'numberposts' => -1,
137
+ 'post_status' => 'publish',
138
+ 'tax_query' => array(
139
+ array(
140
+ 'taxonomy' => 'product_cat',
141
+ 'field' => 'term_id',
142
+ 'terms' => $mc_key, /* category name */
143
+ 'operator' => 'IN'
144
+ )
145
+ )
146
+ ));
147
+ /*
148
+ * start product list , it's run per category
149
+ */
150
+ if(!empty($all_products)){
151
+ foreach($all_products as $postkey => $postvalue){
152
+ $batch_count++;
153
+ $t_data = array(
154
+ 'w_product_id'=>$postvalue->ID,
155
+ 'w_cat_id'=>$mc_key,
156
+ 'g_cat_id'=>$mappedCat,
157
+ 'product_sync_profile_id'=> 1,
158
+ 'update_date'=>date('Y-m-d')
159
+ );
160
+ array_push( $values, $postvalue->ID, $mc_key, $mappedCat, 1, date('Y-m-d') );
161
+ $place_holders[] = "('%d', '%d', '%d','%d', '%s')";
162
+ if($batch_count >= $product_db_batch_size){
163
+ $query = "INSERT INTO $prouct_pre_sync_table (w_product_id, w_cat_id, g_cat_id, product_sync_profile_id, update_date) VALUES ";
164
+ $query .= implode( ', ', $place_holders );
165
+ $wpdb->query($wpdb->prepare( "$query", $values ));
166
+ $batch_count = 0;
167
+ $values = array();
168
+ $place_holders = array();
169
+ }
170
+ } //end product list loop
171
+ }// end product loop if
172
+ }//end clategory loop
173
+ /*
174
+ * add last batch data in DB
175
+ */
176
+ if($batch_count > 0){
177
+ $query = "INSERT INTO $prouct_pre_sync_table (w_product_id, w_cat_id, g_cat_id, product_sync_profile_id, update_date) VALUES ";
178
+ $query .= implode( ', ', $place_holders );
179
+ $wpdb->query($wpdb->prepare( "$query", $values ));
180
+ }
181
+
182
+ }//end category if
183
+ $total_product = $TVC_Admin_DB_Helper->tvc_row_count("ee_prouct_pre_sync_data");
184
+ $sync_produt = $total_product;
185
+ $sync_produt_p = ($sync_produt*100)/$total_product;
186
+ $is_synced_up = ($total_product <= $sync_produt)?true:false;
187
+ $sync_message = "Initiated, products are being synced to Merchant Center.Do not refresh..";
188
+ //step one end
189
+ }else if($sync_step == 2){
190
+ $rs = $TVCProductSyncHelper->call_batch_wise_sync_product($last_sync_product_id, $product_batch_size);
191
+ if(isset($rs['products_sync'])){
192
+ $sync_produt = (int)$sync_produt + $rs['products_sync'];
193
+ }
194
+ $skip_products=(isset($rs['skip_products']))?$rs['skip_products']:0;
195
+ $last_sync_product_id = (isset($rs['last_sync_product_id']))?$rs['last_sync_product_id']:0;
196
+ $sync_produt_p = ($sync_produt*100)/$total_product;
197
+ $is_synced_up = ($total_product <= $sync_produt)?true:false;
198
+ $sync_message = "Initiated, products are being synced to Merchant Center.Do not refresh..";
199
+ if($total_product <= $sync_produt){
200
+ $customObj->setGmcCategoryMapping($catMapRequest);
201
+ $customObj->setGmcAttributeMapping($attrMapRequest);
202
+ $TVC_Admin_Auto_Product_sync_Helper = new TVC_Admin_Auto_Product_sync_Helper();
203
+ $TVC_Admin_Auto_Product_sync_Helper->update_last_sync_in_db();
204
+ $sync_message = "Initiated, products are being synced to Merchant Center.Do not refresh..";
205
+ $TVC_Admin_DB_Helper->tvc_safe_truncate_table($prouct_pre_sync_table);
206
+ }
207
+ }
208
+ $sync_produt_p = round($sync_produt_p,0);
209
+ $sync_progressive_data = array("sync_step"=>$sync_step, "total_product"=>$total_product, "sync_produt"=>$sync_produt, "sync_produt_p"=>$sync_produt_p, 'skip_products'=>$skip_products, "last_sync_product_id"=>$last_sync_product_id, "is_synced_up"=>$is_synced_up, "sync_message"=>$sync_message);
210
+ echo json_encode(array('status'=>'success', "sync_progressive_data" => $sync_progressive_data,"api_rs"=>$rs));
211
+ exit;
212
  }
213
 
214
  public function tvc_call_add_survey(){
360
  $campaignId = filter_input(INPUT_POST, 'campaignId');
361
 
362
  $url = $this->apiDomain.'/campaigns/delete';
 
363
  $data = [
364
  'merchant_id' => $merchantId,
365
  'customer_id' => $customerId,
366
  'campaign_id' => $campaignId
367
  ];
 
368
  $args = array(
369
  'headers' => array(
370
  'Authorization' => "Bearer MTIzNA==",
373
  'method' => 'DELETE',
374
  'body' => wp_json_encode($data)
375
  );
 
376
  // Send remote request
377
  $request = wp_remote_request($url, $args);
378
 
384
  if((isset($response_body->error) && $response_body->error == '')){
385
  $message = $response_body->message;
386
  echo json_encode(['status' => 'success', 'message' => $message]);
 
 
 
 
 
 
 
387
  }else{
388
  $message = is_array($response_body->errors) ? $response_body->errors[0] : "Face some unprocessable entity";
389
  echo json_encode(['status' => 'error', 'message' => $message]);
390
  // return new WP_Error($response_code, $response_message, $response_body);
391
  }
 
 
392
  }
 
393
  exit;
394
  }
395
 
397
  * Update the campaign status pause/active
398
  */
399
  public function tvcajax_update_campaign_status(){
400
+ // make sure this call is legal
401
+ if($this->safe_ajax_call(filter_input(INPUT_POST, 'campaignStatusNonce'), 'tvcajax-update-campaign-status-nonce')){
402
+ if(!class_exists('ShoppingApi')){
403
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/ShoppingApi.php');
404
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
405
 
406
+ $header = array(
407
+ "Authorization: Bearer MTIzNA==",
408
+ "content-type: application/json"
409
+ );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
410
 
411
+ $merchantId = filter_input(INPUT_POST, 'merchantId');
412
+ $customerId = filter_input(INPUT_POST, 'customerId');
413
+ $campaignId = filter_input(INPUT_POST, 'campaignId');
414
+ $budgetId = filter_input(INPUT_POST, 'budgetId');
415
+ $campaignName = filter_input(INPUT_POST, 'campaignName');
416
+ $budget = filter_input(INPUT_POST, 'budget');
417
+ $status = filter_input(INPUT_POST, 'status');
418
+ $curl_url = $this->apiDomain.'/campaigns/update';
419
+ $shoppingObj = new ShoppingApi();
420
+ $campaignData = $shoppingObj->getCampaignDetails($campaignId);
421
 
422
+ $data = [
423
+ 'merchant_id' => $merchantId,
424
+ 'customer_id' => $customerId,
425
+ 'campaign_id' => $campaignId,
426
+ 'account_budget_id' => $budgetId,
427
+ 'campaign_name' => $campaignName,
428
+ 'budget' => $budget,
429
+ 'status' => $status,
430
+ 'target_country' => $campaignData->data['data']->targetCountry,
431
+ 'ad_group_id' => $campaignData->data['data']->adGroupId,
432
+ 'ad_group_resource_name' => $campaignData->data['data']->adGroupResourceName
433
+ ];
434
+ $postData = json_encode($data);
435
+ $ch = curl_init();
436
+ curl_setopt_array($ch, array(
437
+ CURLOPT_URL => esc_url($curl_url),
438
+ CURLOPT_CUSTOMREQUEST => 'PATCH',
439
+ CURLOPT_RETURNTRANSFER => true,
440
+ CURLOPT_TIMEOUT => 1000,
441
+ CURLOPT_HTTPHEADER => $header,
442
+ CURLOPT_POSTFIELDS => $postData
443
+ ));
444
+ $response = curl_exec($ch);
445
+ $response = json_decode($response);
446
+ if (isset($response->error) && $response->error == false) {
447
+ $message = $response->message;
448
+ echo json_encode(['status' => 'success', 'message' => $message]);
449
+ }else{
450
+ $message = is_array($response->errors) ? $response->errors[0] : "Face some unprocessable entity";
451
+ echo json_encode(['status' => 'error', 'message' => $message]);
452
+ }
453
+ }
454
+ exit;
455
  }
456
 
457
  /**
includes/setup/CustomApi.php CHANGED
@@ -448,7 +448,42 @@ class CustomApi{
448
  return $e->getMessage();
449
  }
450
  }
451
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
452
  public function getSyncProductList($postData) {
453
  try {
454
  $postData["maxResults"] = 100;
448
  return $e->getMessage();
449
  }
450
  }
451
+ public function products_sync($data) {
452
+ try {
453
+ $header = array(
454
+ "Authorization: Bearer MTIzNA==",
455
+ "content-type: application/json",
456
+ "AccessToken:".$this->generateAccessToken($this->get_tvc_access_token(), $this->get_tvc_refresh_token())
457
+ );
458
+ $curl_url = $this->apiDomain . "/products/batch";
459
+ $postData = json_encode($data);
460
+ $ch = curl_init();
461
+ curl_setopt_array($ch, array(
462
+ CURLOPT_URL => esc_url($curl_url),
463
+ CURLOPT_RETURNTRANSFER => true,
464
+ CURLOPT_TIMEOUT => 10000,
465
+ CURLOPT_HTTPHEADER => $header,
466
+ CURLOPT_POSTFIELDS => $postData
467
+ ));
468
+ $response = curl_exec($ch);
469
+ $response = json_decode($response);
470
+ $return = new \stdClass();
471
+ if (isset($response->error) && $response->error == '') {
472
+ $return->error = false;
473
+ $return->products_sync = count($response->data->entries);
474
+ return $return;
475
+ } else {
476
+ $return->error = true;
477
+ foreach($response_body->errors as $err){
478
+ $return->message = $err;
479
+ break;
480
+ }
481
+ return $return;
482
+ }
483
+ } catch (Exception $e) {
484
+ return $e->getMessage();
485
+ }
486
+ }
487
  public function getSyncProductList($postData) {
488
  try {
489
  $postData["maxResults"] = 100;
includes/setup/ShoppingApi.php CHANGED
@@ -6,17 +6,17 @@ class ShoppingApi {
6
  private $merchantId;
7
  private $apiDomain;
8
  private $token;
 
9
 
10
  public function __construct() {
 
11
  $this->customApiObj = new CustomApi();
12
- $this->customApiObj->getGoogleAnalyticDetail();
13
-
14
  //$queries = new TVC_Queries();
15
  $this->apiDomain = TVC_API_CALL_URL;
16
  //$this->apiDomain = 'http://127.0.0.1:8000/api';
17
  $this->token = 'MTIzNA==';
18
- $this->merchantId = (isset($GLOBALS['tatvicData']['tvc_merchant'])) ? $GLOBALS['tatvicData']['tvc_merchant'] : "";
19
- $this->customerId = (isset($GLOBALS['tatvicData']['tvc_customer'])) ? $GLOBALS['tatvicData']['tvc_customer'] : "";
20
  }
21
 
22
  public function getCampaigns() {
@@ -335,10 +335,13 @@ class ShoppingApi {
335
  return $e->getMessage();
336
  }
337
  }
338
-
339
  public function createCampaign($campaign_name = '', $budget = 0, $target_country = 'US', $all_products = 0, $category_id = '', $category_level = '') {
340
  try {
341
- $url = $this->apiDomain . '/campaigns/create';
 
 
 
 
342
  $data = [
343
  'merchant_id' => $this->merchantId,
344
  'customer_id' => $this->customerId,
@@ -348,37 +351,28 @@ class ShoppingApi {
348
  'all_products' => $all_products,
349
  'filter_by' => 'category',
350
  'filter_data' => ["id" => $category_id, "level" => $category_level]
351
- ];
352
-
353
- $args = array(
354
- 'headers' => array(
355
- 'Authorization' => "Bearer $this->token",
356
- 'Content-Type' => 'application/json'
357
- ),
358
- 'body' => wp_json_encode($data)
359
- );
360
-
361
-
362
- // Send remote request
363
- $request = wp_remote_post($url, $args);
364
-
365
- // Retrieve information
366
- $response_code = wp_remote_retrieve_response_code($request);
367
- $response_message = wp_remote_retrieve_response_message($request);
368
- $response_body = json_decode(wp_remote_retrieve_body($request));
369
- //
370
- if (!is_wp_error($request) && (isset($response_body->error) && $response_body->error == '')) {
371
- // return new WP_REST_Response(
372
- // array(
373
- // 'status' => $response_code,
374
- // 'message' => $response_message,
375
- // 'data' => $response_body->data
376
- // )
377
- // );
378
- return $response_body;
379
- } else {
380
- //return new WP_Error($response_code, $response_message, $response_body);
381
- return $response_body;
382
  }
383
  } catch (Exception $e) {
384
  return $e->getMessage();
@@ -387,7 +381,11 @@ class ShoppingApi {
387
 
388
  public function updateCampaign($campaign_name = '', $budget = 0, $campaign_id = '', $budget_id='', $target_country = '', $all_products = 0, $category_id = '', $category_level = '', $ad_group_id = '', $ad_group_resource_name = '') {
389
  try {
390
- $url = $this->apiDomain . '/campaigns/update';
 
 
 
 
391
  $data = [
392
  'merchant_id' => $this->merchantId,
393
  'customer_id' => $this->customerId,
@@ -402,41 +400,33 @@ class ShoppingApi {
402
  'ad_group_resource_name' => $ad_group_resource_name,
403
  'filter_by' => 'category',
404
  'filter_data' => ["id" => $category_id, "level" => $category_level]
405
- ];
406
- $args = array(
407
- 'headers' => array(
408
- 'Authorization' => "Bearer $this->token",
409
- 'Content-Type' => 'application/json'
410
- ),
411
- 'method' => 'PATCH',
412
- 'body' => wp_json_encode($data)
413
- );
414
-
 
 
 
415
 
416
- // Send remote request
417
- $request = wp_remote_request($url, $args);
418
-
419
-
420
- // Retrieve information
421
- $response_code = wp_remote_retrieve_response_code($request);
422
- $response_message = wp_remote_retrieve_response_message($request);
423
- $response_body = json_decode(wp_remote_retrieve_body($request));
424
-
425
- if (!is_wp_error($request) && (isset($response_body->error) && $response_body->error == '')) {
426
- return new WP_REST_Response(
427
- array(
428
- 'status' => $response_code,
429
- 'message' => $response_message,
430
- 'data' => $response_body->data
431
- )
432
- );
433
- } else {
434
- //return new WP_Error($response_code, $response_message, $response_body);
435
- return $response_body;
436
  }
437
  } catch (Exception $e) {
438
  return $e->getMessage();
439
  }
440
  }
441
-
442
- }
6
  private $merchantId;
7
  private $apiDomain;
8
  private $token;
9
+ protected $TVC_Admin_Helper;
10
 
11
  public function __construct() {
12
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
13
  $this->customApiObj = new CustomApi();
 
 
14
  //$queries = new TVC_Queries();
15
  $this->apiDomain = TVC_API_CALL_URL;
16
  //$this->apiDomain = 'http://127.0.0.1:8000/api';
17
  $this->token = 'MTIzNA==';
18
+ $this->merchantId = $this->TVC_Admin_Helper->get_merchantId();
19
+ $this->customerId = $this->TVC_Admin_Helper->get_currentCustomerId();
20
  }
21
 
22
  public function getCampaigns() {
335
  return $e->getMessage();
336
  }
337
  }
 
338
  public function createCampaign($campaign_name = '', $budget = 0, $target_country = 'US', $all_products = 0, $category_id = '', $category_level = '') {
339
  try {
340
+ $header = array(
341
+ "Authorization: Bearer MTIzNA==",
342
+ "content-type: application/json"
343
+ );
344
+ $curl_url = $this->apiDomain . "/campaigns/create";
345
  $data = [
346
  'merchant_id' => $this->merchantId,
347
  'customer_id' => $this->customerId,
351
  'all_products' => $all_products,
352
  'filter_by' => 'category',
353
  'filter_data' => ["id" => $category_id, "level" => $category_level]
354
+ ];
355
+ $postData = json_encode($data);
356
+ $ch = curl_init();
357
+ curl_setopt_array($ch, array(
358
+ CURLOPT_URL => esc_url($curl_url),
359
+ CURLOPT_RETURNTRANSFER => true,
360
+ CURLOPT_TIMEOUT => 1000,
361
+ CURLOPT_HTTPHEADER => $header,
362
+ CURLOPT_POSTFIELDS => $postData
363
+ ));
364
+ $response = curl_exec($ch);
365
+ $response = json_decode($response);
366
+ $return = new \stdClass();
367
+ if (isset($response->error) && $response->error == false) {
368
+ $return->error = false;
369
+ $return->message = $response->message;
370
+ $return->data = $response->data;
371
+ return $return;
372
+ } else {
373
+ $return->error = true;
374
+ $return->errors = $response->errors;
375
+ return $return;
 
 
 
 
 
 
 
 
 
376
  }
377
  } catch (Exception $e) {
378
  return $e->getMessage();
381
 
382
  public function updateCampaign($campaign_name = '', $budget = 0, $campaign_id = '', $budget_id='', $target_country = '', $all_products = 0, $category_id = '', $category_level = '', $ad_group_id = '', $ad_group_resource_name = '') {
383
  try {
384
+ $header = array(
385
+ "Authorization: Bearer MTIzNA==",
386
+ "content-type: application/json"
387
+ );
388
+ $curl_url = $this->apiDomain . '/campaigns/update';
389
  $data = [
390
  'merchant_id' => $this->merchantId,
391
  'customer_id' => $this->customerId,
400
  'ad_group_resource_name' => $ad_group_resource_name,
401
  'filter_by' => 'category',
402
  'filter_data' => ["id" => $category_id, "level" => $category_level]
403
+ ];
404
+ $postData = json_encode($data);
405
+ $ch = curl_init();
406
+ curl_setopt_array($ch, array(
407
+ CURLOPT_URL => esc_url($curl_url),
408
+ CURLOPT_CUSTOMREQUEST => 'PATCH',
409
+ CURLOPT_RETURNTRANSFER => true,
410
+ CURLOPT_TIMEOUT => 1000,
411
+ CURLOPT_HTTPHEADER => $header,
412
+ CURLOPT_POSTFIELDS => $postData
413
+ ));
414
+ $response = curl_exec($ch);
415
+ $response = json_decode($response);
416
 
417
+ $return = new \stdClass();
418
+ if (isset($response->error) && $response->error == false) {
419
+ $return->error = false;
420
+ $return->message = $response->message;
421
+ $return->data = $response->data;
422
+ return $return;
423
+ } else {
424
+ $return->error = true;
425
+ $return->errors = $response->errors;
426
+ return $return;
 
 
 
 
 
 
 
 
 
 
427
  }
428
  } catch (Exception $e) {
429
  return $e->getMessage();
430
  }
431
  }
432
+ }
 
includes/setup/account.php ADDED
@@ -0,0 +1,180 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ class TVC_Account {
3
+ protected $TVC_Admin_Helper="";
4
+ protected $url = "";
5
+ protected $subscriptionId = "";
6
+ protected $google_detail;
7
+ protected $customApiObj;
8
+ public function __construct() {
9
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
10
+ $this->customApiObj = new CustomApi();
11
+ $this->url = $this->TVC_Admin_Helper->get_connect_url();
12
+ $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
13
+ $this->google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
14
+ $this->TVC_Admin_Helper->add_spinner_html();
15
+ $this->create_form();
16
+ }
17
+
18
+ public function create_form() {
19
+ $message = ""; $class="";
20
+ $googleDetail = [];
21
+ $plan_id = 1;
22
+ $plan_name = "Free Plan";
23
+ $plan_price ="Free";
24
+ $api_licence_key="";
25
+ $paypal_subscr_id = "";
26
+ $product_sync_max_limit ="100";
27
+ $activation_date = "";
28
+ $next_payment_date = "";
29
+ $subscription_type = "";
30
+ if(isset($this->google_detail['setting'])){
31
+ if ($this->google_detail['setting']) {
32
+ $googleDetail = $this->google_detail['setting'];
33
+ if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
34
+ $plan_id = $googleDetail->plan_id;
35
+ }
36
+ if(isset($googleDetail->licence_key) && !in_array($googleDetail->plan_id, array("1"))){
37
+ $api_licence_key = $googleDetail->licence_key;
38
+ }
39
+ if(isset($googleDetail->subscription_type) && !in_array($googleDetail->plan_id, array("1"))){
40
+ if($googleDetail->subscription_type == 1){
41
+ // $subscription_type = " ( Monthly )";
42
+ }else if($googleDetail->subscription_type == 2){
43
+ //$subscription_type = " ( Yearly )";
44
+ }
45
+ }
46
+
47
+ if(isset($googleDetail->plan_name) && !in_array($googleDetail->plan_id, array("1"))){
48
+ $plan_name = $googleDetail->plan_name.$subscription_type;
49
+ }
50
+ if(isset($googleDetail->price) && !in_array($googleDetail->plan_id, array("1"))){
51
+ $plan_price = $googleDetail->price." USD";
52
+ }
53
+ if(isset($googleDetail->paypal_subscr_id) && !in_array($googleDetail->plan_id, array("1"))){
54
+ $paypal_subscr_id = $googleDetail->paypal_subscr_id;
55
+ }
56
+ if(isset($googleDetail->max_limit)){
57
+ $product_sync_max_limit = $googleDetail->max_limit;
58
+ if(in_array($plan_id, array("7","8"))){
59
+ $product_sync_max_limit = "Unlimited";
60
+ }
61
+ }
62
+ if(isset($googleDetail->subscription_activation_date) && !in_array($googleDetail->plan_id, array("1"))){
63
+ $activation_date = $googleDetail->subscription_activation_date;
64
+ }
65
+ if(isset($googleDetail->subscription_expiry_date) && !in_array($googleDetail->plan_id, array("1"))){
66
+ $next_payment_date = $googleDetail->subscription_expiry_date;
67
+ }
68
+ }
69
+ }
70
+ ?>
71
+ <div class="tab-content">
72
+ <?php if($message){
73
+ printf('<div class="%1$s"><div class="alert">%2$s</div></div>', esc_attr($class), esc_html($message));
74
+ }?>
75
+ <div class="tab-pane show active" id="tvc-account-page">
76
+ <div class="tab-card" >
77
+ <div class="row">
78
+ <div class="col-md-10 col-lg-10 border-right">
79
+
80
+ <div class="licence tvc-licence" >
81
+ <div class="tvc_licence_key_wapper <?php if($plan_id != 1){?>tvc-hide<?php }?>">
82
+ <?php if($plan_id == 1){?>
83
+ <p>You are using our free plugin, no licence needed ! Happy analyzing..!! :)</p>
84
+ <p class="font-weight-bold">To unlock more features of google products, consider our <a href="<?php echo $this->TVC_Admin_Helper->get_pro_plan_site().'?utm_source=EE+Plugin+User+Interface&utm_medium=Account+Summary+pro+version&utm_campaign=Upsell+at+Conversios'; ?>" target="_blank">pro version.</a></p>
85
+ <?php }?>
86
+ <form method="post" name="google-analytic" id="tvc-licence-active">
87
+ <div class="input-group">
88
+ <input type="text" id="licence_key" name="licence_key" class="form-control" placeholder="Already purchased? Enter licence key" required="">
89
+ <div class="input-group-append">
90
+ <button type="submit" class="btn btn-primary" name="verify-licence-key"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/right-arrow.svg'; ?>" alt="active licence key"></button>
91
+ </div>
92
+ </div>
93
+ </form>
94
+ </div>
95
+ <div class="google-account-analytics tvc_licence_key_change_wapper <?php if($plan_id == 1){?>tvc-hide<?php }?>">
96
+ <div class="acc-num">
97
+ <label class="ga-title tvc_licence_key_title">Licence key:</label>
98
+ <p class="ga-text tvc_licence_key"><?php echo $api_licence_key; ?></p>
99
+ <p class="ga-text text-right tvc_licence_key_change"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/refresh.svg'; ?>" alt="active licence key"></p>
100
+ </div>
101
+ </div>
102
+ </div>
103
+
104
+ <div class="tvc-table">
105
+ <strong>Account Summary</strong>
106
+ <table>
107
+ <tbody>
108
+ <tr><th>Plan name</th><td><?php echo $plan_name; ?></td></tr>
109
+ <tr><th>Plan price</th><td><?php echo $plan_price; ?></td></tr>
110
+ <tr><th>Product sync limit</th><td><?php echo $product_sync_max_limit; ?></td></tr>
111
+ <?php if($plan_id != 1){?>
112
+ <tr><th>Active licence key</th><td><?php echo $api_licence_key; ?></td></tr>
113
+ <tr><th>PayPal subscription id</th><td><?php echo $paypal_subscr_id; ?></td></tr>
114
+ <tr><th>Last bill date</th><td><?php echo $activation_date; ?></td></tr>
115
+ <tr><th>Expected bill date</th><td><?php echo $next_payment_date; ?></td></tr>
116
+ <?php } ?>
117
+ </tbody>
118
+ </table>
119
+ </div>
120
+ </div>
121
+ <div class="col-md-6 col-lg-4">
122
+ <?php //echo get_tvc_google_ads_help_html(); ?>
123
+ </div>
124
+ </div>
125
+ </div>
126
+ </div>
127
+ </div>
128
+ <?php echo get_connect_google_popup_html_to_active_licence();?>
129
+ <script>
130
+ $(document).ready(function () {
131
+ $(document).on('click','#tvc_google_connect_active_licence_close',function(event){
132
+ $('#tvc_google_connect_active_licence').modal('hide');
133
+ });
134
+ $(document).on('click','.tvc_licence_key_change',function(event){
135
+ $(".tvc_licence_key_change_wapper").slideUp(500);
136
+ $(".tvc_licence_key_wapper").slideDown(700);
137
+ });
138
+ $(document).on('submit','form#tvc-licence-active',function(event){
139
+ event.preventDefault();
140
+ let licence_key = $("#licence_key").val();
141
+ var form_data = jQuery("#tvc-licence-active").serialize();
142
+ if(licence_key!=""){
143
+ var data = {
144
+ action: "tvc_call_active_licence",
145
+ licence_key:licence_key
146
+ };
147
+ $.ajax({
148
+ type: "POST",
149
+ dataType: "json",
150
+ url: myAjaxNonces.ajaxurl,
151
+ data: data,
152
+ beforeSend: function(){
153
+ tvc_helper.loaderSection(true);
154
+ },
155
+ success: function(response){
156
+ if (response.error === false) {
157
+ tvc_helper.tvc_alert("success","",response.message);
158
+ setTimeout(function(){
159
+ location.reload();
160
+ }, 2000);
161
+ }else{
162
+ if( response.is_connect == false){
163
+ $('#tvc_google_connect_active_licence').modal('show');
164
+ }else{
165
+ tvc_helper.tvc_alert("error","",response.message);
166
+ }
167
+ }
168
+ tvc_helper.loaderSection(false);
169
+ }
170
+ });
171
+ }else{
172
+ tvc_helper.tvc_alert("error","Licence key is required.");
173
+ }
174
+ });
175
+ });
176
+ </script>
177
+ <?php
178
+ }
179
+ }
180
+ ?>
includes/setup/add-campaign.php CHANGED
@@ -67,29 +67,7 @@ class AddCampaign {
67
  }
68
  }
69
 
70
- $currency = $this->TVC_Admin_Helper->get_user_currency_symbol();
71
- if (isset($_GET['edit']) && $_GET['edit'] != '') {
72
- $campaign_details_res = $api_obj->getCampaignDetails($_GET['edit']);
73
- if (isset($campaign_details_res->errors) && !empty($campaign_details_res->errors)) {
74
- $error_code = array_keys($campaign_details_res->errors)[0];
75
- if($error_code == 404){
76
- $error_msg = 'Campaign details not found';
77
- }else{
78
- if (isset($campaign_details_res->error_data) && !empty($campaign_details_res->error_data)) {
79
- // $error_msg = array_values($campaign_details_res->error_data)[0]->errors[0];
80
- }
81
- }
82
- $class = 'notice notice-error';
83
- $message = esc_html__(isset($error_msg) ? $error_msg : 'There was some error fetching campaign details.', 'sample-text-domain');
84
- printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html('Error : ' . $message));
85
- } else {
86
- $campaign_details = $campaign_details_res->data;
87
- if ($campaign_details['status'] == 200) {
88
- $campaign_details = $campaign_details['data'];
89
- }
90
- }
91
- }
92
-
93
  if (isset($_POST['create_campaign'])) {
94
  $campaign_name = isset($_POST['campaign_name'])?$_POST['campaign_name']:"";
95
  $campaign_budget = isset($_POST['campaign_budget'])?$_POST['campaign_budget']:"";
@@ -109,8 +87,7 @@ class AddCampaign {
109
  $message = esc_html__('Smart Shopping Campaign Created Successfully '.$campaign_neme, 'sample-text-domain');
110
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
111
  }
112
- }
113
- if (isset($_POST['update_campaign'])) {
114
  $campaign_name = isset($_POST['campaign_name'])?$_POST['campaign_name']:"";
115
  $campaign_budget = isset($_POST['campaign_budget'])?$_POST['campaign_budget']:"";
116
  $campaign_id = isset($_POST['campaign_id'])?$_POST['campaign_id']:"";
@@ -123,24 +100,45 @@ class AddCampaign {
123
  $category_level = isset($_POST['category_level'])?$_POST['category_level']:"";
124
 
125
  $campaign = $api_obj->updateCampaign($campaign_name, $campaign_budget, $campaign_id, $budget_id, $sales_country, $all_products, $category_id, $category_level, $ad_group_id, $ad_group_resource_name);
126
-
127
  if (isset($campaign->errors) && !empty($campaign->errors)) {
128
  $class = 'notice notice-error';
129
  $message = esc_html__(isset($campaign->errors) ? $campaign->errors[0] : 'Error', 'sample-text-domain');
130
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html('Error : ' . $message));
131
- } else if(isset($campaign->data)){
132
- $campaign = $campaign->data;
133
- if ($campaign['status'] == 200) {
134
- $campaign_neme = isset($campaign['data'])?'with Resource name '.$campaign['data']:"";
135
- $class = 'notice notice-success';
136
- $message = esc_html__('Smart Shopping Campaign Updated Successfully ' . $campaign_neme, 'sample-text-domain');
137
- printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
138
  // $url = admin_url('admin.php?page=tvc-configuration-page');
139
  //wp_redirect($url);
140
- }
141
  }
142
  echo "<script>jQuery('#feed-spinner').css('display', 'none');</script>";
143
- } ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
 
145
  <div class="tab-content">
146
  <div class="tab-pane show active" id="googleShoppingFeed">
67
  }
68
  }
69
 
70
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  if (isset($_POST['create_campaign'])) {
72
  $campaign_name = isset($_POST['campaign_name'])?$_POST['campaign_name']:"";
73
  $campaign_budget = isset($_POST['campaign_budget'])?$_POST['campaign_budget']:"";
87
  $message = esc_html__('Smart Shopping Campaign Created Successfully '.$campaign_neme, 'sample-text-domain');
88
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
89
  }
90
+ }else if (isset($_POST['update_campaign'])) {
 
91
  $campaign_name = isset($_POST['campaign_name'])?$_POST['campaign_name']:"";
92
  $campaign_budget = isset($_POST['campaign_budget'])?$_POST['campaign_budget']:"";
93
  $campaign_id = isset($_POST['campaign_id'])?$_POST['campaign_id']:"";
100
  $category_level = isset($_POST['category_level'])?$_POST['category_level']:"";
101
 
102
  $campaign = $api_obj->updateCampaign($campaign_name, $campaign_budget, $campaign_id, $budget_id, $sales_country, $all_products, $category_id, $category_level, $ad_group_id, $ad_group_resource_name);
 
103
  if (isset($campaign->errors) && !empty($campaign->errors)) {
104
  $class = 'notice notice-error';
105
  $message = esc_html__(isset($campaign->errors) ? $campaign->errors[0] : 'Error', 'sample-text-domain');
106
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html('Error : ' . $message));
107
+ } else if(isset($campaign->data)){
108
+ $campaign_neme = isset($campaign->data)?'with Resource name '.$campaign->data:"";
109
+ $class = 'notice notice-success';
110
+ $message = esc_html__('Smart Shopping Campaign Updated Successfully ' . $campaign_neme, 'sample-text-domain');
111
+ printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
 
 
112
  // $url = admin_url('admin.php?page=tvc-configuration-page');
113
  //wp_redirect($url);
114
+
115
  }
116
  echo "<script>jQuery('#feed-spinner').css('display', 'none');</script>";
117
+ }
118
+ $currency = $this->TVC_Admin_Helper->get_user_currency_symbol();
119
+ if (isset($_GET['edit']) && $_GET['edit'] != '') {
120
+ $campaign_details_res = $api_obj->getCampaignDetails($_GET['edit']);
121
+ if (isset($campaign_details_res->errors) && !empty($campaign_details_res->errors)) {
122
+ $error_code = array_keys($campaign_details_res->errors)[0];
123
+ if($error_code == 404){
124
+ $error_msg = 'Campaign details not found';
125
+ }else{
126
+ if (isset($campaign_details_res->error_data) && !empty($campaign_details_res->error_data)) {
127
+ // $error_msg = array_values($campaign_details_res->error_data)[0]->errors[0];
128
+ }
129
+ }
130
+ $class = 'notice notice-error';
131
+ $message = esc_html__(isset($error_msg) ? $error_msg : 'There was some error fetching campaign details.', 'sample-text-domain');
132
+ printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html('Error : ' . $message));
133
+ } else {
134
+ $campaign_details = $campaign_details_res->data;
135
+ if ($campaign_details['status'] == 200) {
136
+ $campaign_details = $campaign_details['data'];
137
+ }
138
+ }
139
+ }
140
+
141
+ ?>
142
 
143
  <div class="tab-content">
144
  <div class="tab-pane show active" id="googleShoppingFeed">
includes/setup/class-tatvic-category-selector-element.php CHANGED
@@ -25,21 +25,20 @@ if ( ! class_exists( 'Tatvic_Category_Selector_Element' ) ) :
25
 
26
 
27
  public static function category_mapping_row( $category, $category_children, $level_indicator, $mode, $ee_prod_mapped_cats) {
28
-
29
  $category_row_class = 'mapping' === $mode ? 'tvc-category-mapping-selector' : 'tvc-category-selector';
30
  $mode_column = 'mapping' === $mode ? self::category_mapping_selector( 'catmap', $category->term_id, true, $ee_prod_mapped_cats ) : self::category_description_data_item( $category->term_id );
31
  return '<div class="row">
32
- <div class="col-6">
33
- <div class="form-group shop-category">
34
- <label class="form-label-control">' . $category->name . ' '.$level_indicator .'</label>
35
- </div>
36
- </div>
37
- <div class="col-6 align-self-center">
38
- <div class="form-group">
39
- <div id="feed-category-' . $category->term_id . '"></div>' .$mode_column . '
40
- </div>
41
- </div>
42
- </div>';
43
  }
44
 
45
  /**
25
 
26
 
27
  public static function category_mapping_row( $category, $category_children, $level_indicator, $mode, $ee_prod_mapped_cats) {
 
28
  $category_row_class = 'mapping' === $mode ? 'tvc-category-mapping-selector' : 'tvc-category-selector';
29
  $mode_column = 'mapping' === $mode ? self::category_mapping_selector( 'catmap', $category->term_id, true, $ee_prod_mapped_cats ) : self::category_description_data_item( $category->term_id );
30
  return '<div class="row">
31
+ <div class="col-6">
32
+ <div class="form-group shop-category">
33
+ <label class="form-label-control">' . $category->name .' <small>('.$category->count. ')</small> '.$level_indicator .'</label>
34
+ </div>
35
+ </div>
36
+ <div class="col-6 align-self-center">
37
+ <div class="form-group">
38
+ <div id="feed-category-' . $category->term_id . '"></div>' .$mode_column . '
39
+ </div>
40
+ </div>
41
+ </div>';
42
  }
43
 
44
  /**
includes/setup/class-tvc-product-sync-helper.php ADDED
@@ -0,0 +1,780 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ if ( ! class_exists( 'TVCProductSyncHelper' ) ) {
3
+ class TVCProductSyncHelper {
4
+ protected $merchantId;
5
+ protected $accountId;
6
+ protected $currentCustomerId;
7
+ protected $subscriptionId;
8
+ protected $country;
9
+ protected $site_url;
10
+ protected $category_wrapper_obj;
11
+ protected $TVC_Admin_Helper;
12
+ protected $TVC_Admin_DB_Helper;
13
+ public function __construct(){
14
+ $this->includes();
15
+ $this->add_table_in_db();
16
+ $this->TVC_Admin_Helper = new TVC_Admin_Helper();
17
+ $this->TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
18
+ $this->category_wrapper_obj = new Tatvic_Category_Wrapper();
19
+ $this->merchantId = $this->TVC_Admin_Helper->get_merchantId();
20
+ $this->accountId = $this->TVC_Admin_Helper->get_main_merchantId();
21
+ $this->currentCustomerId = $this->TVC_Admin_Helper->get_currentCustomerId();
22
+ $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
23
+ $this->country = $this->TVC_Admin_Helper->get_woo_country();
24
+ $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
25
+ add_action('admin_init', array($this,'add_table_in_db'));
26
+ }
27
+ public function includes(){
28
+ if (!class_exists('Tatvic_Category_Wrapper')) {
29
+ require_once(__DIR__ . '/tatvic-category-wrapper.php');
30
+ }
31
+
32
+ }
33
+ /*
34
+ * careate table batch wise for product sync
35
+ */
36
+ public function add_table_in_db(){
37
+ global $wpdb;
38
+ $tablename = $wpdb->prefix ."ee_product_sync_profile";
39
+ $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
40
+ if ( $wpdb->get_var( $query ) === $tablename ) {
41
+
42
+ }else{
43
+ $sql_create = "CREATE TABLE ".$tablename." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `profile_title` VARCHAR(100) NULL , `g_cat_id` INT(10) NULL , `g_attribute_mapping` LONGTEXT NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) );";
44
+ if(maybe_create_table( $tablename, $sql_create )){
45
+
46
+ }
47
+ }
48
+
49
+ $tablename = $wpdb->prefix ."ee_prouct_pre_sync_data";
50
+ $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
51
+ if ( $wpdb->get_var( $query ) === $tablename ) {
52
+
53
+ }else{
54
+ $sql_create = "CREATE TABLE ".$tablename." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `w_product_id` BIGINT(20) NOT NULL , `w_cat_id` INT(10) NOT NULL , `g_cat_id` INT(10) NOT NULL , `product_sync_profile_id` INT(10) NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '0', PRIMARY KEY (`id`) );";
55
+ if(maybe_create_table( $tablename, $sql_create )){
56
+
57
+ }
58
+ }
59
+ }
60
+ /*
61
+ * careate products object for product sync
62
+ */
63
+ public function tvc_get_map_product_attribute($products, $tvc_currency, $merchantId){
64
+ if(!empty($products)){
65
+ $items = [];
66
+ $skipProducts = [];
67
+ $product_ids = [];
68
+ $batchId = time();
69
+ $sync_profile = $this->TVC_Admin_DB_Helper->tvc_get_results('ee_product_sync_profile');
70
+ // set profile id in array key
71
+ $sync_profile_data = array();
72
+ if(!empty($sync_profile)){
73
+ foreach ($sync_profile as $key => $value) {
74
+ $sync_profile_data[$value->id]= $value;
75
+ }
76
+ }
77
+ if(empty($sync_profile_data)){
78
+ return array("error"=>true,"message"=>"No product sync profiles find.");
79
+ }
80
+ if(empty($products)){
81
+ return array("error"=>true,"message"=>"Products not found.");
82
+ }
83
+ foreach ($products as $postkey => $postvalue) {
84
+ $product_ids[] = $postvalue->w_product_id;
85
+ $postmeta = [];
86
+ $postmeta = $this->TVC_Admin_Helper->tvc_get_post_meta($postvalue->w_product_id);
87
+ $prd = wc_get_product($postvalue->w_product_id);
88
+ $postObj = (object) array_merge((array) get_post($postvalue->w_product_id), (array) $postmeta);
89
+
90
+ $product = array(
91
+ 'offer_id'=>$postvalue->w_product_id,
92
+ 'channel'=>'online',
93
+ 'link'=>get_permalink($postvalue->w_product_id),
94
+ 'google_product_category'=>$postvalue->g_cat_id
95
+ );
96
+
97
+ $temp_product=array();
98
+ $fixed_att_select_list = array("gender", "age_group", "shipping", "tax", "content_language", "target_country", "condition");
99
+ $formArray = "";
100
+ if(isset($sync_profile_data[$postvalue->product_sync_profile_id]) && $sync_profile_data[$postvalue->product_sync_profile_id]->g_attribute_mapping ){
101
+ $g_attribute_mapping = $sync_profile_data[$postvalue->product_sync_profile_id]->g_attribute_mapping;
102
+ $formArray = json_decode($g_attribute_mapping, true);
103
+ }
104
+ if(empty($formArray)){
105
+ return array("error"=>true,"message"=>"Product sync profile not found.");
106
+ }
107
+ //$formArray = json_decode($postvalue->g_attribute_mapping, true);
108
+ foreach ($fixed_att_select_list as $fixed_key) {
109
+ if(isset($formArray[$fixed_key]) && $formArray[$fixed_key] != "" ){
110
+ if($fixed_key == "shipping" && $formArray[$fixed_key] != ""){
111
+ $temp_product[$fixed_key]['price']['value'] = $formArray[$fixed_key];
112
+ $temp_product[$fixed_key]['price']['currency'] = $tvc_currency;
113
+ $temp_product[$fixed_key]['country'] = $formArray['target_country'];
114
+ }else if($fixed_key == "tax" && $formArray[$fixed_key] != ""){
115
+ $temp_product['taxes']['rate'] = $formArray[$fixed_key];
116
+ $temp_product['taxes']['country'] = $formArray['target_country'];
117
+ }else if( $formArray[$fixed_key] != ""){
118
+ $temp_product[$fixed_key] = $formArray[$fixed_key];
119
+ }
120
+ }
121
+ unset($formArray[$fixed_key]);
122
+ }
123
+
124
+ $product = array_merge($temp_product,$product);
125
+
126
+ if($prd->get_type() == "variable"){
127
+ $variation_attributes = $prd->get_variation_attributes();
128
+ $can_add_item_group_id = false;
129
+ $is_color_size = false;
130
+ if(!empty($variation_attributes)){
131
+ foreach($variation_attributes as $va_key => $va_value ){
132
+ $va_key = str_replace("_", " ", $va_key);
133
+ if (strpos($va_key, 'color') !== false) {
134
+ $can_add_item_group_id = true;
135
+ $is_color_size = true;
136
+ break;
137
+ }else if (strpos($va_key, 'size') !== false) {
138
+ $can_add_item_group_id = true;
139
+ $is_color_size = true;
140
+ break;
141
+ }
142
+ }
143
+ }
144
+ if(isset($formArray['gender']) && $formArray['gender']!= ""){
145
+ $can_add_item_group_id = true;
146
+ }else if(isset($formArray['age_group']) && $formArray['age_group']!= ""){
147
+ $can_add_item_group_id = true;
148
+ }
149
+ if($can_add_item_group_id == true){
150
+ $p_variations = $prd->get_available_variations();
151
+ if(!empty($p_variations)){
152
+ foreach ($p_variations as $v_key => $v_value) {
153
+ $postmeta_var = (object)$this->TVC_Admin_Helper->tvc_get_post_meta($v_value['variation_id']);
154
+ $formArray_val = $formArray['title'];
155
+ $product['title'] = (isset($postObj->$formArray_val))?$postObj->$formArray_val:get_the_title($postvalue->w_product_id);
156
+ $tvc_temp_desc_key = $formArray['description'];
157
+ $product['description'] = (isset($v_value['variation_description']) && $v_value['variation_description'] != "")?$v_value['variation_description']:$postObj->$tvc_temp_desc_key;
158
+ $product['offer_id'] = $v_value['variation_id'];
159
+ $product['id'] = $v_value['variation_id'];
160
+ $product['item_group_id'] = $postvalue->w_product_id;
161
+ $image_id = $v_value['image_id'];
162
+ $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
163
+ if($is_color_size == true){
164
+ if(isset($v_value['attributes']) && !empty($v_value['attributes']) ){
165
+ foreach($v_value['attributes'] as $va_key => $va_value ){
166
+ $va_key = str_replace("_", " ", $va_key);
167
+ if (strpos($va_key, 'color') !== false) {
168
+ $product['color'] = $va_value;
169
+ }else if (strpos($va_key, 'size') !== false) {
170
+ $product['sizes'] = $va_value;
171
+ }
172
+ }
173
+ }
174
+ }
175
+ foreach($formArray as $key => $value){
176
+ if($key == 'price'){
177
+ if(isset($postmeta_var->$value) && $postmeta_var->$value > 0){
178
+ $product[$key]['value'] = $postmeta_var->$value;
179
+ }else if(isset($postmeta_var->_regular_price) && $postmeta_var->_regular_price && $postmeta_var->_regular_price >0 ){
180
+ $product[$key]['value'] = $postmeta_var->_regular_price;
181
+ }else if(isset($postmeta_var->_price) && $postmeta_var->_price && $postmeta_var->_price >0 ){
182
+ $product[$key]['value'] = $postmeta_var->_price;
183
+ }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
184
+ $product[$key]['value'] = $postmeta_var->_sale_price;
185
+ }
186
+ if(isset($product[$key]['value']) && $product[$key]['value'] >0){
187
+ $product[$key]['currency'] = $tvc_currency;
188
+ }else{
189
+ $skipProducts[$postmeta_var->ID] = $postmeta_var;
190
+ }
191
+ }else if($key == 'sale_price'){
192
+ if(isset($postmeta_var->$value) && $postmeta_var->$value > 0){
193
+ $product[$key]['value'] = $postmeta_var->$value;
194
+ }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
195
+ $product[$key]['value'] = $postmeta_var->_sale_price;
196
+ }
197
+ if(isset($product[$key]['value']) && $product[$key]['value'] >0){
198
+ $product[$key]['currency'] = $tvc_currency;
199
+ }
200
+ }else if($key == 'availability'){
201
+ $tvc_find = array("instock","outofstock","onbackorder");
202
+ $tvc_replace = array("in stock","out of stock","preorder");
203
+ if(isset($postmeta_var->$value) && $postmeta_var->$value != ""){
204
+ $stock_status = $postmeta_var->$value;
205
+ $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
206
+ $product[$key] = $stock_status;
207
+ }else{
208
+ $stock_status = $postmeta_var->_stock_status;
209
+ $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
210
+ $product[$key] = $stock_status;
211
+ }
212
+ }else if(isset($postmeta_var->$value) && $postmeta_var->$value != ""){$product[$key] = $postmeta_var->$value;
213
+ }
214
+ }
215
+ $item = [
216
+ 'merchant_id' => $merchantId,
217
+ 'batch_id' => ++$batchId,
218
+ 'method' => 'insert',
219
+ 'product' => $product
220
+ ];
221
+ $items[] = $item;
222
+ }
223
+ }
224
+ }else{
225
+ goto simpleproduct;
226
+ }
227
+ }else{
228
+ simpleproduct:
229
+ $image_id = $prd->get_image_id();
230
+ $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
231
+ foreach($formArray as $key => $value){
232
+ if($key == 'price'){
233
+ if(isset($postObj->$value) && $postObj->$value > 0){
234
+ $product[$key]['value'] = $postObj->$value;
235
+ }else if(isset($postObj->_regular_price) && $postObj->_regular_price && $postObj->_regular_price >0 ){
236
+ $product[$key]['value'] = $postObj->_regular_price;
237
+ }else if(isset($postObj->_price) && $postObj->_price && $postObj->_price >0 ){
238
+ $product[$key]['value'] = $postObj->_price;
239
+ }else if(isset($postObj->_sale_price) && $postObj->_sale_price && $postObj->_sale_price >0 ){
240
+ $product[$key]['value'] = $postObj->_sale_price;
241
+ }
242
+ if(isset($product[$key]['value']) && $product[$key]['value'] >0){
243
+ $product[$key]['currency'] = $tvc_currency;
244
+ }else{
245
+ $skipProducts[$postObj->ID] = $postObj;
246
+ }
247
+ }else if($key == 'sale_price'){
248
+ if(isset($postObj->$value) && $postObj->$value > 0){
249
+ $product[$key]['value'] = $postObj->$value;
250
+ }else if(isset($postObj->_sale_price) && $postObj->_sale_price && $postObj->_sale_price >0 ){
251
+ $product[$key]['value'] = $postObj->_sale_price;
252
+ }
253
+ if(isset($product[$key]['value']) && $product[$key]['value'] >0){
254
+ $product[$key]['currency'] = $tvc_currency;
255
+ }
256
+ }else if($key == 'availability'){
257
+ $tvc_find = array("instock","outofstock","onbackorder");
258
+ $tvc_replace = array("in stock","out of stock","preorder");
259
+ if(isset($postObj->$value) && $postObj->$value != ""){
260
+ $stock_status = $postObj->$value;
261
+ $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
262
+ $product[$key] = $stock_status;
263
+ }else{
264
+ $stock_status = $postObj->_stock_status;
265
+ $stock_status = str_replace($tvc_find,$tvc_replace,$stock_status);
266
+ $product[$key] = $stock_status;
267
+ }
268
+ }else if(isset($postObj->$value) && $postObj->$value != ""){
269
+ //echo $key."==".$postObj->$value."<br>";
270
+ $product[$key] = $postObj->$value;
271
+ }
272
+ }
273
+ $item = [
274
+ 'merchant_id' => $merchantId,
275
+ 'batch_id' => ++$batchId,
276
+ 'method' => 'insert',
277
+ 'product' => $product
278
+ ];
279
+ $items[] = $item;
280
+ }
281
+ }
282
+ return array('error'=>false, 'items' => $items, 'skip_products'=> $skipProducts, 'product_ids'=>$product_ids);
283
+ }
284
+ }
285
+ /*
286
+ * batch wise sync product, its call from ajax fuction
287
+ */
288
+ public function call_batch_wise_sync_product($last_sync_product_id = null, $product_batch_size = 100){
289
+ if (!class_exists('CustomApi')) {
290
+ require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
291
+ }
292
+ $CustomApi = new CustomApi();
293
+ $product_count = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_prouct_pre_sync_data');
294
+ //$count = 0;
295
+ $pre_last_sync_product_id = $last_sync_product_id;
296
+ if( $product_count > 0 ){
297
+ $tvc_currency = $this->TVC_Admin_Helper->get_woo_currency();
298
+ $merchantId = $this->merchantId;
299
+ $customerId = $this->currentCustomerId;
300
+ $accountId = $this->accountId;
301
+ $subscriptionId = $this->subscriptionId;
302
+ $last_sync_product_id =( $last_sync_product_id > 0)?$last_sync_product_id:0;
303
+ global $wpdb;
304
+ $tablename = $wpdb->prefix .'ee_prouct_pre_sync_data';
305
+ $sql = "select * from ".$tablename." where id > ".$last_sync_product_id." LIMIT ".$product_batch_size;
306
+ $products = $wpdb->get_results($sql, OBJECT);
307
+ $entries = [];
308
+ if(!empty($products)){
309
+ $p_map_attribute = $this->tvc_get_map_product_attribute($products, $tvc_currency, $merchantId);
310
+ if(!empty($p_map_attribute) && isset($p_map_attribute['items']) && !empty($p_map_attribute['items'])){
311
+ // call product sync API
312
+ $data = [
313
+ 'merchant_id' => $accountId,
314
+ 'account_id' => $merchantId,
315
+ 'subscription_id' => $subscriptionId,
316
+ 'entries' => $p_map_attribute['items']
317
+ ];
318
+ $response = $CustomApi->products_sync($data);
319
+ $last_sync_product_id =end($products)->id;
320
+ if($response->error== false){
321
+ //"data"=> $p_map_attribute['items']
322
+ $products_sync =count($products);
323
+ return array('error'=> false, 'products_sync' => $products_sync, 'skip_products' => $p_map_attribute['skip_products'], 'last_sync_product_id'=>$last_sync_product_id);
324
+ }else{
325
+ return array('error'=> true, 'message' => $response->message );
326
+ }
327
+ // End call product sync API
328
+ $sync_product_ids = (isset($p_map_attribute['product_ids']))?$p_map_attribute['product_ids']:"";
329
+ }else if(!empty($p_map_attribute['message'])){
330
+ return array('error'=> true, 'message' => $p_map_attribute['message'] );
331
+ }
332
+ }
333
+ }
334
+
335
+ }
336
+ public function wooCommerceAttributes() {
337
+ global $wpdb;
338
+ $tve_table_prefix = $wpdb->prefix;
339
+ $column1 = json_decode(json_encode($this->TVC_Admin_Helper->getTableColumns($tve_table_prefix.'posts')), true);
340
+ $column2 = json_decode(json_encode($this->TVC_Admin_Helper->getTableData($tve_table_prefix.'postmeta', ['meta_key'])), true);
341
+ return array_merge($column1, $column2);
342
+ }
343
+
344
+ public function tvc_product_sync_popup_html(){
345
+ $category_wrapper = $this->category_wrapper_obj->category_table_content('mapping');
346
+ ob_start();
347
+ ?>
348
+ <div class="modal fade popup-modal create-campa overlay" id="syncProduct" data-backdrop="false">
349
+ <div class="modal-dialog modal-dialog-centered">
350
+ <div class="modal-content">
351
+ <div class="modal-body">
352
+ <button type="button" class="close tvc-popup-close" data-dismiss="modal"> &times; </button>
353
+ <h5>Map your product attributes</h5>
354
+ <p>Google Merchant Center uses attributes to format your product information for Shopping Ads. Map your product attributes to the Merchant Center product attributes below. You can also edit each product’s individual attributes after you sync your products. Not all fields below are marked required, however based on your shop's categories and your country you might map a few optional attributes as well. See the full guide <a target="_blank" href="https://support.google.com/merchants/answer/7052112">here</a>.
355
+ </p>
356
+ <div class="wizard-section campaign-wizard">
357
+ <div class="wizard-content">
358
+ <input type="hidden" name="merchant_id" id="merchant_id" value="<?php echo $this->merchantId; ?>">
359
+ <form class="tab-wizard wizard- wizard" id="productSync" method="POST">
360
+ <h5><span class="wiz-title">Category Mapping</span></h5>
361
+ <section>
362
+ <div class="card-wrapper">
363
+ <div class="row">
364
+ <div class="col-6">
365
+ <h6 class="heading-tbl"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/woocommerce.svg'; ?>" alt="WooCommerce"/>Commerce Category</h6>
366
+ </div>
367
+ <div class="col-6">
368
+ <h6 class="heading-tbl gmc-image-heading"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/google-shopping.svg'; ?>" alt="google-shopping"/>Google Merchant Center Category</h6>
369
+ </div>
370
+ </div><?php echo $category_wrapper; ?>
371
+ </div>
372
+ </section>
373
+ <!-- Step 2 -->
374
+ <h5><span class="wiz-title">Product Attribution Mapping</span></h5>
375
+ <section>
376
+ <div class="card-wrapper">
377
+ <div class="row">
378
+ <div class="col-6">
379
+ <h6 class="heading-tbl gmc-image-heading"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/google-shopping.svg'; ?>" alt="google-shopping"/>Google Merchant center product attributes</h6>
380
+ </div>
381
+ <div class="col-6">
382
+ <h6 class="heading-tbl"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/woocommerce.svg'; ?>" alt="WooCommerce"/>Commerce product attributes</h6>
383
+ </div>
384
+ </div>
385
+ <?php
386
+ $ee_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
387
+ $wooCommerceAttributes = $this->wooCommerceAttributes();
388
+ foreach ($this->TVC_Admin_Helper->get_gmcAttributes() as $key => $attribute) {
389
+ $sel_val="";
390
+ echo '<div class="row">
391
+ <div class="col-6 align-self-center">
392
+ <div class="form-group">
393
+ <span class="td-head">' . $attribute["field"] . " " . (isset($attribute["required"]) && $attribute["required"] == 1 ? '<span style="color: red;"> *</span>' : "") . '
394
+ <div class="tvc-tooltip">
395
+ <span class="tvc-tooltiptext tvc-tooltip-right">'.(isset($attribute["desc"])? $attribute["desc"]:"") .'</span>
396
+ <img src="'. ENHANCAD_PLUGIN_URL.'/admin/images/icon/informationI.svg" alt=""/>
397
+ </div>
398
+ </span>
399
+ </div>
400
+ </div>
401
+ <div class="col-6 align-self-center">
402
+ <div class="form-group">';
403
+ $tvc_select_option = $wooCommerceAttributes;
404
+ $require = (isset($attribute['required']) && $attribute['required'])?true:false;
405
+ $sel_val_def = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
406
+ if($attribute["field"]=='link'){
407
+ echo "product link";
408
+ }else if($attribute["field"]=='shipping'){
409
+ //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
410
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
411
+ echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
412
+ }else if($attribute["field"]=='tax'){
413
+ //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
414
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
415
+ echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
416
+ }else if($attribute["field"]=='content_language'){
417
+ echo $this->TVC_Admin_Helper->tvc_language_select($attribute["field"], 'content_language', 'Please Select Attribute', 'en',$require);
418
+ }else if($attribute["field"]=='target_country'){
419
+ //$name, $class_id, bool $require = false
420
+ echo $this->TVC_Admin_Helper->tvc_countries_select($attribute["field"], 'target_country', 'Please Select Attribute', $require);
421
+ }else{
422
+ if(isset($attribute['fixed_options']) && $attribute['fixed_options'] !=""){
423
+ $tvc_select_option_t = explode(",", $attribute['fixed_options']);
424
+ $tvc_select_option=[];
425
+ foreach( $tvc_select_option_t as $o_val ){
426
+ $tvc_select_option[]['field'] = $o_val;
427
+ }
428
+ $sel_val = $sel_val_def;
429
+ $this->TVC_Admin_Helper->tvc_select($attribute["field"],$attribute["field"],'Please Select Attribute', $sel_val, $require, $tvc_select_option);
430
+ }else{
431
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
432
+ //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
433
+ $this->TVC_Admin_Helper->tvc_select($attribute["field"],$attribute["field"],'Please Select Attribute', $sel_val, $require, $tvc_select_option);
434
+ }
435
+ }
436
+ echo '</div>
437
+ </div>
438
+ </div>';
439
+ }?>
440
+ </div>
441
+
442
+ </section>
443
+ </form>
444
+ </div>
445
+ </div>
446
+ </div>
447
+ </div>
448
+ </div>
449
+ </div>
450
+ <div class="progress-bar-wapper">
451
+ <span class="tvc-sync-message">Initializing...</span>
452
+ <div class="progress tvc-sync-progress-db">
453
+ <div class="progress-bar progress-bar-striped progress-bar-animated tvc-sync-progress-bar" role="progressbar" style="width: 0%;" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100">0%</div>
454
+ </div>
455
+ <div class="progress tvc-sync-progress-gmc">
456
+ <div class="progress-bar progress-bar-striped progress-bar-animated bg-success tvc-sync-success-progress-bar" role="progressbar" style="width: 0%" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100"></div>
457
+ </div>
458
+ <div class="tvc-progress-info">
459
+ <span class="tvc-sync-count">0</span>
460
+ <span class="tvc-total-count">--</span>
461
+ </div>
462
+ </div>
463
+ <?php
464
+ echo $this->add_product_sync_script();
465
+ return ob_get_clean();
466
+ }//tvc_product_sync_popup_html
467
+
468
+ public function add_product_sync_script(){
469
+ $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
470
+ ?>
471
+ <script>
472
+ $(document).ready(function() {
473
+ $(".select2").select2();
474
+ });
475
+ $(".tab-wizard").steps({
476
+ headerTag: "h5",
477
+ bodyTag: "section",
478
+ transitionEffect: "fade",
479
+ titleTemplate: '<span class="step">#index#</span> #title#',
480
+ labels: {
481
+ finish: "Sync Products",
482
+ next: "Next",
483
+ previous: "Previous",
484
+ },
485
+ onStepChanging: function(e, currentIndex, newIndex) {
486
+ var shop_categories = JSON.parse("<?php echo $shop_categories_list; ?>");
487
+ var is_tvc_cat_selecte = false;
488
+ shop_categories.forEach(function(v,i){
489
+ if(is_tvc_cat_selecte == false && $("#category-"+v).val() != "" && $("#category-"+v).val() != 0){
490
+ is_tvc_cat_selecte =true;
491
+ return false;
492
+ }
493
+ });
494
+ if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
495
+ return true;
496
+ }else{
497
+ tvc_helper.tvc_alert("error","","Select at least one Google Merchant Center Category.",true);
498
+ return false;
499
+ }
500
+ },
501
+ onStepChanged: function(event, currentIndex, priorIndex) {
502
+ $('.steps .current').prevAll().addClass('disabled');
503
+ },
504
+ onFinished: function(event, currentIndex) {
505
+ var valid=true;
506
+ jQuery(".field-required").each(function() {
507
+ if($(this).val()==0 && valid){
508
+ valid=false;
509
+ $(this).select2('focus');
510
+ }
511
+ });
512
+ if(!valid){
513
+ tvc_helper.tvc_alert("error","","Please select all required fields");
514
+ }else{
515
+ $(".actions a[href='#finish']").prop( "disabled", true );
516
+ submitProductSyncUp();
517
+
518
+ }//check for required fields end
519
+ }
520
+ });
521
+
522
+ function submitProductSyncUp(sync_progressive_data = null){
523
+ jQuery("#feed-spinner").css("display", "block");
524
+ $('.progress-bar-wapper').addClass('open');
525
+ var data = {
526
+ action:'tvcajax_product_sync_bantch_wise',
527
+ merchant_id:'<?php echo $this->merchantId; ?>',
528
+ account_id:'<?php echo $this->accountId; ?>',
529
+ customer_id: '<?php echo $this->currentCustomerId; ?>',
530
+ subscription_id: '<?php echo $this->subscriptionId; ?>',
531
+ tvc_data: jQuery("#productSync").serialize(),
532
+ sync_progressive_data:sync_progressive_data
533
+ }
534
+ $.ajax({
535
+ type: "POST",
536
+ dataType: "json",
537
+ url: '<?php echo admin_url( 'admin-ajax.php' ); ?>',
538
+ data: data,
539
+ beforeSend: function(){
540
+ },
541
+ success: function(response){
542
+ console.log(response);
543
+ jQuery("#feed-spinner").css("display", "none");
544
+ //var rs = JSON.parse(response);
545
+ let sync_produt_p = Math.round(response.sync_progressive_data.sync_produt_p);
546
+ let total_product = response.sync_progressive_data.total_product;
547
+ let sync_produt = response.sync_progressive_data.sync_produt;
548
+ let sync_message = response.sync_progressive_data.sync_message;
549
+ let sync_step = response.sync_progressive_data.sync_step;
550
+ let is_synced_up = response.sync_progressive_data.is_synced_up;
551
+ let last_sync_product_id = response.sync_progressive_data.last_sync_product_id;
552
+ let skip_products = response.sync_progressive_data.last_sync_product_id;
553
+ let tvc_sync_progress_bar_class = "tvc-sync-progress-bar";
554
+ if(sync_step == 1){
555
+ jQuery(".tvc-sync-progress-db").css("display","flex");
556
+ }else if(sync_step == 2){
557
+ jQuery(".tvc-sync-progress-db").hide();
558
+ jQuery(".tvc-sync-progress-gmc").css("display","flex");
559
+ tvc_sync_progress_bar_class = "tvc-sync-success-progress-bar";
560
+ }
561
+
562
+ jQuery("."+tvc_sync_progress_bar_class).css("width",sync_produt_p+"%");
563
+ jQuery("."+tvc_sync_progress_bar_class).html(sync_produt_p+"%");
564
+ jQuery("."+tvc_sync_progress_bar_class).attr("aria-valuenow",sync_produt_p);
565
+ jQuery(".tvc-progress-info").show();
566
+ jQuery(".tvc-sync-count").html(sync_produt);
567
+ jQuery(".tvc-total-count").html(total_product);
568
+ jQuery(".tvc-sync-message").html(sync_message);
569
+ if(sync_step == 1 && is_synced_up == true){
570
+ is_synced_up = false;
571
+ }
572
+
573
+ if(is_synced_up == false && sync_step <= 2){
574
+ submitProductSyncUp(response.sync_progressive_data);
575
+ }else if(sync_step == 2 ){
576
+ setTimeout(function(){
577
+ $('.progress-bar-wapper').removeClass('open');
578
+ jQuery(".tvc-sync-progress-bar").css("width","0%");
579
+ jQuery(".tvc-sync-success-progress-bar").css("width","0%");
580
+ jQuery(".tvc-sync-progress-bar").html("0%");
581
+ jQuery(".tvc-sync-success-progress-bar").html("0%");
582
+ jQuery(".tvc-sync-progress-bar").attr("aria-valuenow","0");
583
+ jQuery(".tvc-sync-success-progress-bar").attr("aria-valuenow","0");
584
+ jQuery(".tvc-sync-count").html("0");
585
+ jQuery(".tvc-total-count").html("--");
586
+ jQuery(".tvc-sync-message").html("Initialization of products data for push data in Google shopping");
587
+ if (response.api_rs.error == false) {
588
+ var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
589
+ if (response.sync_progressive_data.skip_products.length > 0) {
590
+ message = message + "\n Because of pricing issues, " + response.sync_progressive_data.skip_products.length + " products did not sync.";
591
+ }
592
+ tvc_helper.tvc_alert("success","",message);
593
+ window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
594
+ }else {
595
+ tvc_helper.tvc_alert("error","",response.api_rs.message);
596
+ }
597
+ }, 2000);
598
+ setTimeout(function(){
599
+ //window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
600
+ }, 7000);
601
+ }
602
+ //console.log(response);
603
+ }
604
+ });
605
+ /*var merchantId = '<?php echo $this->merchantId; ?>';
606
+ var accountId = '<?php echo $this->accountId; ?>';
607
+ var customerId = '<?php echo $this->currentCustomerId; ?>';
608
+ var subscriptionId = '<?php echo $this->subscriptionId; ?>';
609
+ var formData = jQuery("#productSync").serialize();
610
+ jQuery.post(
611
+ myAjaxNonces.ajaxurl,
612
+ {
613
+ action: "tvcajax-product-syncup",
614
+ merchantId: merchantId,
615
+ customerId: customerId,
616
+ accountId: accountId,
617
+ subscriptionId: subscriptionId,
618
+ data: formData,
619
+ productSyncupNonce: myAjaxNonces.productSyncupNonce
620
+ },
621
+ function( response ) {
622
+ jQuery("#feed-spinner").css("display", "none");
623
+ //console.log(response);
624
+ var rsp = JSON.parse(response);
625
+ if (rsp.status == "success") {
626
+ $('#syncProduct').modal('hide');
627
+ var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
628
+ if (rsp.skipProducts > 0) {
629
+ message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
630
+ }
631
+ tvc_helper.tvc_alert("success","",message);
632
+ setTimeout(function(){
633
+ window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
634
+ }, 7000);
635
+ } else {
636
+ tvc_helper.tvc_alert("error","",rsp.message);
637
+ }
638
+ }
639
+ );*/
640
+ }
641
+
642
+ $(document).on("show.bs.modal", "#syncProduct", function (e) {
643
+ jQuery("#feed-spinner").css("display", "block");
644
+ selectCategory();
645
+ $("select[id^=catmap]").each(function(){
646
+ removeChildCategory($(this).attr("id"))
647
+ });
648
+ });
649
+
650
+ function selectCategory() {
651
+ var country_id = "<?php echo $this->country; ?>";
652
+ var customer_id = '<?php echo $this->currentCustomerId?>';
653
+ var parent = "";
654
+ jQuery.post(
655
+ myAjaxNonces.ajaxurl,
656
+ {
657
+ action: "tvcajax-gmc-category-lists",
658
+ countryCode: country_id,
659
+ customerId: customer_id,
660
+ parent: parent,
661
+ gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
662
+ },
663
+ function( response ) {
664
+ var categories = JSON.parse(response);
665
+ var obj;
666
+ $("select[id^=catmap]").each(function(){
667
+ obj = $("#catmap-"+$(this).attr("catid")+"_0");
668
+ obj.empty();
669
+ obj.append("<option id='0' value='0' resourcename='0'>Select a category</option>");
670
+ $.each(categories, function (i, value) {
671
+ obj.append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
672
+ });
673
+ });
674
+ jQuery("#feed-spinner").css("display", "none");
675
+ });
676
+ }
677
+
678
+ function selectSubCategory(thisObj) {
679
+ var selectId;
680
+ var wooCategoryId;
681
+ var GmcCategoryId;
682
+ var GmcParent;
683
+ selectId = thisObj.id;
684
+ wooCategoryId = $(thisObj).attr("catid");
685
+ GmcCategoryId = $(thisObj).find(":selected").val();
686
+ GmcParent = $(thisObj).find(":selected").attr("resourcename");
687
+ //$("#"+selectId).select2().find(":selected").val();
688
+ // $("#"+selectId).select2().find(":selected").data("id");
689
+ //console.log(selectId+"--"+wooCategoryId+"--"+GmcCategoryId+"--"+GmcParent);
690
+
691
+ jQuery("#feed-spinner").css("display", "block");
692
+ removeChildCategory(selectId);
693
+ selectChildCategoryValue(wooCategoryId);
694
+ if (GmcParent != undefined) {
695
+ var country_id = "<?php echo $this->country; ?>";
696
+ var customer_id = '<?php echo $this->currentCustomerId?>';
697
+ jQuery.post(
698
+ myAjaxNonces.ajaxurl,
699
+ {
700
+ action: "tvcajax-gmc-category-lists",
701
+ countryCode: country_id,
702
+ customerId: customer_id,
703
+ parent: GmcParent,
704
+ gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
705
+ },
706
+ function( response ) {
707
+ var categories = JSON.parse(response);
708
+ var newId;
709
+ var slitedId = selectId.split("_");
710
+ newId = slitedId[0]+"_"+ ++slitedId[1];
711
+ if(categories.length === 0){
712
+ }else{
713
+ //console.log(newId);
714
+ $("#"+newId).empty();
715
+ $("#"+newId).append("<option id='0' value='0' resourcename='0'>Select a sub-category</option>");
716
+ $.each(categories, function (i, value) {
717
+ $("#"+newId).append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
718
+ });
719
+ $("#"+newId).addClass("form-control");
720
+ //$("#"+newId).select2();
721
+ $("#"+newId).css("display", "block");
722
+ }
723
+ jQuery("#feed-spinner").css("display", "none");
724
+ }
725
+ );
726
+ }
727
+ }
728
+
729
+ function removeChildCategory(currentId){
730
+ var currentSplit = currentId.split("_");
731
+ var childEleId;
732
+ for (i = ++currentSplit[1]; i < 6; i++) {
733
+ childEleId = currentSplit[0]+"_"+ i;
734
+ //console.log($("#"+childEleId));
735
+ $("#"+childEleId).empty();
736
+ $("#"+childEleId).removeClass("form-control");
737
+ $("#"+childEleId).css("display", "none");
738
+ if ($("#"+childEleId).data("select2")) {
739
+ $("#"+childEleId).off("select2:select");
740
+ $("#"+childEleId).select2("destroy");
741
+ $("#"+childEleId).removeClass("select2");
742
+ }
743
+ }
744
+ }
745
+
746
+ function selectChildCategoryValue(wooCategoryId){
747
+ var childCatvala;
748
+ for(i = 0; i < 6; i++){
749
+ childCatvala = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").attr("id");
750
+ childCatname = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").text();
751
+ if($("#catmap-"+wooCategoryId+"_"+0).find(":selected").attr("id") <= 0){
752
+ $("#category-"+wooCategoryId).val(0);
753
+ }else{
754
+ if(childCatvala > 0){
755
+ $("#category-"+wooCategoryId).val(childCatvala);
756
+ $("#category-name-"+wooCategoryId).val(childCatname);
757
+ }
758
+ }
759
+ }
760
+ }
761
+ $( ".wizard-content" ).on( "click", ".change_prodct_feed_cat", function() {
762
+ // console.log( $( this ).attr("data-id") );
763
+ $(this).hide();
764
+ var feed_select_cat_id = $( this ).attr("data-id");
765
+ var woo_cat_id = $( this ).attr("data-cat-id");
766
+ jQuery("#category-"+woo_cat_id).val("0");
767
+ jQuery("#category-name-"+woo_cat_id).val("");
768
+ jQuery("#label-"+feed_select_cat_id).hide();
769
+ jQuery("#"+feed_select_cat_id).slideDown();
770
+ });
771
+ function changeProdctFeedCat(feed_select_cat_id){
772
+ jQuery("#label-"+feed_select_cat_id).hide();
773
+ jQuery("#"+feed_select_cat_id).slideDown();
774
+ }
775
+ </script>
776
+ <?php
777
+ }
778
+
779
+ }
780
+ }
includes/setup/google-shopping-feed-gaa-config.php CHANGED
@@ -1,41 +1,28 @@
1
  <?php
2
  class GAAConfiguration {
3
- protected $merchantId;
4
  protected $TVC_Admin_Helper;
5
- protected $currentCustomerId;
6
  protected $subscriptionId;
7
- protected $country;
8
  public function __construct() {
9
  ini_set('max_execution_time', '0');
10
  ini_set('memory_limit','-1');
11
  $this->includes();
12
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
13
- $this->merchantId = $this->TVC_Admin_Helper->get_merchantId();
14
- $this->accountId = $this->TVC_Admin_Helper->get_main_merchantId();
15
- $this->currentCustomerId = $this->TVC_Admin_Helper->get_currentCustomerId();
16
  $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
17
- $this->country = $this->TVC_Admin_Helper->get_woo_country();
18
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
19
  $this->url = $this->TVC_Admin_Helper->get_connect_url();
20
  $this->html_run();
21
  }
22
  public function includes() {
23
  if (!class_exists('Tatvic_Category_Wrapper')) {
24
- require_once(__DIR__ . '/tatvic-category-wrapper.php');
25
  }
26
  }
27
 
28
  public function html_run() {
29
  $this->TVC_Admin_Helper->add_spinner_html();
30
  $this->create_form();
31
- }
32
-
33
- public function wooCommerceAttributes() {
34
- global $wpdb;
35
- $tve_table_prefix = $wpdb->prefix;
36
- $column1 = json_decode(json_encode($this->TVC_Admin_Helper->getTableColumns($tve_table_prefix.'posts')), true);
37
- $column2 = json_decode(json_encode($this->TVC_Admin_Helper->getTableData($tve_table_prefix.'postmeta', ['meta_key'])), true);
38
- return array_merge($column1, $column2);
39
  }
40
 
41
  public function create_form() {
@@ -91,10 +78,9 @@ class GAAConfiguration {
91
  echo '<p class="ga-text text-right"><a href="#" class="text-underline" data-toggle="modal" data-target="#tvc_google_connect"><img src="'. ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg" alt="connect account"/></a></p>';
92
  }?>
93
  </div>
94
- </div>
95
-
96
  </div>
97
- <div class="row mb-3">
98
  <div class="col-6 col-md-6 col-lg-6">
99
  <h2 class="ga-title">Linked Google Ads Account:</h2>
100
  </div>
@@ -150,356 +136,38 @@ class GAAConfiguration {
150
  </div>
151
  </div>
152
  <div class="col-md-6 col-lg-4">
153
- <?php echo get_tvc_help_html(); ?>
154
  </div>
155
  </div>
156
  </div>
157
  </div>
158
  </div>
159
-
160
- <div class="modal fade popup-modal create-campa overlay" id="syncProduct" data-backdrop="false">
161
- <div class="modal-dialog modal-dialog-centered">
162
- <div class="modal-content">
163
- <div class="modal-body">
164
- <button type="button" class="close tvc-popup-close" data-dismiss="modal"> &times; </button>
165
- <h5>Map your product attributes</h5>
166
- <p>Google Merchant Center uses attributes to format your product information for Shopping Ads. Map your product attributes to the Merchant Center product attributes below. You can also edit each product’s individual attributes after you sync your products. Not all fields below are marked required, however based on your shop's categories and your country you might map a few optional attributes as well. See the full guide <a target="_blank" href="https://support.google.com/merchants/answer/7052112">here</a>.
167
- </p>
168
- <div class="wizard-section campaign-wizard">
169
- <div class="wizard-content">
170
- <input type="hidden" name="merchant_id" id="merchant_id" value="<?php echo $this->merchantId; ?>">
171
- <form class="tab-wizard wizard- wizard" id="productSync" method="POST">
172
- <h5><span class="wiz-title">Category Mapping</span></h5>
173
- <section>
174
- <div class="card-wrapper">
175
- <div class="row">
176
- <div class="col-6">
177
- <h6 class="heading-tbl">WooCommerce Category</h6>
178
- </div>
179
- <div class="col-6">
180
- <h6 class="heading-tbl">Google Merchant Center Category</h6>
181
- </div>
182
- </div><?php echo $category_wrapper; ?>
183
- </div>
184
- </section>
185
- <!-- Step 2 -->
186
- <h5><span class="wiz-title">Product Attribution Mapping</span></h5>
187
- <section>
188
- <div class="card-wrapper">
189
- <div class="row">
190
- <div class="col-6">
191
- <h6 class="heading-tbl">Google Merchant center product attributes</h6>
192
- </div>
193
- <div class="col-6">
194
- <h6 class="heading-tbl">WooCommerce product attributes</h6>
195
- </div>
196
- </div>
197
- <?php
198
- $ee_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
199
- $wooCommerceAttributes = $this->wooCommerceAttributes();
200
- foreach ($this->TVC_Admin_Helper->get_gmcAttributes() as $key => $attribute) {
201
- $sel_val="";
202
- echo '<div class="row">
203
- <div class="col-6 align-self-center">
204
- <div class="form-group">
205
- <span class="td-head">' . $attribute["field"] . " " . (isset($attribute["required"]) && $attribute["required"] == 1 ? '<span style="color: red;"> *</span>' : "") . '
206
- <div class="tvc-tooltip">
207
- <span class="tvc-tooltiptext tvc-tooltip-right">'.(isset($attribute["desc"])? $attribute["desc"]:"") .'</span>
208
- <img src="'. ENHANCAD_PLUGIN_URL.'/admin/images/icon/informationI.svg" alt=""/>
209
- </div>
210
- </span>
211
- </div>
212
- </div>
213
- <div class="col-6 align-self-center">
214
- <div class="form-group">';
215
- $tvc_select_option = $wooCommerceAttributes;
216
- $require = (isset($attribute['required']) && $attribute['required'])?true:false;
217
- $sel_val_def = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
218
- if($attribute["field"]=='link'){
219
- echo "product link";
220
- }else if($attribute["field"]=='shipping'){
221
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
222
- //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
223
- echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
224
- }else if($attribute["field"]=='tax'){
225
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
226
- //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
227
- echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
228
- }else if($attribute["field"]=='content_language'){
229
- echo $this->TVC_Admin_Helper->tvc_language_select($attribute["field"], '', 'Please Select Attribute', 'en',$require);
230
- }else if($attribute["field"]=='target_country'){
231
- //$name, $class_id, bool $require = false
232
- echo $this->TVC_Admin_Helper->tvc_countries_select($attribute["field"], '', 'Please Select Attribute', $require);
233
- }else{
234
- if(isset($attribute['fixed_options']) && $attribute['fixed_options'] !=""){
235
- $tvc_select_option_t = explode(",", $attribute['fixed_options']);
236
- $tvc_select_option=[];
237
- foreach( $tvc_select_option_t as $o_val ){
238
- $tvc_select_option[]['field'] = $o_val;
239
- }
240
- $sel_val = $sel_val_def;
241
- $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
242
- }else{
243
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
244
- //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
245
- $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
246
- }
247
- }
248
- echo '</div>
249
- </div>
250
- </div>';
251
- }?>
252
- </div>
253
- </section>
254
- </form>
255
- </div>
256
- </div>
257
- </div>
258
- </div>
259
- </div>
260
- </div>
261
- <?php echo get_connect_google_popup_html()?>
262
- <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
263
  $is_need_to_domain_claim = false;
264
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
265
  $is_need_to_domain_claim = true;
266
  }?>
267
  <script type="text/javascript">
268
- $(document).ready(function() {
269
- $(".select2").select2();
270
-
271
- $(document).on("click", "#tvc_btn_product_sync", function(event){
272
- var is_need_to_domain_claim = "<?php echo $is_need_to_domain_claim; ?>";
273
- if(is_need_to_domain_claim == 1 || is_need_to_domain_claim == true){
274
- event.preventDefault();
275
- jQuery.post(myAjaxNonces.ajaxurl,{
276
- action: "tvc_call_domain_claim",
277
- apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
278
- },function( response ){
279
-
280
- });
281
- }
282
- });
283
- });
284
- $(".tab-wizard").steps({
285
- headerTag: "h5",
286
- bodyTag: "section",
287
- transitionEffect: "fade",
288
- titleTemplate: '<span class="step">#index#</span> #title#',
289
- labels: {
290
- finish: "Sync Products",
291
- next: "Next",
292
- previous: "Previous",
293
- },
294
- onStepChanging: function(e, currentIndex, newIndex) {
295
- var shop_categories = JSON.parse("<?php echo $shop_categories_list; ?>");
296
- var is_tvc_cat_selecte = false;
297
- shop_categories.forEach(function(v,i){
298
- if(is_tvc_cat_selecte == false && $("#category-"+v).val() != "" && $("#category-"+v).val() != 0){
299
- is_tvc_cat_selecte =true;
300
- return false;
301
- }
302
- });
303
- if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
304
- return true;
305
- }else{
306
- tvc_helper.tvc_alert("error","","Select at least one Google Merchant Center Category.",true);
307
- return false;
308
- }
309
- },
310
- onStepChanged: function(event, currentIndex, priorIndex) {
311
- $('.steps .current').prevAll().addClass('disabled');
312
- },
313
- onFinished: function(event, currentIndex) {
314
- var valid=true;
315
- jQuery(".field-required").each(function() {
316
- if($(this).val()==0 && valid){
317
- valid=false;
318
- $(this).select2('focus');
319
- }
320
- });
321
- if(!valid){
322
- tvc_helper.tvc_alert("error","","Please select all required fields");
323
- }else{
324
- submitProductSyncUp();
325
- }//check for required fields end
326
- }
327
- });
328
-
329
- function submitProductSyncUp() {
330
- var merchantId = '<?php echo $this->merchantId; ?>';
331
- var accountId = '<?php echo $this->accountId; ?>';
332
- var customerId = '<?php echo $this->currentCustomerId; ?>';
333
- var subscriptionId = '<?php echo $this->subscriptionId; ?>';
334
- var formData = jQuery("#productSync").serialize();
335
- //console.log(formData);
336
- jQuery("#feed-spinner").css("display", "block");
337
- jQuery.post(
338
- myAjaxNonces.ajaxurl,
339
- {
340
- action: "tvcajax-product-syncup",
341
- merchantId: merchantId,
342
- customerId: customerId,
343
- accountId: accountId,
344
- subscriptionId: subscriptionId,
345
- data: formData,
346
- productSyncupNonce: myAjaxNonces.productSyncupNonce
347
- },
348
- function( response ) {
349
- jQuery("#feed-spinner").css("display", "none");
350
- //console.log(response);
351
- var rsp = JSON.parse(response)
352
- if (rsp.status == "success") {
353
- $('#syncProduct').modal('hide');
354
- var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
355
- if (rsp.skipProducts > 0) {
356
- message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
357
- }
358
- tvc_helper.tvc_alert("success","",message);
359
- setTimeout(function(){
360
- window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
361
- }, 7000);
362
- } else {
363
- tvc_helper.tvc_alert("error","",rsp.message);
364
- }
365
- }
366
- );
367
- }
368
-
369
- $(document).on("show.bs.modal", "#syncProduct", function (e) {
370
- jQuery("#feed-spinner").css("display", "block");
371
- selectCategory();
372
- $("select[id^=catmap]").each(function(){
373
- removeChildCategory($(this).attr("id"))
374
- });
375
- });
376
-
377
- function selectCategory() {
378
- var country_id = "<?php echo $this->country; ?>";
379
- var customer_id = '<?php echo $this->currentCustomerId?>';
380
- var parent = "";
381
- jQuery.post(
382
- myAjaxNonces.ajaxurl,
383
- {
384
- action: "tvcajax-gmc-category-lists",
385
- countryCode: country_id,
386
- customerId: customer_id,
387
- parent: parent,
388
- gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
389
- },
390
- function( response ) {
391
- var categories = JSON.parse(response);
392
- var obj;
393
- $("select[id^=catmap]").each(function(){
394
- obj = $("#catmap-"+$(this).attr("catid")+"_0");
395
- obj.empty();
396
- obj.append("<option id='0' value='0' resourcename='0'>Select a category</option>");
397
- $.each(categories, function (i, value) {
398
- obj.append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
399
  });
400
- });
401
- jQuery("#feed-spinner").css("display", "none");
402
- });
403
- }
404
-
405
- function selectSubCategory(thisObj) {
406
- var selectId;
407
- var wooCategoryId;
408
- var GmcCategoryId;
409
- var GmcParent;
410
- selectId = thisObj.id;
411
- wooCategoryId = $(thisObj).attr("catid");
412
- GmcCategoryId = $(thisObj).find(":selected").val();
413
- GmcParent = $(thisObj).find(":selected").attr("resourcename");
414
- //$("#"+selectId).select2().find(":selected").val();
415
- // $("#"+selectId).select2().find(":selected").data("id");
416
- //console.log(selectId+"--"+wooCategoryId+"--"+GmcCategoryId+"--"+GmcParent);
417
-
418
- jQuery("#feed-spinner").css("display", "block");
419
- removeChildCategory(selectId);
420
- selectChildCategoryValue(wooCategoryId);
421
- if (GmcParent != undefined) {
422
- var country_id = "<?php echo $this->country; ?>";
423
- var customer_id = '<?php echo $this->currentCustomerId?>';
424
- jQuery.post(
425
- myAjaxNonces.ajaxurl,
426
- {
427
- action: "tvcajax-gmc-category-lists",
428
- countryCode: country_id,
429
- customerId: customer_id,
430
- parent: GmcParent,
431
- gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
432
- },
433
- function( response ) {
434
- var categories = JSON.parse(response);
435
- var newId;
436
- var slitedId = selectId.split("_");
437
- newId = slitedId[0]+"_"+ ++slitedId[1];
438
- if(categories.length === 0){
439
- }else{
440
- //console.log(newId);
441
- $("#"+newId).empty();
442
- $("#"+newId).append("<option id='0' value='0' resourcename='0'>Select a sub-category</option>");
443
- $.each(categories, function (i, value) {
444
- $("#"+newId).append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
445
- });
446
- $("#"+newId).addClass("form-control");
447
- //$("#"+newId).select2();
448
- $("#"+newId).css("display", "block");
449
- }
450
- jQuery("#feed-spinner").css("display", "none");
451
  }
452
- );
453
- }
454
- }
455
-
456
- function removeChildCategory(currentId){
457
- var currentSplit = currentId.split("_");
458
- var childEleId;
459
- for (i = ++currentSplit[1]; i < 6; i++) {
460
- childEleId = currentSplit[0]+"_"+ i;
461
- //console.log($("#"+childEleId));
462
- $("#"+childEleId).empty();
463
- $("#"+childEleId).removeClass("form-control");
464
- $("#"+childEleId).css("display", "none");
465
- if ($("#"+childEleId).data("select2")) {
466
- $("#"+childEleId).off("select2:select");
467
- $("#"+childEleId).select2("destroy");
468
- $("#"+childEleId).removeClass("select2");
469
- }
470
- }
471
- }
472
-
473
- function selectChildCategoryValue(wooCategoryId){
474
- var childCatvala;
475
- for(i = 0; i < 6; i++){
476
- childCatvala = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").attr("id");
477
- childCatname = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").text();
478
- if($("#catmap-"+wooCategoryId+"_"+0).find(":selected").attr("id") <= 0){
479
- $("#category-"+wooCategoryId).val(0);
480
- }else{
481
- if(childCatvala > 0){
482
- $("#category-"+wooCategoryId).val(childCatvala);
483
- $("#category-name-"+wooCategoryId).val(childCatname);
484
- }
485
- }
486
- }
487
- }
488
- $( ".wizard-content" ).on( "click", ".change_prodct_feed_cat", function() {
489
- // console.log( $( this ).attr("data-id") );
490
- $(this).hide();
491
- var feed_select_cat_id = $( this ).attr("data-id");
492
- var woo_cat_id = $( this ).attr("data-cat-id");
493
-
494
- jQuery("#category-"+woo_cat_id).val("0");
495
- jQuery("#category-name-"+woo_cat_id).val("");
496
- jQuery("#label-"+feed_select_cat_id).hide();
497
- jQuery("#"+feed_select_cat_id).slideDown();
498
- });
499
- function changeProdctFeedCat(feed_select_cat_id){
500
- jQuery("#label-"+feed_select_cat_id).hide();
501
- jQuery("#"+feed_select_cat_id).slideDown();
502
- }
503
  </script>
504
  <?php
505
  } //create_form
1
  <?php
2
  class GAAConfiguration {
 
3
  protected $TVC_Admin_Helper;
 
4
  protected $subscriptionId;
5
+ protected $TVCProductSyncHelper;
6
  public function __construct() {
7
  ini_set('max_execution_time', '0');
8
  ini_set('memory_limit','-1');
9
  $this->includes();
10
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
11
+ $this->TVCProductSyncHelper = new TVCProductSyncHelper();
 
 
12
  $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
 
13
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
14
  $this->url = $this->TVC_Admin_Helper->get_connect_url();
15
  $this->html_run();
16
  }
17
  public function includes() {
18
  if (!class_exists('Tatvic_Category_Wrapper')) {
19
+ require_once(__DIR__ . '/class-tvc-product-sync-helper.php');
20
  }
21
  }
22
 
23
  public function html_run() {
24
  $this->TVC_Admin_Helper->add_spinner_html();
25
  $this->create_form();
 
 
 
 
 
 
 
 
26
  }
27
 
28
  public function create_form() {
78
  echo '<p class="ga-text text-right"><a href="#" class="text-underline" data-toggle="modal" data-target="#tvc_google_connect"><img src="'. ENHANCAD_PLUGIN_URL.'/admin/images/icon/add.svg" alt="connect account"/></a></p>';
79
  }?>
80
  </div>
81
+ </div>
 
82
  </div>
83
+ <div class="row mb-3">
84
  <div class="col-6 col-md-6 col-lg-6">
85
  <h2 class="ga-title">Linked Google Ads Account:</h2>
86
  </div>
136
  </div>
137
  </div>
138
  <div class="col-md-6 col-lg-4">
139
+ <?php echo get_tvc_help_html(); ?>
140
  </div>
141
  </div>
142
  </div>
143
  </div>
144
  </div>
145
+ <?php
146
+ // add product sync popup
147
+ echo $this->TVCProductSyncHelper->tvc_product_sync_popup_html();
148
+ //add connect popup
149
+ echo get_connect_google_popup_html()
150
+ ?>
151
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
152
  $is_need_to_domain_claim = false;
153
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
154
  $is_need_to_domain_claim = true;
155
  }?>
156
  <script type="text/javascript">
157
+ $(document).ready(function() {
158
+ $(document).on("click", "#tvc_btn_product_sync", function(event){
159
+ var is_need_to_domain_claim = "<?php echo $is_need_to_domain_claim; ?>";
160
+ if(is_need_to_domain_claim == 1 || is_need_to_domain_claim == true){
161
+ event.preventDefault();
162
+ jQuery.post(myAjaxNonces.ajaxurl,{
163
+ action: "tvc_call_domain_claim",
164
+ apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
165
+ },function( response ){
166
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
167
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
168
  }
169
+ });
170
+ });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
171
  </script>
172
  <?php
173
  } //create_form
includes/setup/google-shopping-feed-shopping-campaigns.php CHANGED
@@ -682,7 +682,7 @@ class CampaignsConfiguration
682
  if(rsp.status == "success"){
683
  var message = campaign_name + " status updated successfully";
684
  alert(message);
685
- window.location.href = "<?php echo $this->site_url.'shopping_campaigns_page'; ?>";
686
  }else{
687
  var message = rsp.message;
688
  alert(message);
682
  if(rsp.status == "success"){
683
  var message = campaign_name + " status updated successfully";
684
  alert(message);
685
+ //window.location.href = "<?php echo $this->site_url.'shopping_campaigns_page'; ?>";
686
  }else{
687
  var message = rsp.message;
688
  alert(message);
includes/setup/google-shopping-feed-sync-product.php CHANGED
@@ -1,45 +1,31 @@
1
  <?php
 
2
  class SyncProductConfiguration
3
  {
4
- protected $merchantId;
5
  protected $TVC_Admin_Helper;
6
- protected $currentCustomerId;
7
  protected $subscriptionId;
8
- protected $country;
9
  protected $TVC_Admin_DB_Helper;
 
10
  public function __construct(){
11
- $this->includes();
12
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
13
  $this->TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
14
- $this->merchantId = $this->TVC_Admin_Helper->get_merchantId();
15
- $this->accountId = $this->TVC_Admin_Helper->get_main_merchantId();
16
- $this->currentCustomerId = $this->TVC_Admin_Helper->get_currentCustomerId();
17
- $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
18
- $this->country = $this->TVC_Admin_Helper->get_woo_country();
19
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
20
  $this->TVC_Admin_Helper->need_auto_update_db();
21
  $this->html_run();
22
  }
23
-
24
  public function includes(){
25
- if (!class_exists('Tatvic_Category_Wrapper')) {
26
- require_once(__DIR__ . '/tatvic-category-wrapper.php');
27
  }
28
  }
29
-
30
  public function html_run(){
31
  $this->TVC_Admin_Helper->add_spinner_html();
32
  $this->create_form();
33
  }
34
 
35
- public function wooCommerceAttributes() {
36
- global $wpdb;
37
- $tve_table_prefix = $wpdb->prefix;
38
- $column1 = json_decode(json_encode($this->TVC_Admin_Helper->getTableColumns($tve_table_prefix.'posts')), true);
39
- $column2 = json_decode(json_encode($this->TVC_Admin_Helper->getTableData($tve_table_prefix.'postmeta', ['meta_key'])), true);
40
- return array_merge($column1, $column2);
41
- }
42
-
43
  public function create_form(){
44
  if(isset($_GET['welcome_msg']) && $_GET['welcome_msg'] == true){
45
  $this->TVC_Admin_Helper->call_domain_claim();
@@ -55,8 +41,7 @@ public function create_form(){
55
  </script>
56
  <?php
57
  }
58
- $category_wrapper_obj = new Tatvic_Category_Wrapper();
59
- $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
60
  $syncProductStat = [];
61
  $syncProductList = [];
62
  $last_api_sync_up ="";
@@ -66,11 +51,7 @@ public function create_form(){
66
  $syncProductStat = $google_detail['prod_sync_status'];
67
  }
68
  }
69
- /*if(isset($google_detail['prod_sync_list'])){
70
- if ($google_detail['prod_sync_list']) {
71
- $syncProductList = $google_detail['prod_sync_list'];
72
- }
73
- }*/
74
  $syncProductList = $this->TVC_Admin_DB_Helper->tvc_get_results("ee_products_sync_list");
75
  if(isset($google_detail['setting'])){
76
  if ($google_detail['setting']) {
@@ -132,87 +113,87 @@ public function create_form(){
132
  $sync_product_pending = (property_exists($syncProductStat,"pending")) ? $syncProductStat->pending : "0"; ?>
133
  <div class="product-card">
134
  <div class="row row-cols-5">
135
- <div class="col">
136
- <div class="card">
137
- <h3 class="pro-count"><?php
138
- echo (($woo_product) ? $woo_product : "0"); ?></h3>
139
- <p class="pro-title">Total Products</p>
140
- </div>
141
  </div>
142
- <div class="col">
143
- <div class="card">
144
- <h3 class="pro-count"><?php
145
- echo $sync_product_total ; ?></h3>
146
- <p class="pro-title">Sync Products</p>
147
- </div>
148
  </div>
149
- <div class="col">
150
- <div class="card pending">
151
- <h3 class="pro-count">
152
- <?php echo $sync_product_pending;?></h3>
153
- <p class="pro-title">Pending Review</p>
154
- </div>
155
  </div>
156
- <div class="col">
157
- <div class="card approved">
158
- <h3 class="pro-count"><?php echo $sync_product_approved;?></h3>
159
- <p class="pro-title">Approved</p>
160
- </div>
161
  </div>
162
- <div class="col">
163
- <div class="card disapproved">
164
- <h3 class="pro-count"><?php
165
- echo $sync_product_disapproved; ?></h3>
166
- <p class="pro-title">Disapproved</p>
167
- </div>
168
  </div>
 
169
  </div>
170
  </div>
171
  <div class="total-products">
172
- <div class="account-performance tvc-sync-product-list-wapper">
173
- <div class="table-section">
174
- <div class="table-responsive">
175
- <table id="tvc-sync-product-list" class="table table-striped" style="width:100%">
176
- <thead>
177
- <tr>
178
- <th></th>
179
- <th style="vertical-align: top;">Product</th>
180
- <th style="vertical-align: top;">Google status</th>
181
- <th style="vertical-align: top;">Issues</th>
182
- </tr>
183
- </thead>
184
- <tbody>
185
- <?php
186
- if (isset($syncProductList) && count($syncProductList) > 0) {
187
- foreach ($syncProductList as $skey => $sValue) {
188
- echo '<tr><td class="product-image">
189
- <img src="'.$sValue->image_link.'" alt=""/></td>
190
- <td>'.$sValue->name.'</td>
191
- <td>'.$sValue->google_status.'</td>
192
- <td>';
193
- $p_issues = json_decode($sValue->issues);
194
- if (count($p_issues) > 0) {
195
- $str = '';
196
- foreach ($p_issues as $key => $issue) {
197
- if ($key <= 2) {
198
- ($key <= 1) ? $str .= $issue.", <br>" : "";
199
- }
200
- ($key == 3) ? $str .= "..." : "";
201
- }
202
- echo $str;
203
- } else {
204
- echo "---";
205
- }
206
- echo '</td></tr>';
207
- }
208
- }else{
209
- echo '<tr><td colspan="4">Record not found</td></tr>';
210
- } ?>
211
- </tbody>
212
- </table>
213
- </div>
214
  </div>
215
  </div>
 
216
 
217
  </div>
218
  </div>
@@ -225,109 +206,9 @@ public function create_form(){
225
  </div>
226
  </div>
227
  </div>
228
-
229
- <div class="modal fade popup-modal create-campa overlay" id="syncProduct" data-backdrop="false">
230
- <div class="modal-dialog modal-dialog-centered">
231
- <div class="modal-content">
232
- <div class="modal-body">
233
- <button type="button" class="close tvc-popup-close" data-dismiss="modal"> &times; </button>
234
- <h5>Map your product attributes</h5>
235
- <p>Google Merchant Center uses attributes to format your product information for Shopping Ads. Map your product attributes to the Merchant Center product attributes below. You can also edit each product’s individual attributes after you sync your products. Not all fields below are marked required, however based on your shop's categories and your country you might map a few optional attributes as well. See the full guide <a target="_blank" href="https://support.google.com/merchants/answer/7052112">here</a>.
236
- </p>
237
- <div class="wizard-section campaign-wizard">
238
- <div class="wizard-content">
239
- <input type="hidden" name="merchant_id" id="merchant_id" value="<?php echo $this->merchantId; ?>">
240
- <form class="tab-wizard wizard- wizard" id="productSync" method="POST">
241
- <h5><span class="wiz-title">Category Mapping</span></h5>
242
- <section>
243
- <div class="card-wrapper">
244
- <div class="row">
245
- <div class="col-6">
246
- <h6 class="heading-tbl">WooCommerce Category</h6>
247
- </div>
248
- <div class="col-6">
249
- <h6 class="heading-tbl">Google Merchant Center Category</h6>
250
- </div>
251
- </div><?php echo $category_wrapper; ?>
252
- </div>
253
- </section>
254
- <!-- Step 2 -->
255
- <h5><span class="wiz-title">Product Attribution Mapping</span></h5>
256
- <section>
257
- <div class="card-wrapper">
258
- <div class="row">
259
- <div class="col-6">
260
- <h6 class="heading-tbl">Google Merchant center product attributes</h6>
261
- </div>
262
- <div class="col-6">
263
- <h6 class="heading-tbl">WooCommerce product attributes</h6>
264
- </div>
265
- </div>
266
- <?php
267
- $ee_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
268
- $wooCommerceAttributes = $this->wooCommerceAttributes();
269
- foreach ($this->TVC_Admin_Helper->get_gmcAttributes() as $key => $attribute) {
270
- $sel_val="";
271
- echo '<div class="row">
272
- <div class="col-6 align-self-center">
273
- <div class="form-group">
274
- <span class="td-head">' . $attribute["field"] . " " . (isset($attribute["required"]) && $attribute["required"] == 1 ? '<span style="color: red;"> *</span>' : "") . '
275
- <div class="tvc-tooltip">
276
- <span class="tvc-tooltiptext tvc-tooltip-right">'.(isset($attribute["desc"])? $attribute["desc"]:"") .'</span>
277
- <img src="'. ENHANCAD_PLUGIN_URL.'/admin/images/icon/informationI.svg" alt=""/>
278
- </div>
279
- </span>
280
- </div>
281
- </div>
282
- <div class="col-6 align-self-center">
283
- <div class="form-group">';
284
- $tvc_select_option = $wooCommerceAttributes;
285
- $require = (isset($attribute['required']) && $attribute['required'])?true:false;
286
- $sel_val_def = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
287
- if($attribute["field"]=='link'){
288
- echo "product link";
289
- }else if($attribute["field"]=='shipping'){
290
- //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
291
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
292
- echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
293
- }else if($attribute["field"]=='tax'){
294
- //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
295
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
296
- echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
297
- }else if($attribute["field"]=='content_language'){
298
- echo $this->TVC_Admin_Helper->tvc_language_select($attribute["field"], 'content_language', 'Please Select Attribute', 'en',$require);
299
- }else if($attribute["field"]=='target_country'){
300
- //$name, $class_id, bool $require = false
301
- echo $this->TVC_Admin_Helper->tvc_countries_select($attribute["field"], 'target_country', 'Please Select Attribute', $require);
302
- }else{
303
- if(isset($attribute['fixed_options']) && $attribute['fixed_options'] !=""){
304
- $tvc_select_option_t = explode(",", $attribute['fixed_options']);
305
- $tvc_select_option=[];
306
- foreach( $tvc_select_option_t as $o_val ){
307
- $tvc_select_option[]['field'] = $o_val;
308
- }
309
- $sel_val = $sel_val_def;
310
- $this->TVC_Admin_Helper->tvc_select($attribute["field"],$attribute["field"],'Please Select Attribute', $sel_val, $require, $tvc_select_option);
311
- }else{
312
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
313
- //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
314
- $this->TVC_Admin_Helper->tvc_select($attribute["field"],$attribute["field"],'Please Select Attribute', $sel_val, $require, $tvc_select_option);
315
- }
316
- }
317
- echo '</div>
318
- </div>
319
- </div>';
320
- }?>
321
- </div>
322
- </section>
323
- </form>
324
- </div>
325
- </div>
326
- </div>
327
- </div>
328
- </div>
329
- </div>
330
- <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
331
  $is_need_to_domain_claim = false;
332
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
333
  $is_need_to_domain_claim = true;
@@ -343,7 +224,6 @@ $(document).ready(function() {
343
  //auto syncup call
344
  var is_need_to_update = "<?php echo $is_need_to_update; ?>";
345
  if(is_need_to_update == 1 || is_need_to_update == true){
346
- //tvc_helper.tvc_alert("error","Attention !","Auto-sync up is in the process do not refresh the page.");
347
  call_tvc_api_sync_up();
348
  }
349
  //custom call for domain clain while product sync call
@@ -380,229 +260,6 @@ function call_tvc_api_sync_up(){
380
  }
381
  setTimeout(function(){ location.reload();}, 2000);
382
  });
383
- }
384
-
385
- $(document).ready(function() {
386
- $(".select2").select2();
387
- });
388
- $(".tab-wizard").steps({
389
- headerTag: "h5",
390
- bodyTag: "section",
391
- transitionEffect: "fade",
392
- titleTemplate: '<span class="step">#index#</span> #title#',
393
- labels: {
394
- finish: "Sync Products",
395
- next: "Next",
396
- previous: "Previous",
397
- },
398
- onStepChanging: function(e, currentIndex, newIndex) {
399
- var shop_categories = JSON.parse("<?php echo $shop_categories_list; ?>");
400
- var is_tvc_cat_selecte = false;
401
- shop_categories.forEach(function(v,i){
402
- if(is_tvc_cat_selecte == false && $("#category-"+v).val() != "" && $("#category-"+v).val() != 0){
403
- is_tvc_cat_selecte =true;
404
- return false;
405
- }
406
- });
407
- if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
408
- return true;
409
- }else{
410
- tvc_helper.tvc_alert("error","","Select at least one Google Merchant Center Category.",true);
411
- return false;
412
- }
413
- },
414
- onStepChanged: function(event, currentIndex, priorIndex) {
415
- $('.steps .current').prevAll().addClass('disabled');
416
- },
417
- onFinished: function(event, currentIndex) {
418
- var valid=true;
419
- jQuery(".field-required").each(function() {
420
- if($(this).val()==0 && valid){
421
- valid=false;
422
- $(this).select2('focus');
423
- }
424
- });
425
- if(!valid){
426
- tvc_helper.tvc_alert("error","","Please select all required fields");
427
- }else{
428
- submitProductSyncUp();
429
- }//check for required fields end
430
- }
431
- });
432
-
433
- function submitProductSyncUp() {
434
- var merchantId = '<?php echo $this->merchantId; ?>';
435
- var accountId = '<?php echo $this->accountId; ?>';
436
- var customerId = '<?php echo $this->currentCustomerId; ?>';
437
- var subscriptionId = '<?php echo $this->subscriptionId; ?>';
438
- var formData = jQuery("#productSync").serialize();
439
- //console.log(formData);
440
- jQuery("#feed-spinner").css("display", "block");
441
- jQuery.post(
442
- myAjaxNonces.ajaxurl,
443
- {
444
- action: "tvcajax-product-syncup",
445
- merchantId: merchantId,
446
- customerId: customerId,
447
- accountId: accountId,
448
- subscriptionId: subscriptionId,
449
- data: formData,
450
- productSyncupNonce: myAjaxNonces.productSyncupNonce
451
- },
452
- function( response ) {
453
- jQuery("#feed-spinner").css("display", "none");
454
- //console.log(response);
455
- var rsp = JSON.parse(response);
456
- if (rsp.status == "success") {
457
- $('#syncProduct').modal('hide');
458
- var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
459
- if (rsp.skipProducts > 0) {
460
- message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
461
- }
462
- tvc_helper.tvc_alert("success","",message);
463
- setTimeout(function(){
464
- window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
465
- }, 7000);
466
- } else {
467
- tvc_helper.tvc_alert("error","",rsp.message);
468
- }
469
- }
470
- );
471
- }
472
-
473
- $(document).on("show.bs.modal", "#syncProduct", function (e) {
474
- jQuery("#feed-spinner").css("display", "block");
475
- selectCategory();
476
- $("select[id^=catmap]").each(function(){
477
- removeChildCategory($(this).attr("id"))
478
- });
479
- });
480
-
481
- function selectCategory() {
482
- var country_id = "<?php echo $this->country; ?>";
483
- var customer_id = '<?php echo $this->currentCustomerId?>';
484
- var parent = "";
485
- jQuery.post(
486
- myAjaxNonces.ajaxurl,
487
- {
488
- action: "tvcajax-gmc-category-lists",
489
- countryCode: country_id,
490
- customerId: customer_id,
491
- parent: parent,
492
- gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
493
- },
494
- function( response ) {
495
- var categories = JSON.parse(response);
496
- var obj;
497
- $("select[id^=catmap]").each(function(){
498
- obj = $("#catmap-"+$(this).attr("catid")+"_0");
499
- obj.empty();
500
- obj.append("<option id='0' value='0' resourcename='0'>Select a category</option>");
501
- $.each(categories, function (i, value) {
502
- obj.append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
503
- });
504
- });
505
- jQuery("#feed-spinner").css("display", "none");
506
- });
507
- }
508
-
509
- function selectSubCategory(thisObj) {
510
- var selectId;
511
- var wooCategoryId;
512
- var GmcCategoryId;
513
- var GmcParent;
514
- selectId = thisObj.id;
515
- wooCategoryId = $(thisObj).attr("catid");
516
- GmcCategoryId = $(thisObj).find(":selected").val();
517
- GmcParent = $(thisObj).find(":selected").attr("resourcename");
518
- //$("#"+selectId).select2().find(":selected").val();
519
- // $("#"+selectId).select2().find(":selected").data("id");
520
- //console.log(selectId+"--"+wooCategoryId+"--"+GmcCategoryId+"--"+GmcParent);
521
-
522
- jQuery("#feed-spinner").css("display", "block");
523
- removeChildCategory(selectId);
524
- selectChildCategoryValue(wooCategoryId);
525
- if (GmcParent != undefined) {
526
- var country_id = "<?php echo $this->country; ?>";
527
- var customer_id = '<?php echo $this->currentCustomerId?>';
528
- jQuery.post(
529
- myAjaxNonces.ajaxurl,
530
- {
531
- action: "tvcajax-gmc-category-lists",
532
- countryCode: country_id,
533
- customerId: customer_id,
534
- parent: GmcParent,
535
- gmcCategoryListsNonce: myAjaxNonces.gmcCategoryListsNonce
536
- },
537
- function( response ) {
538
- var categories = JSON.parse(response);
539
- var newId;
540
- var slitedId = selectId.split("_");
541
- newId = slitedId[0]+"_"+ ++slitedId[1];
542
- if(categories.length === 0){
543
- }else{
544
- //console.log(newId);
545
- $("#"+newId).empty();
546
- $("#"+newId).append("<option id='0' value='0' resourcename='0'>Select a sub-category</option>");
547
- $.each(categories, function (i, value) {
548
- $("#"+newId).append("<option id=" + JSON.stringify(value.id) + " value=" + JSON.stringify(value.id) + " resourceName=" + JSON.stringify(value.resourceName) + ">" + value.name + "</option>");
549
- });
550
- $("#"+newId).addClass("form-control");
551
- //$("#"+newId).select2();
552
- $("#"+newId).css("display", "block");
553
- }
554
- jQuery("#feed-spinner").css("display", "none");
555
- }
556
- );
557
- }
558
- }
559
-
560
- function removeChildCategory(currentId){
561
- var currentSplit = currentId.split("_");
562
- var childEleId;
563
- for (i = ++currentSplit[1]; i < 6; i++) {
564
- childEleId = currentSplit[0]+"_"+ i;
565
- //console.log($("#"+childEleId));
566
- $("#"+childEleId).empty();
567
- $("#"+childEleId).removeClass("form-control");
568
- $("#"+childEleId).css("display", "none");
569
- if ($("#"+childEleId).data("select2")) {
570
- $("#"+childEleId).off("select2:select");
571
- $("#"+childEleId).select2("destroy");
572
- $("#"+childEleId).removeClass("select2");
573
- }
574
- }
575
- }
576
-
577
- function selectChildCategoryValue(wooCategoryId){
578
- var childCatvala;
579
- for(i = 0; i < 6; i++){
580
- childCatvala = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").attr("id");
581
- childCatname = $("#catmap-"+wooCategoryId+"_"+i).find(":selected").text();
582
- if($("#catmap-"+wooCategoryId+"_"+0).find(":selected").attr("id") <= 0){
583
- $("#category-"+wooCategoryId).val(0);
584
- }else{
585
- if(childCatvala > 0){
586
- $("#category-"+wooCategoryId).val(childCatvala);
587
- $("#category-name-"+wooCategoryId).val(childCatname);
588
- }
589
- }
590
- }
591
- }
592
- $( ".wizard-content" ).on( "click", ".change_prodct_feed_cat", function() {
593
- // console.log( $( this ).attr("data-id") );
594
- $(this).hide();
595
- var feed_select_cat_id = $( this ).attr("data-id");
596
- var woo_cat_id = $( this ).attr("data-cat-id");
597
-
598
- jQuery("#category-"+woo_cat_id).val("0");
599
- jQuery("#category-name-"+woo_cat_id).val("");
600
- jQuery("#label-"+feed_select_cat_id).hide();
601
- jQuery("#"+feed_select_cat_id).slideDown();
602
- });
603
- function changeProdctFeedCat(feed_select_cat_id){
604
- jQuery("#label-"+feed_select_cat_id).hide();
605
- jQuery("#"+feed_select_cat_id).slideDown();
606
  }
607
  </script>
608
  <?php
1
  <?php
2
+
3
  class SyncProductConfiguration
4
  {
 
5
  protected $TVC_Admin_Helper;
 
6
  protected $subscriptionId;
 
7
  protected $TVC_Admin_DB_Helper;
8
+ protected $TVCProductSyncHelper;
9
  public function __construct(){
10
+ $this->includes();
11
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
12
  $this->TVC_Admin_DB_Helper = new TVC_Admin_DB_Helper();
13
+ $this->TVCProductSyncHelper = new TVCProductSyncHelper();
14
+ $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
 
 
 
15
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
16
  $this->TVC_Admin_Helper->need_auto_update_db();
17
  $this->html_run();
18
  }
 
19
  public function includes(){
20
+ if (!class_exists('TVCProductSyncHelper')) {
21
+ require_once(__DIR__ . '/class-tvc-product-sync-helper.php');
22
  }
23
  }
 
24
  public function html_run(){
25
  $this->TVC_Admin_Helper->add_spinner_html();
26
  $this->create_form();
27
  }
28
 
 
 
 
 
 
 
 
 
29
  public function create_form(){
30
  if(isset($_GET['welcome_msg']) && $_GET['welcome_msg'] == true){
31
  $this->TVC_Admin_Helper->call_domain_claim();
41
  </script>
42
  <?php
43
  }
44
+
 
45
  $syncProductStat = [];
46
  $syncProductList = [];
47
  $last_api_sync_up ="";
51
  $syncProductStat = $google_detail['prod_sync_status'];
52
  }
53
  }
54
+
 
 
 
 
55
  $syncProductList = $this->TVC_Admin_DB_Helper->tvc_get_results("ee_products_sync_list");
56
  if(isset($google_detail['setting'])){
57
  if ($google_detail['setting']) {
113
  $sync_product_pending = (property_exists($syncProductStat,"pending")) ? $syncProductStat->pending : "0"; ?>
114
  <div class="product-card">
115
  <div class="row row-cols-5">
116
+ <div class="col">
117
+ <div class="card">
118
+ <h3 class="pro-count"><?php
119
+ echo (($woo_product) ? $woo_product : "0"); ?></h3>
120
+ <p class="pro-title">Total Products</p>
 
121
  </div>
122
+ </div>
123
+ <div class="col">
124
+ <div class="card">
125
+ <h3 class="pro-count"><?php
126
+ echo $sync_product_total ; ?></h3>
127
+ <p class="pro-title">Sync Products</p>
128
  </div>
129
+ </div>
130
+ <div class="col">
131
+ <div class="card pending">
132
+ <h3 class="pro-count">
133
+ <?php echo $sync_product_pending;?></h3>
134
+ <p class="pro-title">Pending Review</p>
135
  </div>
136
+ </div>
137
+ <div class="col">
138
+ <div class="card approved">
139
+ <h3 class="pro-count"><?php echo $sync_product_approved;?></h3>
140
+ <p class="pro-title">Approved</p>
141
  </div>
142
+ </div>
143
+ <div class="col">
144
+ <div class="card disapproved">
145
+ <h3 class="pro-count"><?php
146
+ echo $sync_product_disapproved; ?></h3>
147
+ <p class="pro-title">Disapproved</p>
148
  </div>
149
+ </div>
150
  </div>
151
  </div>
152
  <div class="total-products">
153
+ <div class="account-performance tvc-sync-product-list-wapper">
154
+ <div class="table-section">
155
+ <div class="table-responsive">
156
+ <table id="tvc-sync-product-list" class="table table-striped" style="width:100%">
157
+ <thead>
158
+ <tr>
159
+ <th></th>
160
+ <th style="vertical-align: top;">Product</th>
161
+ <th style="vertical-align: top;">Google status</th>
162
+ <th style="vertical-align: top;">Issues</th>
163
+ </tr>
164
+ </thead>
165
+ <tbody>
166
+ <?php
167
+ if (isset($syncProductList) && count($syncProductList) > 0) {
168
+ foreach ($syncProductList as $skey => $sValue) {
169
+ echo '<tr><td class="product-image">
170
+ <img src="'.$sValue->image_link.'" alt=""/></td>
171
+ <td>'.$sValue->name.'</td>
172
+ <td>'.$sValue->google_status.'</td>
173
+ <td>';
174
+ $p_issues = json_decode($sValue->issues);
175
+ if (count($p_issues) > 0) {
176
+ $str = '';
177
+ foreach ($p_issues as $key => $issue) {
178
+ if ($key <= 2) {
179
+ ($key <= 1) ? $str .= $issue.", <br>" : "";
180
+ }
181
+ ($key == 3) ? $str .= "..." : "";
182
+ }
183
+ echo $str;
184
+ } else {
185
+ echo "---";
186
+ }
187
+ echo '</td></tr>';
188
+ }
189
+ }else{
190
+ echo '<tr><td colspan="4">Record not found</td></tr>';
191
+ } ?>
192
+ </tbody>
193
+ </table>
 
194
  </div>
195
  </div>
196
+ </div>
197
 
198
  </div>
199
  </div>
206
  </div>
207
  </div>
208
  </div>
209
+ <?php
210
+ // add product sync popup
211
+ echo $this->TVCProductSyncHelper->tvc_product_sync_popup_html();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  $is_need_to_domain_claim = false;
213
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
214
  $is_need_to_domain_claim = true;
224
  //auto syncup call
225
  var is_need_to_update = "<?php echo $is_need_to_update; ?>";
226
  if(is_need_to_update == 1 || is_need_to_update == true){
 
227
  call_tvc_api_sync_up();
228
  }
229
  //custom call for domain clain while product sync call
260
  }
261
  setTimeout(function(){ location.reload();}, 2000);
262
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
263
  }
264
  </script>
265
  <?php
includes/setup/google-shopping-feed.php CHANGED
@@ -98,7 +98,8 @@ class GoogleShoppingFeed {
98
  $campaignActive = $campaignActive + $campaign->active;
99
  }
100
  $campaignClicks = $campaignClicks + $campaign->clicks;
101
- $campaignCost = $campaignCost + $campaign->cost;
 
102
  $campaignConversions = $campaignConversions + $campaign->conversions;
103
  $campaignSales = $campaignSales + $campaign->sales;
104
  }
98
  $campaignActive = $campaignActive + $campaign->active;
99
  }
100
  $campaignClicks = $campaignClicks + $campaign->clicks;
101
+ $row_campaign_cost = ($campaign->cost);
102
+ $campaignCost = $campaignCost + $row_campaign_cost;
103
  $campaignConversions = $campaignConversions + $campaign->conversions;
104
  $campaignSales = $campaignSales + $campaign->sales;
105
  }
public/class-enhanced-ecommerce-google-analytics-public-pro.php CHANGED
@@ -61,6 +61,8 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
61
  protected $ga_DF;
62
  protected $tvc_options;
63
  protected $TVC_Admin_Helper;
 
 
64
  /**
65
  * Enhanced_Ecommerce_Google_Analytics_Public constructor.
66
  * @param $plugin_name
@@ -71,6 +73,8 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
71
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
72
  $this->plugin_name = $plugin_name;
73
  $this->version = $version;
 
 
74
  $this->ga_Dname = "auto";
75
  $this->tvc_aga = $this->get_option("tvc_aga");
76
  $this->ga_id = $this->get_option("ga_id");
@@ -97,8 +101,12 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
97
  $this->ads_tracking_id = get_option('ads_tracking_id');
98
  $this->ads_ert = get_option('ads_ert');
99
  $this->ads_edrt = get_option('ads_edrt');
100
- //$this->subscription_id = $this->get_option("subscription_id");
101
- //setcookie('subscription_id', $this->subscription_id);
 
 
 
 
102
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
103
  // Put your plugin code here
104
  add_action('woocommerce_init' , function (){
@@ -139,7 +147,9 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
139
  "page_type"=>$this->add_page_type(),
140
  "user_id"=>$user_id,
141
  "user_type"=>$user_type,
142
- "day_type"=>$this->add_day_type()
 
 
143
  );
144
  /*
145
  * end tvc_options
@@ -148,6 +158,37 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
148
  } // end if woocommerce
149
  }
150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  public function getAttributesVariation($product) {
152
  //variations start
153
  if ($product->get_type() === "variable" || $product->get_type() === "variation") {
@@ -504,9 +545,8 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
504
  }
505
  //add remarketing snippets
506
  if($this->ads_tracking_id && ($this->ads_ert || $this->ads_edrt)){
507
- $remarketing = unserialize(get_option('ee_remarketing_snippets'));
508
- if(!empty($remarketing) && isset($remarketing['snippets']) && $remarketing['snippets']){
509
- echo base64_decode($remarketing['snippets']);
510
  }else{
511
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
512
  if(isset($google_detail['setting'])){
@@ -527,7 +567,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
527
  function ecommerce_tracking_code($order_id) {
528
  global $woocommerce;
529
  if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1){
530
- // return;
531
  }
532
  // Doing eCommerce tracking so unhook standard tracking from the footer
533
  remove_action("wp_footer", array($this, "ee_settings"));
@@ -568,15 +608,21 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
568
  }
569
  }
570
  $categories=esc_js(join(",", $out));
571
- if($_product->product_type === "variation"){
 
 
 
 
 
 
572
  $attributes=esc_js(wc_get_formatted_variation($_product->get_variation_attributes(), true));
573
- if ($_product->variation_has_weight) {
574
  //$p_weight = $_product->get_weight().' '.esc_attr(get_option('woocommerce_weight_unit'));
575
- }
576
- }elseif ($_product->product_type === 'simple') {
577
- if ($_product->has_weight()) {
578
  //$p_weight = $_product->get_weight().' '.esc_attr(get_option('woocommerce_weight_unit'));
579
- }
580
  }
581
  if (version_compare($woocommerce->version, "2.7", "<")) {
582
  $orderpage_prod_Array[get_permalink($_product->ID)]=array(
@@ -683,17 +729,26 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
683
  * @return void
684
  */
685
  function add_to_cart() {
686
- if ($this->disable_tracking($this->ga_eeT))
687
  return;
 
688
  //return if not product page
689
- if (!is_single())
690
  return;
 
 
 
 
 
 
 
 
691
  ?>
692
  <script>
693
  window.addEventListener('load', call_tvc_enhanced,true);
694
  function call_tvc_enhanced(){
695
  tvc_js = new TVC_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
696
- tvc_js.addToCartEventBindings();
697
  }
698
  </script>
699
  <?php
@@ -725,6 +780,7 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
725
  $categories = rtrim($categories, ",");
726
  //product detail view json
727
  $prodpage_detail_json = array();
 
728
  if(version_compare($woocommerce->version, "2.7", "<")){
729
  $prodpage_detail_json = array(
730
  "tvc_id" => esc_html($product->id),
@@ -747,9 +803,9 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
747
  "tvc_n" => $product->get_title(),
748
  "tvc_c" => $categories,
749
  "tvc_p" => $product->get_price(),
750
- "tvc_pd" => $this->cal_prod_discount($product->regular_price, $product->sale_price),
751
  "tvc_ps" => $product->get_stock_status(),
752
- "tvc_tst" => $product->get_total_stock(),
753
  "tvc_q" => esc_html($product->get_stock_quantity()),
754
  "tvc_var" => $this->getAttributesVariation($product),
755
  "is_featured" => $product->is_featured(),
@@ -763,76 +819,10 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
763
  window.addEventListener('load', call_view_item_pdp,true);
764
  function call_view_item_pdp(){
765
  tvc_js = new TVC_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
766
- tvc_js.view_item_pdp();
767
  }
768
  </script>
769
- <?php
770
- /*if($this->ga_id || $this->tracking_option == "UA" || $this->tracking_option == "BOTH") {
771
- $code = '
772
- gtag("event", "view_item", {
773
- "event_category":"Enhanced-Ecommerce",
774
- "event_label":"product_impression_pp",
775
- "items": [
776
- {
777
- "id": tvc_po.tvc_i,// Product details are provided in an impressionFieldObject.
778
- "name": tvc_po.tvc_n,
779
- "category":tvc_po.tvc_c,
780
- }
781
- ],
782
- "non_interaction": true
783
- })
784
- //add remarketing and dynamicremarketing tags
785
- if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
786
- gtag("event","view_item", {
787
- "value": tvc_po.tvc_p,
788
- "items": [
789
- {
790
- "id": tvc_po.tvc_id,
791
- "google_business_vertical": "retail"
792
- }
793
- ]
794
- });
795
- }
796
- ';
797
- //check woocommerce version
798
- if(is_product()){
799
- $this->wc_version_compare($code);
800
- }
801
- }
802
-
803
- if( $this->gm_id && $this->tracking_option == "GA4") {
804
- $code = '
805
- gtag("event", "view_item", {
806
- "event_category":"Enhanced-Ecommerce",
807
- "event_label":"product_impression_pp",
808
- "currency": tvc_lc,
809
- "items": [
810
- {
811
- "item_id": tvc_po.tvc_i,
812
- "item_name": tvc_po.tvc_n,
813
- "item_category":tvc_po.tvc_c,
814
- }
815
- ],
816
- "non_interaction": true
817
- })
818
- //add remarketing and dynamicremarketing tags
819
- if(adsTringId != "" && ( ads_ert == 1 || ads_edrt == 1)){
820
- gtag("event","view_item", {
821
- "value": tvc_po.tvc_p,
822
- "items": [
823
- {
824
- "id": tvc_po.tvc_id,
825
- "google_business_vertical": "retail"
826
- }
827
- ]
828
- });
829
- }
830
- ';
831
- //check woocommerce version
832
- if (is_product()) {
833
- $this->wc_version_compare($code);
834
- }
835
- }*/
836
  }
837
 
838
  /**
61
  protected $ga_DF;
62
  protected $tvc_options;
63
  protected $TVC_Admin_Helper;
64
+ protected $remarketing_snippet_id;
65
+ protected $remarketing_snippets;
66
  /**
67
  * Enhanced_Ecommerce_Google_Analytics_Public constructor.
68
  * @param $plugin_name
73
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
74
  $this->plugin_name = $plugin_name;
75
  $this->version = $version;
76
+ $this->tvc_call_hooks();
77
+
78
  $this->ga_Dname = "auto";
79
  $this->tvc_aga = $this->get_option("tvc_aga");
80
  $this->ga_id = $this->get_option("ga_id");
101
  $this->ads_tracking_id = get_option('ads_tracking_id');
102
  $this->ads_ert = get_option('ads_ert');
103
  $this->ads_edrt = get_option('ads_edrt');
104
+
105
+ $remarketing = unserialize(get_option('ee_remarketing_snippets'));
106
+ if(!empty($remarketing) && isset($remarketing['snippets']) && $remarketing['snippets']){
107
+ $this->remarketing_snippets = base64_decode($remarketing['snippets']);
108
+ $this->remarketing_snippet_id = isset($remarketing['id'])?$remarketing['id']:"";
109
+ }
110
  if ( in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) ) {
111
  // Put your plugin code here
112
  add_action('woocommerce_init' , function (){
147
  "page_type"=>$this->add_page_type(),
148
  "user_id"=>$user_id,
149
  "user_type"=>$user_type,
150
+ "day_type"=>$this->add_day_type(),
151
+ "remarketing_snippet_id"=>$this->remarketing_snippet_id,
152
+ "tvc_ajax_url"=>admin_url( 'admin-ajax.php' )
153
  );
154
  /*
155
  * end tvc_options
158
  } // end if woocommerce
159
  }
160
 
161
+ public function tvc_call_hooks(){
162
+ add_action("wp_head", array($this, "enqueue_scripts"));
163
+ add_action("wp_head", array($this, "ee_settings"));
164
+ add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
165
+
166
+ add_action("wp_footer", array($this, "t_products_impre_clicks"));
167
+ add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
168
+ add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
169
+ add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
170
+ add_action("woocommerce_after_cart",array($this, "remove_cart_tracking"));
171
+ //check out step 1,2,3
172
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
173
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
174
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
175
+ add_action("woocommerce_after_add_to_cart_button", array($this, "add_to_cart"));
176
+ //add version details in footer
177
+ add_action("wp_footer", array($this, "add_plugin_details"));
178
+ //Add Dev ID
179
+ add_action("wp_head", array($this, "add_dev_id"));
180
+ add_action("wp_footer",array($this, "tvc_store_meta_data"));
181
+
182
+ add_action('wp_ajax_get_variation_data', array($this,'get_variation_data') );
183
+ add_action("wp_ajax_nopriv_get_variation_data" , "get_variation_data");
184
+ }
185
+
186
+ public function get_variation_data(){
187
+ $data = array('error' => true,'order_result' => "this is test");
188
+ echo wp_send_json($data);
189
+ wp_die();
190
+ }
191
+
192
  public function getAttributesVariation($product) {
193
  //variations start
194
  if ($product->get_type() === "variable" || $product->get_type() === "variation") {
545
  }
546
  //add remarketing snippets
547
  if($this->ads_tracking_id && ($this->ads_ert || $this->ads_edrt)){
548
+ if(!empty($this->remarketing_snippets) && $this->remarketing_snippets){
549
+ echo $this->remarketing_snippets;
 
550
  }else{
551
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
552
  if(isset($google_detail['setting'])){
567
  function ecommerce_tracking_code($order_id) {
568
  global $woocommerce;
569
  if ($this->disable_tracking($this->ga_eeT) || current_user_can("manage_options") || get_post_meta($order_id, "_tracked", true) == 1){
570
+ return;
571
  }
572
  // Doing eCommerce tracking so unhook standard tracking from the footer
573
  remove_action("wp_footer", array($this, "ee_settings"));
608
  }
609
  }
610
  $categories=esc_js(join(",", $out));
611
+ $product_type = "";
612
+ if (version_compare($woocommerce->version, "2.7", "<")) {
613
+ $product_type = $_product->product_type;
614
+ }else{
615
+ $product_type =$_product->get_type();
616
+ }
617
+ if($product_type == "variation"){
618
  $attributes=esc_js(wc_get_formatted_variation($_product->get_variation_attributes(), true));
619
+ /*if ($_product->variation_has_weight) {
620
  //$p_weight = $_product->get_weight().' '.esc_attr(get_option('woocommerce_weight_unit'));
621
+ }*/
622
+ }elseif ($product_type == 'simple') {
623
+ /*if ($_product->has_weight()) {
624
  //$p_weight = $_product->get_weight().' '.esc_attr(get_option('woocommerce_weight_unit'));
625
+ }*/
626
  }
627
  if (version_compare($woocommerce->version, "2.7", "<")) {
628
  $orderpage_prod_Array[get_permalink($_product->ID)]=array(
729
  * @return void
730
  */
731
  function add_to_cart() {
732
+ if ($this->disable_tracking($this->ga_eeT)){
733
  return;
734
+ }
735
  //return if not product page
736
+ if (!is_single()){
737
  return;
738
+ }
739
+ global $product,$woocommerce;
740
+ $variations_data = array();
741
+ if ( $product->is_type('variable') ) {
742
+ $variations_data['default_attributes'] = $product->get_default_attributes();
743
+ $variations_data['available_variations'] = $product->get_available_variations(); //get all child variations
744
+ $variations_data['available_attributes'] = $product->get_variation_attributes();
745
+ }
746
  ?>
747
  <script>
748
  window.addEventListener('load', call_tvc_enhanced,true);
749
  function call_tvc_enhanced(){
750
  tvc_js = new TVC_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
751
+ tvc_js.singleProductaddToCartEventBindings(<?php echo json_encode($variations_data); ?>);
752
  }
753
  </script>
754
  <?php
780
  $categories = rtrim($categories, ",");
781
  //product detail view json
782
  $prodpage_detail_json = array();
783
+
784
  if(version_compare($woocommerce->version, "2.7", "<")){
785
  $prodpage_detail_json = array(
786
  "tvc_id" => esc_html($product->id),
803
  "tvc_n" => $product->get_title(),
804
  "tvc_c" => $categories,
805
  "tvc_p" => $product->get_price(),
806
+ "tvc_pd" => $this->cal_prod_discount($product->get_regular_price(), $product->get_sale_price()),
807
  "tvc_ps" => $product->get_stock_status(),
808
+ "tvc_tst" => $product->get_stock_quantity(),
809
  "tvc_q" => esc_html($product->get_stock_quantity()),
810
  "tvc_var" => $this->getAttributesVariation($product),
811
  "is_featured" => $product->is_featured(),
819
  window.addEventListener('load', call_view_item_pdp,true);
820
  function call_view_item_pdp(){
821
  tvc_js = new TVC_Enhanced(<?php echo json_encode($this->tvc_options); ?>);
822
+ tvc_js.view_item_pdp(<?php echo json_encode($prodpage_detail_json); ?>);
823
  }
824
  </script>
825
+ <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
826
  }
827
 
828
  /**
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -114,9 +114,10 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
114
 
115
  public function __construct($plugin_name, $version) {
116
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
117
-
118
  $this->plugin_name = $plugin_name;
119
  $this->version = $version;
 
 
120
  $this->tvc_aga = $this->get_option("tvc_aga");
121
  $this->ga_id = $this->get_option("ga_id");
122
  $this->ga_eeT = $this->get_option("ga_eeT");
@@ -142,8 +143,6 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
142
  $this->ads_tracking_id = get_option('ads_tracking_id');
143
  $this->ads_ert = get_option('ads_ert');
144
  $this->ads_edrt = get_option('ads_edrt');
145
- //$this->subscription_id = $this->get_option("subscription_id");
146
- //setcookie('subscription_id', $this->subscription_id);
147
 
148
  $remarketing = unserialize(get_option('ee_remarketing_snippets'));
149
  if(!empty($remarketing) && isset($remarketing['snippets']) && $remarketing['snippets']){
@@ -159,15 +158,35 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
159
  });
160
  }
161
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  public function add_google_site_verification_tag(){
163
  $TVC_Admin_Helper = new TVC_Admin_Helper();
164
  $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
165
  if(isset($ee_additional_data['add_site_varification_tag']) && isset($ee_additional_data['site_varification_tag_val']) && $ee_additional_data['add_site_varification_tag'] == 1 && $ee_additional_data['site_varification_tag_val'] !="" ){
166
  echo base64_decode($ee_additional_data['site_varification_tag_val']);
167
- }
168
-
169
 
170
- }
171
  public function get_option($key){
172
  $ee_options = array();
173
  $my_option = get_option( 'ee_options' );
114
 
115
  public function __construct($plugin_name, $version) {
116
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
 
117
  $this->plugin_name = $plugin_name;
118
  $this->version = $version;
119
+ $this->tvc_call_hooks();
120
+
121
  $this->tvc_aga = $this->get_option("tvc_aga");
122
  $this->ga_id = $this->get_option("ga_id");
123
  $this->ga_eeT = $this->get_option("ga_eeT");
143
  $this->ads_tracking_id = get_option('ads_tracking_id');
144
  $this->ads_ert = get_option('ads_ert');
145
  $this->ads_edrt = get_option('ads_edrt');
 
 
146
 
147
  $remarketing = unserialize(get_option('ee_remarketing_snippets'));
148
  if(!empty($remarketing) && isset($remarketing['snippets']) && $remarketing['snippets']){
158
  });
159
  }
160
  }
161
+ public function tvc_call_hooks(){
162
+ add_action("wp_head", array($this, "enqueue_scripts"));
163
+ add_action("wp_head", array($this, "ee_settings"));
164
+ add_action("wp_head", array($this, "add_google_site_verification_tag"),1);
165
+
166
+ add_action("wp_footer", array($this, "t_products_impre_clicks"));
167
+ add_action("woocommerce_after_shop_loop_item", array($this, "bind_product_metadata"));
168
+ add_action("woocommerce_thankyou", array($this, "ecommerce_tracking_code"));
169
+ add_action("woocommerce_after_single_product", array($this, "product_detail_view"));
170
+ add_action("woocommerce_after_cart",array($this, "remove_cart_tracking"));
171
+ //check out step 1,2,3
172
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_1_tracking"));
173
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_2_tracking"));
174
+ add_action("woocommerce_before_checkout_form", array($this, "checkout_step_3_tracking"));
175
+ add_action("woocommerce_after_add_to_cart_button", array($this, "add_to_cart"));
176
+ //add version details in footer
177
+ add_action("wp_footer", array($this, "add_plugin_details"));
178
+ //Add Dev ID
179
+ add_action("wp_head", array($this, "add_dev_id"));
180
+ add_action("wp_footer",array($this, "tvc_store_meta_data"));
181
+ }
182
  public function add_google_site_verification_tag(){
183
  $TVC_Admin_Helper = new TVC_Admin_Helper();
184
  $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
185
  if(isset($ee_additional_data['add_site_varification_tag']) && isset($ee_additional_data['site_varification_tag_val']) && $ee_additional_data['add_site_varification_tag'] == 1 && $ee_additional_data['site_varification_tag_val'] !="" ){
186
  echo base64_decode($ee_additional_data['site_varification_tag_val']);
187
+ }
 
188
 
189
+ }
190
  public function get_option($key){
191
  $ee_options = array();
192
  $my_option = get_option( 'ee_options' );
public/js/tvc-ee-google-analytics.js CHANGED
@@ -30,14 +30,14 @@ class TVC_Enhanced {
30
  if(options){
31
  Object.assign(this.options, options);
32
  }
33
- console.log(this.options);
34
  //this.addEventBindings();
35
  }
36
- addToCartEventBindings(){
37
  // alert("call first");
38
  var single_btn = document.getElementsByClassName("single_add_to_cart_button");
39
  if(single_btn.length > 0){
40
- single_btn[0].addEventListener("click", () => this.add_to_cart_click());
41
  }
42
  }
43
  /*
@@ -53,19 +53,20 @@ class TVC_Enhanced {
53
  /*
54
  * check remarketing option
55
  */
56
- view_item_pdp(){
57
  if(this.options.is_admin == true){
58
  return;
59
  }
60
- //this.options.page_type="Product Page";
 
61
  /*
62
  * Start UA or GA4
63
  */
64
  if((this.options.tracking_option =="UA" || this.options.tracking_option == "BOTH") && this.options.property_id ){
65
  try {
66
  gtag("event", "view_item", {
67
- "event_category":"Enhanced-Ecommerce",
68
- "event_label":"view_item_"+tvc_po.tvc_n,
69
  "items": [{
70
  "id": tvc_po.tvc_i,// Product details are provided in an impressionFieldObject.
71
  "name": tvc_po.tvc_n,
@@ -80,7 +81,7 @@ class TVC_Enhanced {
80
  "page_type": this.options.page_type,
81
  "user_type": this.options.user_type,
82
  "user_id": this.options.user_id,
83
- "client_id":this.getClientId(),
84
  "day_type": this.options.day_type,
85
  "local_time_slot_of_the_day": this.options.local_time
86
  });
@@ -97,26 +98,27 @@ class TVC_Enhanced {
97
  }else if( this.options.tracking_option == "GA4" && this.options.measurement_id ){
98
  try {
99
  gtag("event", "view_item", {
100
- "event_category":"Enhanced-Ecommerce",
101
- "event_label":"view_item_"+tvc_po.tvc_n,
102
  "currency": tvc_lc,
103
  "items": [{
104
  "item_id": tvc_po.tvc_i,
105
  "item_name": tvc_po.tvc_n,
106
- "item_category":tvc_po.tvc_c,
107
  "discount": tvc_po.tvc_pd,
108
- "affiliation":this.options.affiliation,
109
  "item_variant": tvc_po.tvc_var,
110
  "price": tvc_po.tvc_p,
111
  "currency": tvc_lc,
112
- "quantity": tvc_po.tvc_q
 
113
  }],
114
  "non_interaction": true,
115
  "value": tvc_po.tvc_p * tvc_po.tvc_q,
116
  "page_type": this.options.page_type,
117
  "user_type": this.options.user_type,
118
  "user_id": this.options.user_id,
119
- "client_id":this.getClientId(),
120
  "day_type": this.options.day_type,
121
  "local_time_slot_of_the_day": this.options.local_time
122
  });
@@ -131,6 +133,8 @@ class TVC_Enhanced {
131
  //add remarketing and dynamicremarketing tags
132
  if(this.is_add_remarketing_tags()){
133
  gtag("event","view_item", {
 
 
134
  "value": tvc_po.tvc_p,
135
  "items": [{
136
  "id": tvc_po.tvc_id,
@@ -142,33 +146,70 @@ class TVC_Enhanced {
142
 
143
 
144
  }
145
- add_to_cart_click( ){
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
146
  if(this.options.is_admin == true){
147
  return;
148
  }
 
149
  var varPrice = tvc_po.tvc_p;
150
- var event_label="add_to_cart_";
151
- var selected_variants = "";
152
- //var var_s = document.getElementsByClassName("variations").getElementsByTagName("select");
153
- /*var selected_variants = $.map($(".variations select :selected"), function(a){
154
- return a.value;
155
- }).join(" | ");*/
156
- if(selected_variants != ""){
157
- event_label="add_to_cart_"+this.options.page_type+" | "+tvc_po.tvc_n+" | "+selected_variants;
158
- varPrice = jQuery("div.woocommerce-variation-price > span.price > ins >span.woocommerce-Price-amount").text().replace("$","");
159
- if (varPrice == "") {
160
- varPrice = jQuery("div.woocommerce-variation-price > span.price > .woocommerce-Price-amount").text().replace("$","");
 
 
 
161
  }
162
- console.log("variants");
 
 
 
 
 
 
 
 
 
 
163
  }else if (tvc_po.is_featured == true){
164
  event_label="add_to_cart_"+this.options.page_type+" | " + this.options.feature_product_label + " | "+tvc_po.tvc_n;
165
- console.log("is_featured");
166
  }else if (tvc_po.is_onSale == true){
167
  event_label="add_to_cart_"+this.options.page_type+" | " + this.options.on_sale_label + " | "+tvc_po.tvc_n;
168
- console.log("is_onSale");
169
  }else{
170
  event_label="add_to_cart_"+this.options.page_type+" | "+tvc_po.tvc_n;
171
- console.log(" - - ");
172
  }
173
  var lastCartTime = this.getCookie("time_add_to_cart");
174
  var curCartTime = this.getCurrentTime();
@@ -182,7 +223,7 @@ class TVC_Enhanced {
182
  try {
183
  gtag("event", "add_to_cart", {
184
  "event_category":"Enhanced-Ecommerce",
185
- "event_label":"add_to_cart_click",
186
  "non_interaction": true,
187
  "items": [{
188
  "id" : tvc_po.tvc_i,
@@ -192,7 +233,7 @@ class TVC_Enhanced {
192
  "quantity" :jQuery(this).parent().find("input[name=quantity]").val(),
193
  "list_name":this.options.page_type,
194
  "list_position": 1,
195
- "variant": tvc_po.tvc_var
196
  }],
197
  "page_type": this.options.page_type,
198
  "user_type": this.options.user_type,
@@ -228,7 +269,7 @@ class TVC_Enhanced {
228
  "price":varPrice,
229
  "currency": tvc_lc,
230
  "quantity": jQuery(this).parent().find("input[name=quantity]").val(),
231
- "item_variant": tvc_po.tvc_var,
232
  "discount": tvc_po.tvc_pd,
233
  "affiliation":this.options.affiliation
234
  }],
@@ -253,7 +294,9 @@ class TVC_Enhanced {
253
  //add remarketing and dynamicremarketing tags
254
  if(this.is_add_remarketing_tags()){
255
  gtag("event","add_to_cart", {
256
- "value": tvc_po.tvc_p,
 
 
257
  "items": [{
258
  "id": tvc_po.tvc_id,
259
  "google_business_vertical": "retail"
@@ -271,7 +314,6 @@ class TVC_Enhanced {
271
  return;
272
  }
273
  this.options.page_type="Thankyou Page";
274
- //console.log("call =>0"+this.options.tracking_option+"--"+this.options.property_id);
275
  if(this.is_add_remarketing_tags()){
276
  var ads_items = [];
277
  var ads_value=0;
@@ -283,7 +325,9 @@ class TVC_Enhanced {
283
  });
284
  }
285
  gtag("event","purchase", {
286
- "value": ads_value,
 
 
287
  "items": ads_items
288
  });
289
  }
@@ -481,32 +525,6 @@ class TVC_Enhanced {
481
  document.cookie = name +"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
482
  }
483
  static test(){
484
- //console.log(this.options);
485
- if(this.options.is_admin == true){
486
- return;
487
- }
488
- /*
489
- * Start UA or GA4
490
- */
491
- if((this.options.tracking_option =="UA" || this.options.tracking_option == "BOTH") && this.options.property_id ){
492
- try {
493
- }catch(err){
494
- gtag("event", "exception", {
495
- "description": err,
496
- "fatal": false
497
- });
498
- }
499
- /*
500
- * Start GA4
501
- */
502
- }else if( this.options.tracking_option == "GA4" && this.options.measurement_id ){
503
- try {
504
- }catch(err){
505
- gtag("event", "exception", {
506
- "description": err,
507
- "fatal": false
508
- });
509
- }
510
- }
511
  }
512
  }
30
  if(options){
31
  Object.assign(this.options, options);
32
  }
33
+ //console.log(this.options);
34
  //this.addEventBindings();
35
  }
36
+ singleProductaddToCartEventBindings(variations_data){
37
  // alert("call first");
38
  var single_btn = document.getElementsByClassName("single_add_to_cart_button");
39
  if(single_btn.length > 0){
40
+ single_btn[0].addEventListener("click", () => this.add_to_cart_click(variations_data, "Product Pages"));
41
  }
42
  }
43
  /*
53
  /*
54
  * check remarketing option
55
  */
56
+ view_item_pdp(tvc_po){
57
  if(this.options.is_admin == true){
58
  return;
59
  }
60
+
61
+ this.options.page_type="Product Page";
62
  /*
63
  * Start UA or GA4
64
  */
65
  if((this.options.tracking_option =="UA" || this.options.tracking_option == "BOTH") && this.options.property_id ){
66
  try {
67
  gtag("event", "view_item", {
68
+ "event_category": "Enhanced-Ecommerce",
69
+ "event_label": "view_item_"+tvc_po.tvc_n,
70
  "items": [{
71
  "id": tvc_po.tvc_i,// Product details are provided in an impressionFieldObject.
72
  "name": tvc_po.tvc_n,
81
  "page_type": this.options.page_type,
82
  "user_type": this.options.user_type,
83
  "user_id": this.options.user_id,
84
+ "client_id": this.getClientId(),
85
  "day_type": this.options.day_type,
86
  "local_time_slot_of_the_day": this.options.local_time
87
  });
98
  }else if( this.options.tracking_option == "GA4" && this.options.measurement_id ){
99
  try {
100
  gtag("event", "view_item", {
101
+ "event_category": "Enhanced-Ecommerce",
102
+ "event_label": "view_item_"+tvc_po.tvc_n,
103
  "currency": tvc_lc,
104
  "items": [{
105
  "item_id": tvc_po.tvc_i,
106
  "item_name": tvc_po.tvc_n,
107
+ "item_category": tvc_po.tvc_c,
108
  "discount": tvc_po.tvc_pd,
109
+ "affiliation": this.options.affiliation,
110
  "item_variant": tvc_po.tvc_var,
111
  "price": tvc_po.tvc_p,
112
  "currency": tvc_lc,
113
+ "quantity": tvc_po.tvc_q,
114
+ "index":1
115
  }],
116
  "non_interaction": true,
117
  "value": tvc_po.tvc_p * tvc_po.tvc_q,
118
  "page_type": this.options.page_type,
119
  "user_type": this.options.user_type,
120
  "user_id": this.options.user_id,
121
+ "client_id": this.getClientId(),
122
  "day_type": this.options.day_type,
123
  "local_time_slot_of_the_day": this.options.local_time
124
  });
133
  //add remarketing and dynamicremarketing tags
134
  if(this.is_add_remarketing_tags()){
135
  gtag("event","view_item", {
136
+ "send_to":this.options.remarketing_snippet_id,
137
+ "ecomm_pagetype":"product",
138
  "value": tvc_po.tvc_p,
139
  "items": [{
140
  "id": tvc_po.tvc_id,
146
 
147
 
148
  }
149
+ get_variation_data_by_id(variations_data, variation_id){
150
+ //console.log(variations_data.available_variations)
151
+ var r_val = "";
152
+ if(variations_data.available_variations.length > 0 ){
153
+ variations_data.available_variations.forEach((element, index) => {
154
+ if(element.variation_id == variation_id){
155
+ r_val = element;
156
+ }
157
+ });
158
+ return r_val;
159
+ //console.log(variations_data.available_variations)
160
+ }
161
+ }
162
+ get_variation_attribute_name(p_attributes){
163
+ //console.log(p_attributes);
164
+ var p_v_title = "";
165
+ if(Object.keys(p_attributes).length >0 ){
166
+ for(var index in p_attributes) {
167
+ p_v_title+=(p_v_title=="")?p_attributes[index]:' | '+p_attributes[index];
168
+
169
+ }
170
+ return p_v_title;
171
+ }
172
+ }
173
+ add_to_cart_click( variations_data, page_type ="Product Pages" ){
174
  if(this.options.is_admin == true){
175
  return;
176
  }
177
+ this.options.page_type = page_type;
178
  var varPrice = tvc_po.tvc_p;
179
+ var event_label="add_to_cart_";
180
+ var variation_attribute_name= "";
181
+ var vari_data ="";
182
+ var variation_id = "";
183
+ var variation_id_obj = document.getElementsByClassName("variation_id");
184
+ if (variation_id_obj.length > 0) {
185
+ variation_id = document.getElementsByClassName("variation_id")[0].value;
186
+ }
187
+
188
+ if(variation_id != ""){
189
+ vari_data = this.get_variation_data_by_id(variations_data, variation_id);
190
+ var p_attributes = vari_data.attributes;
191
+ if( Object.keys(p_attributes).length > 0){
192
+ variation_attribute_name = this.get_variation_attribute_name(p_attributes);
193
  }
194
+ if(vari_data.display_price){
195
+ varPrice = vari_data.display_price;
196
+ }else if(vari_data.display_regular_price){
197
+ varPrice = vari_data.display_regular_price;
198
+ }
199
+ }
200
+ //console.log(variation_attribute_name);
201
+
202
+
203
+ if(variation_id != ""){
204
+ event_label="add_to_cart_"+this.options.page_type+" | "+tvc_po.tvc_n+" | "+variation_attribute_name;
205
  }else if (tvc_po.is_featured == true){
206
  event_label="add_to_cart_"+this.options.page_type+" | " + this.options.feature_product_label + " | "+tvc_po.tvc_n;
207
+ //console.log("is_featured");
208
  }else if (tvc_po.is_onSale == true){
209
  event_label="add_to_cart_"+this.options.page_type+" | " + this.options.on_sale_label + " | "+tvc_po.tvc_n;
210
+ //console.log("is_onSale");
211
  }else{
212
  event_label="add_to_cart_"+this.options.page_type+" | "+tvc_po.tvc_n;
 
213
  }
214
  var lastCartTime = this.getCookie("time_add_to_cart");
215
  var curCartTime = this.getCurrentTime();
223
  try {
224
  gtag("event", "add_to_cart", {
225
  "event_category":"Enhanced-Ecommerce",
226
+ "event_label":event_label,
227
  "non_interaction": true,
228
  "items": [{
229
  "id" : tvc_po.tvc_i,
233
  "quantity" :jQuery(this).parent().find("input[name=quantity]").val(),
234
  "list_name":this.options.page_type,
235
  "list_position": 1,
236
+ "variant": variation_attribute_name
237
  }],
238
  "page_type": this.options.page_type,
239
  "user_type": this.options.user_type,
269
  "price":varPrice,
270
  "currency": tvc_lc,
271
  "quantity": jQuery(this).parent().find("input[name=quantity]").val(),
272
+ "item_variant": variation_attribute_name,
273
  "discount": tvc_po.tvc_pd,
274
  "affiliation":this.options.affiliation
275
  }],
294
  //add remarketing and dynamicremarketing tags
295
  if(this.is_add_remarketing_tags()){
296
  gtag("event","add_to_cart", {
297
+ "send_to":this.options.remarketing_snippet_id,
298
+ "ecomm_pagetype":"cart",
299
+ "value": varPrice,
300
  "items": [{
301
  "id": tvc_po.tvc_id,
302
  "google_business_vertical": "retail"
314
  return;
315
  }
316
  this.options.page_type="Thankyou Page";
 
317
  if(this.is_add_remarketing_tags()){
318
  var ads_items = [];
319
  var ads_value=0;
325
  });
326
  }
327
  gtag("event","purchase", {
328
+ "send_to":this.options.remarketing_snippet_id,
329
+ "ecomm_pagetype":"purchase",
330
+ "value": tvc_td.revenue,
331
  "items": ads_items
332
  });
333
  }
525
  document.cookie = name +"=; Path=/; Expires=Thu, 01 Jan 1970 00:00:01 GMT;";
526
  }
527
  static test(){
528
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
529
  }
530
  }
readme.txt CHANGED
@@ -1,15 +1,15 @@
1
  === Enhanced Ecommerce Google Analytics Plugin for WooCommerce ===
2
- Contributors: Tatvic
3
  Plugin Name: Enhanced Ecommerce for WooCommerce Store
4
  Plugin URI: https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
- Tags: Google Analytics tracking, Dynamic Remarketing,Google Shopping,Universal Analytics tracking,Ecommerce tracking, google analytics 4 tracking, google shopping feed, E-commerce,Web Analytics, Web Analytics For WooCommerce, e-commerce, woo-commerce,Ecommerce,WooCommerce, commerce, Wordpress Enhanced Ecommerce, WooCommerce Enhanced Ecommerce, WooCommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
  Author URI: https://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 1.4.1
9
- Tested up to: 5.7
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 3.1.3
12
- Version: 3.1.3
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
@@ -134,20 +134,18 @@ Enhanced eCommerce Google analytics plugin tracks the entire user journey on you
134
  16. Shopping campaign performance dashboard
135
  17. Product Sync dashboard
136
 
137
- <strong><a target="_blank" href=" https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=Wordpress&utm_medium=Listingcontent&utm_campaign=WPlisting"> Fast track and scale your eCommerce business to new heights by unlocking more advanced tracking and enabling complete google shopping solutions for your WooCommerce store. Give a try to our pro version.</a></strong>
138
 
139
 
140
- == Features of our <a target="_blank" href=" https://codecanyon.net/item/actionable-google-analytics-for-woocommerce/9899552?utm_source=Wordpress&utm_medium=Listingcontent&utm_campaign=WPlisting">pro version</a>: ==
141
 
142
  * All the features included in Enhanced ecommerce Google analytics plugin
143
  * Additional 5 enhanced ecommerce reports in Google Analytics: Overview, product list performance report, order coupon report, Internal promotion report, product coupon report, Affiliate code report
144
  * Complete eCommerce tracking for google analytics 4 tracking
145
  * You can track both google analytics 4 and universal analytics properties for your WooCommerce store
146
- * Facebook pixel tracking for remarketing on FB
147
  * Google ads conversion tracking
148
  * 20 custom dimensions and metrics tracking in your google analytics properties
149
  * User id and client id tracking for cross device user tracking
150
- * Use your own GTM capability
151
  * Product refund tracking
152
  * Form field tracking
153
  * Content grouping
@@ -164,12 +162,11 @@ Enhanced eCommerce Google analytics plugin tracks the entire user journey on you
164
  * Child theme compatibility
165
  * Premium support
166
  * Free GA audit
167
- * Personalised data studio reports for your eCommerce business (Paid)
168
  * CRO consulatation (Boost your eCommerce conversation with proven hypothesis) (Paid)
169
- * 1 hour custom development
170
  * Customization as per your requirements(Paid)
171
 
172
- <strong><a target="_blank" href="https://www.tatvic.com/contact/?utm_source=TatvicEE&utm_medium=InstallationDoc&utm_campaign=WPlisting">Reach out to us with your query here for a faster solution.</a></strong>
173
 
174
 
175
  == Note For Beginners : ==
@@ -222,6 +219,27 @@ Our plugin helps WooCommerce shop owners in automating everything that is requir
222
  = What is google merchant center? =
223
 
224
  Google Merchant Center helps millions of people discover, explore, and buy your products. With its family of features and deep reporting tools, it brings you different ways to get the right products to the right customers. In simpler words, in order to start using Google Shopping benefits you need to create a Google Merchant center account and fill your basic business information before you start uploading your product data for Google Shopping.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
225
 
226
  = What is Google Analytics4? =
227
 
@@ -251,7 +269,7 @@ Yes, our plugin is under GDPR compliance. For more information, read the <a href
251
 
252
  If you are facing this issue, please check if you have configured auto return in PayPal settings. Configuring auto return will resolve your issue. Here’s a PayPal <a href="https://www.paypal.com/in/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside" target="_blank">documentation</a> & WooCommerce <a href="http://docs.woothemes.com/document/paypal-standard/#section-5" target="_blank">documentation</a> on understanding & setting up Auto Return.
253
 
254
- In case you have already configured auto return for your store and facing the issue then you could <a href="https://www.tatvic.com/contact/">reach out to us</a>
255
 
256
  = I’ve install the plugin but I do not see any data in my GA =
257
 
@@ -266,7 +284,7 @@ In case you have already configured auto return for your store and facing the is
266
 
267
  Note: If you do not see the above setting, it means that you are still on the waiting list and you may have to wait till Google rolls out this for your web property
268
 
269
- (2) If the Enhanced Ecommerce setting is enabled in your GA and you have just installed our plugin, then please wait for at-least 24 hours before you start seeing any data in your GA. If you still face this issue after 24 hours, please <a href="https://www.tatvic.com/contact/">reach out to us</a>."
270
 
271
  = Does your plugin supports new Global Site Tag (gtag.js)? =
272
 
@@ -286,19 +304,11 @@ You can find all the Enhanced Ecommerce Reports in your Analytics Account under
286
 
287
  = Products with variant not getting recorded in GA =
288
 
289
- Currently our plugin does not support products with variants & hence you may not see their transaction data in GA. This feature is only available with the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin.
290
 
291
  = Does this plugin provide Google Ads Conversion Tracking? =
292
 
293
- The free version of our plugin does not provide Google Ads Conversion Tracking feature. This feature is only available with the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin.
294
-
295
- = Does this plugin provide Facebook Pixel Tracking? =
296
-
297
- The free version of our plugin does not provide Facebook Pixel Tracking feature. This feature is only available with the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin.
298
-
299
- = Does this plugin provide Google Optimize Snippet Adding Support? =
300
-
301
- The free version of our plugin does not provide Google Optimize Snippet Adding Support. This feature is only available with the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin.
302
 
303
  = Why some transactions are missing in my GA account, compared to my WooCommerce backend (Orders) =
304
 
@@ -325,21 +335,17 @@ User needs to check if you have auto return configured in your payment gateway s
325
 
326
  Configuring goals are out of the scope of our plugin. Our plugin is designed to track checkout funnels only.
327
 
328
- = Does your Plugin support Product Refund? =
329
-
330
- Our existing plugin does not track product refund data, however you can buy our <a href="https://1.envato.market/Yvn3R" target="_blank">premium plugin</a> to get access to product Refund data
331
-
332
  = Does your plugin support a Multilingual Wordpress site? =
333
 
334
- Our plugin does not support a Multilingual Wordpress site.
335
 
336
  = Does your plugin supports Child/Custom Theme? =
337
 
338
- The free version of our plugin is not fully compatible with the child/custom theme. Request you to go through the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin which is fully compatible with the child/custom theme. We are not providing any kind of support for Child/Custom Theme in the Free version of our plugin. For more information kindly contact us at analytics2(at)tatvic(dot)com.
339
 
340
  = Does Tatvic provide full support for the free version plugin? =
341
 
342
- We have a limited support policy for the free version of our plugin. Kindly go through the <a href="https://1.envato.market/Yvn3R" target="_blank">premium version</a> of our plugin to get full support for the product or you can also contact us at analytics2(at)tatvic(dot)com.
343
 
344
  = How to verify if I have implemented the plugin well? =
345
 
@@ -383,6 +389,36 @@ You can resolve the duplication of data by removing the manually implemented GA
383
 
384
  == Changelog ==
385
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
386
  = 3.1.3 - 8/07/2021 =
387
  * Bug fix - product_count notice was being displayed for some users, it is resolved now.
388
 
1
  === Enhanced Ecommerce Google Analytics Plugin for WooCommerce ===
2
+ Contributors: Tatvic, Conversios
3
  Plugin Name: Enhanced Ecommerce for WooCommerce Store
4
  Plugin URI: https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/
5
+ Tags: Google Analytics tracking, Dynamic Remarketing,Google Shopping automation,Google Shopping, Universal Analytics tracking,Ecommerce tracking, google analytics 4 tracking, google shopping feed, Web Analytics, Web Analytics For WooCommerce, WooCommerce Enhanced Ecommerce, WooCommerce Google Analytics, Google Analytics Plugin, Enhanced Ecommerce Plugin
6
  Author URI: https://www.tatvic.com/
7
  Author: Tatvic
8
  Requires at least: 1.4.1
9
+ Tested up to: 5.8
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 4.0.0
12
+ Version: 4.0.0
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
134
  16. Shopping campaign performance dashboard
135
  17. Product Sync dashboard
136
 
137
+ <strong><a target="_blank" href="https://conversios.io/pricings/?utm_source=EE+Plugin+Wordpress+Listing&utm_medium=Below+Free+Features&utm_campaign=Upsell+at+Conversios"> Fast track and scale your eCommerce business to new heights by unlocking more advanced tracking and enabling complete google shopping solutions for your WooCommerce store. Give a try to our pro version.</a></strong>
138
 
139
 
140
+ == Features of our <a target="_blank" href=" https://conversios.io/pricings/?utm_source=EE+Plugin+Wordpress+Listing&utm_medium=Below+Free+Features2&utm_campaign=Upsell+at+Conversios">pro version</a>: ==
141
 
142
  * All the features included in Enhanced ecommerce Google analytics plugin
143
  * Additional 5 enhanced ecommerce reports in Google Analytics: Overview, product list performance report, order coupon report, Internal promotion report, product coupon report, Affiliate code report
144
  * Complete eCommerce tracking for google analytics 4 tracking
145
  * You can track both google analytics 4 and universal analytics properties for your WooCommerce store
 
146
  * Google ads conversion tracking
147
  * 20 custom dimensions and metrics tracking in your google analytics properties
148
  * User id and client id tracking for cross device user tracking
 
149
  * Product refund tracking
150
  * Form field tracking
151
  * Content grouping
162
  * Child theme compatibility
163
  * Premium support
164
  * Free GA audit
165
+ * Consultation with Google Shopping expert to set up and enhance campaigns
166
  * CRO consulatation (Boost your eCommerce conversation with proven hypothesis) (Paid)
 
167
  * Customization as per your requirements(Paid)
168
 
169
+ <strong><a target="_blank" href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Reach+out+to+us+with+your+query+Link&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">Reach out to us with your query here for a faster solution.</a></strong>
170
 
171
 
172
  == Note For Beginners : ==
219
  = What is google merchant center? =
220
 
221
  Google Merchant Center helps millions of people discover, explore, and buy your products. With its family of features and deep reporting tools, it brings you different ways to get the right products to the right customers. In simpler words, in order to start using Google Shopping benefits you need to create a Google Merchant center account and fill your basic business information before you start uploading your product data for Google Shopping.
222
+
223
+ = How can I unclaim the domain in my Google Merchant Center and reclaim it via the plugin? =
224
+
225
+ Below are the steps to unclaim and reclaim domain(via plugin) in GMC:
226
+
227
+ <b>Unclaim the domain:</b>
228
+
229
+ -> Login to the Merchant Center account in which your site domain is claimed.
230
+ -> Go to Settings -> Business Information -> Website.
231
+ -> Enter a new website domain or another domain(ex: https://ytpr12345.io - it can be non-existence) in the website section, and click continue. Here is the <a href="https://prnt.sc/1ibdano">screenshot link</a> for reference.
232
+
233
+ After following the above steps, you will lose the claim for your previously verified and claimed website domain.
234
+
235
+ <b>Reclaim the domain via plugin:</b>
236
+
237
+ -> Login to the WordPress backend.
238
+ -> Go to Tatvic EE Plugin -> Google Shopping.
239
+ -> Click on the domain claim link or refresh button to claim the domain. Here is the <a href="https://prnt.sc/1ibhalt">screenshot link</a> which highlights the link and button.
240
+
241
+ After following the above steps, the plugin will automatically claim and verify the website domain in your connected Google merchant center account.
242
+
243
 
244
  = What is Google Analytics4? =
245
 
269
 
270
  If you are facing this issue, please check if you have configured auto return in PayPal settings. Configuring auto return will resolve your issue. Here’s a PayPal <a href="https://www.paypal.com/in/cgi-bin/webscr?cmd=p/mer/express_return_summary-outside" target="_blank">documentation</a> & WooCommerce <a href="http://docs.woothemes.com/document/paypal-standard/#section-5" target="_blank">documentation</a> on understanding & setting up Auto Return.
271
 
272
+ In case you have already configured auto return for your store and facing the issue then you could <a href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=PayPal+transaction+FAQ&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">reach out to us</a>
273
 
274
  = I’ve install the plugin but I do not see any data in my GA =
275
 
284
 
285
  Note: If you do not see the above setting, it means that you are still on the waiting list and you may have to wait till Google rolls out this for your web property
286
 
287
+ (2) If the Enhanced Ecommerce setting is enabled in your GA and you have just installed our plugin, then please wait for at-least 24 hours before you start seeing any data in your GA. If you still face this issue after 24 hours, please <a href="https://conversios.io/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=do+not+see+any+data+in+my+GA+FAQ&utm_campaign=Raise+query+at+Conversios#wpforms-form-11056">reach out to us</a>."
288
 
289
  = Does your plugin supports new Global Site Tag (gtag.js)? =
290
 
304
 
305
  = Products with variant not getting recorded in GA =
306
 
307
+ Currently our plugin does not support products with variants & hence you may not see their transaction data in GA. This feature is only available with the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Products+with+variant+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin.
308
 
309
  = Does this plugin provide Google Ads Conversion Tracking? =
310
 
311
+ The free version of our plugin does not provide Google Ads Conversion Tracking feature. This feature is only available with the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Google+Ads+Conversion+Tracking+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin.
 
 
 
 
 
 
 
 
312
 
313
  = Why some transactions are missing in my GA account, compared to my WooCommerce backend (Orders) =
314
 
335
 
336
  Configuring goals are out of the scope of our plugin. Our plugin is designed to track checkout funnels only.
337
 
 
 
 
 
338
  = Does your plugin support a Multilingual Wordpress site? =
339
 
340
+ Our plugin supports a Multilingual Wordpress site.
341
 
342
  = Does your plugin supports Child/Custom Theme? =
343
 
344
+ The free version of our plugin is not fully compatible with the child/custom theme. Request you to go through the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=Child%2FCustom+Theme+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin which is fully compatible with the child/custom theme. We are not providing any kind of support for Child/Custom Theme in the Free version of our plugin. For more information kindly contact us at info(at)conversios(dot)io.
345
 
346
  = Does Tatvic provide full support for the free version plugin? =
347
 
348
+ We have a limited support policy for the free version of our plugin. Kindly go through the <a href="https://conversios.io/pricings/?utm_source=EE+Plugin+WordPress+Listing&utm_medium=full+support+for+the+free+version+FAQ&utm_campaign=Upsell+at+Conversios" target="_blank">premium version</a> of our plugin to get full support for the product or you can also contact us at info(at)conversios(dot)io.
349
 
350
  = How to verify if I have implemented the plugin well? =
351
 
389
 
390
  == Changelog ==
391
 
392
+ = 4.0.0 - 29/07/2021 =
393
+
394
+ * Over the years, our team has worked tremendously hard in delivering the best possible version of the plugin delivered to you.
395
+ We've traded a ton of ideas, feedback and suggestions from all of you who've been using this plug-in.
396
+ It has given us a positive vote of confidence.
397
+ We're now taking a giant leap forward, by launching Conversios, an Innovation from Tatvic Analytics.
398
+ With Conversios, we want to create an ecosystem of plugins that arm you with every analytical eye you need to make your business successful.
399
+ Every ka-ching you get, adds to our reason to exist.
400
+ We're entrepreneurs just like you. The roads been full of ebbs and flows, and it always will be.
401
+ With Conversios, we just wish to make it smoother for you.
402
+ Do take a look and share your feedback & suggestions with us!
403
+
404
+ * We have introduced first month free trial for all our pro plans. You can try out any of the pro plan free for month.
405
+
406
+ * Major enhancements and improvements for product feed sync feature. Now, you will be able to sync unlimited products seamlessly.
407
+
408
+ * Google analytics tracking optimization - we have optimized the javascript code that will result in faster loading of your websites.
409
+
410
+ * Dynamic remarketing feature enhancement
411
+
412
+ * Added advanced trackings for more enhanced data that can be used to better understand user journey and will help you in better retarget and improve the conversion %. (Pro)
413
+
414
+ * Added one click plugin upgrade feature, user can now enter the license key from the plugin settings to active the pro plan.
415
+
416
+ * Added account summary page
417
+
418
+ * Optimized and migrated to latest Google Ads API for better and enhanced performance
419
+
420
+ * UI bug of Shopping campaign cost is fixed.
421
+
422
  = 3.1.3 - 8/07/2021 =
423
  * Bug fix - product_count notice was being displayed for some users, it is resolved now.
424