Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 4.5.0

Version Description

  • 07/12/2021 =

  • In this release, we have focused on code optimization and performance improvement.

  • Custom atributes read from JSON file issue got fixed.

  • Improvements in product feed sync feature.

Download this release

Release Info

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

Code changes from version 4.4.1 to 4.5.0

Files changed (41) hide show
  1. admin/class-conversios-admin.php +18 -22
  2. admin/class-conversios-onboarding.php +137 -147
  3. admin/class-enhanced-ecommerce-google-analytics-admin.php +29 -166
  4. admin/class-enhanced-ecommerce-google-analytics-settings.php +9 -19
  5. admin/class-survey.php +6 -7
  6. admin/class-tvc-admin-auto-product-sync-helper.php +60 -44
  7. admin/class-tvc-admin-db-helper.php +13 -13
  8. admin/class-tvc-admin-helper.php +56 -60
  9. admin/css/enhanced-ecommerce-google-analytics-admin.css +0 -3
  10. admin/css/style.css +3 -2
  11. admin/helper/class-dashboard-helper.php +13 -9
  12. admin/helper/class-onboarding-helper.php +79 -79
  13. admin/js/bootstrap.min.js +7 -0
  14. admin/js/popper.min.js +5 -0
  15. admin/partials/class-conversios-header.php +15 -17
  16. admin/partials/enhanced-ecommerce-google-analytics-admin-display.php +0 -113
  17. admin/partials/general-fields.php +61 -61
  18. admin/partials/pricings.php +113 -113
  19. enhanced-ecommerce-google-analytics.php +2 -2
  20. includes/class-enhanced-ecommerce-google-analytics-activator.php +1 -1
  21. includes/class-enhanced-ecommerce-google-analytics.php +8 -6
  22. includes/class-tvc-register-scripts.php +20 -20
  23. includes/data/class-tvc-ajax-file.php +77 -396
  24. includes/data/class-tvc-taxonomies.php +1 -2
  25. includes/setup/CustomApi.php +20 -60
  26. includes/setup/ShoppingApi.php +40 -40
  27. includes/setup/account.php +28 -31
  28. includes/setup/add-campaign.php +63 -62
  29. includes/setup/class-conversios-dashboard.php +174 -177
  30. includes/setup/class-tatvic-category-selector-element.php +15 -23
  31. includes/setup/class-tvc-product-sync-helper.php +54 -93
  32. includes/setup/google-ads.php +35 -35
  33. includes/setup/google-shopping-feed-gaa-config.php +19 -21
  34. includes/setup/google-shopping-feed-shopping-campaigns.php +72 -70
  35. includes/setup/google-shopping-feed-sync-product.php +26 -26
  36. includes/setup/google-shopping-feed.php +27 -27
  37. includes/setup/help-html.php +56 -82
  38. includes/setup/tatvic-category-wrapper.php +3 -4
  39. public/class-enhanced-ecommerce-google-analytics-public-pro.php +98 -104
  40. public/class-enhanced-ecommerce-google-analytics-public.php +42 -57
  41. readme.txt +10 -2
admin/class-conversios-admin.php CHANGED
@@ -60,14 +60,14 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
60
  do_action('add_conversios_css_'.$_GET['page']);
61
  //conversios page css
62
  if($_GET['page'] == "conversios"){
63
- wp_register_style('conversios-slick-css', ENHANCAD_PLUGIN_URL.'/admin/css/slick.css');
64
  wp_enqueue_style('conversios-slick-css');
65
- wp_register_style('conversios-daterangepicker-css', ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css');
66
  wp_enqueue_style('conversios-daterangepicker-css');
67
  }
68
  //all conversios page css
69
- wp_enqueue_style('conversios-style-css',ENHANCAD_PLUGIN_URL . '/admin/css/style.css', array(), $this->version, 'all');
70
- wp_enqueue_style('conversios-responsive-css',ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css', array(), $this->version, 'all');
71
  }
72
  }
73
 
@@ -80,17 +80,17 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
80
  $screen = get_current_screen();
81
  if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
82
  if($_GET['page'] == "conversios"){
83
- wp_enqueue_script( 'conversios-jquery-js', ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js' );
84
 
85
- wp_enqueue_script( 'conversios-chart-js', ENHANCAD_PLUGIN_URL . '/admin/js/chart.js' );
86
- wp_enqueue_script( 'conversios-chart-datalabels-js', ENHANCAD_PLUGIN_URL . '/admin/js/chartjs-plugin-datalabels.js');
87
- wp_enqueue_script( 'conversios-basictable-js', ENHANCAD_PLUGIN_URL . '/admin/js/jquery.basictable.min.js');
88
- wp_enqueue_script( 'conversios-moment-js', ENHANCAD_PLUGIN_URL . '/admin/js/moment.min.js');
89
- wp_enqueue_script( 'conversios-daterangepicker-js', ENHANCAD_PLUGIN_URL . '/admin/js/daterangepicker.js');
90
 
91
- wp_enqueue_script( 'tvc-ee-custom-js', ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js', array( 'jquery' ), $this->version, false );
92
  }
93
- do_action('add_conversios_js_'.$_GET['page']);
94
  }
95
  }
96
 
@@ -173,10 +173,10 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
173
  if (!empty($_GET['page'])) {
174
  $get_action = str_replace("-", "_", $_GET['page']);
175
  } else {
176
- $get_action = "conversios";
177
  }
178
  if (method_exists($this, $get_action)) {
179
- $this->$get_action();
180
  }
181
  echo $this->get_tvc_popup_message();
182
  do_action('add_conversios_footer');
@@ -214,23 +214,19 @@ if ( ! class_exists( 'Conversios_Admin' ) ) {
214
  new GoogleShoppingFeed();
215
  }
216
  }
217
- public function gaa_config_page() {
218
- //include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
219
- include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-gaa-config.php');
220
  new GAAConfiguration();
221
  }
222
  public function sync_product_page() {
223
- //include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
224
- include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-sync-product.php');
225
- new SyncProductConfiguration();
226
  }
227
  public function shopping_campaigns_page() {
228
- //include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
229
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-shopping-campaigns.php');
230
  new CampaignsConfiguration();
231
  }
232
  public function add_campaign_page() {
233
- //include(ENHANCAD_PLUGIN_DIR . 'includes/setup/help-html.php');
234
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/add-campaign.php');
235
  new AddCampaign();
236
  }
60
  do_action('add_conversios_css_'.$_GET['page']);
61
  //conversios page css
62
  if($_GET['page'] == "conversios"){
63
+ wp_register_style('conversios-slick-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/slick.css') );
64
  wp_enqueue_style('conversios-slick-css');
65
+ wp_register_style('conversios-daterangepicker-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/daterangepicker.css') );
66
  wp_enqueue_style('conversios-daterangepicker-css');
67
  }
68
  //all conversios page css
69
+ wp_enqueue_style('conversios-style-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/style.css'), array(), $this->version, 'all' );
70
+ wp_enqueue_style('conversios-responsive-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/responsive.css'), array(), $this->version, 'all');
71
  }
72
  }
73
 
80
  $screen = get_current_screen();
81
  if ($screen->id == 'toplevel_page_conversios' || (isset($_GET['page']) && strpos($_GET['page'], 'conversios') !== false) ) {
82
  if($_GET['page'] == "conversios"){
83
+ wp_enqueue_script( 'conversios-jquery-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js') );
84
 
85
+ wp_enqueue_script( 'conversios-chart-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/chart.js') );
86
+ wp_enqueue_script( 'conversios-chart-datalabels-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/chartjs-plugin-datalabels.js') );
87
+ wp_enqueue_script( 'conversios-basictable-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.basictable.min.js') );
88
+ wp_enqueue_script( 'conversios-moment-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/moment.min.js') );
89
+ wp_enqueue_script( 'conversios-daterangepicker-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/daterangepicker.js') );
90
 
91
+ wp_enqueue_script( 'tvc-ee-custom-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), $this->version, false );
92
  }
93
+ do_action('add_conversios_js_'.esc_attr($_GET['page']) );
94
  }
95
  }
96
 
173
  if (!empty($_GET['page'])) {
174
  $get_action = str_replace("-", "_", $_GET['page']);
175
  } else {
176
+ $get_action = "conversios";
177
  }
178
  if (method_exists($this, $get_action)) {
179
+ $this->$get_action();
180
  }
181
  echo $this->get_tvc_popup_message();
182
  do_action('add_conversios_footer');
214
  new GoogleShoppingFeed();
215
  }
216
  }
217
+ public function gaa_config_page() {
218
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-gaa-config.php');
 
219
  new GAAConfiguration();
220
  }
221
  public function sync_product_page() {
222
+ include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-sync-product.php');
223
+ new SyncProductConfiguration();
 
224
  }
225
  public function shopping_campaigns_page() {
 
226
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/google-shopping-feed-shopping-campaigns.php');
227
  new CampaignsConfiguration();
228
  }
229
  public function add_campaign_page() {
 
230
  include(ENHANCAD_PLUGIN_DIR . 'includes/setup/add-campaign.php');
231
  new AddCampaign();
232
  }
admin/class-conversios-onboarding.php CHANGED
@@ -68,21 +68,21 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
68
  }
69
 
70
  public function get_countries($user_country) {
71
- $getCountris = file_get_contents(ENHANCAD_PLUGIN_DIR . "/includes/setup/json/countries.json");
72
  $contData = json_decode($getCountris);
73
  if (!empty($user_country)) {
74
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx' readonly='true'>";
75
- $data .= "<option value=''>Please select country</option>";
76
  foreach ($contData as $key => $value) {
77
  $selected = ($value->code == $user_country) ? "selected='selected'" : "";
78
- $data .= "<option value=" . $value->code . " " . $selected . " >" . $value->name . "</option>";
79
  }
80
  $data .= "</select>";
81
  } else {
82
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx'>";
83
- $data .= "<option value=''>Please select country</option>";
84
  foreach ($contData as $key => $value) {
85
- $data .= "<option value=" . $value->code . ">" . $value->name . "</option>";
86
  }
87
  $data .= "</select>";
88
  }
@@ -157,8 +157,8 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
157
  $is_e_tracking = (property_exists($googleDetail,"exception_tracking") && $googleDetail->exception_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
158
  $is_e_l_a_tracking = (property_exists($googleDetail,"enhanced_link_attribution_tracking") && $googleDetail->enhanced_link_attribution_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
159
 
160
- $countries = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR . "/includes/setup/json/countries.json"));
161
- $credit = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR . "/includes/setup/json/country_reward.json"));
162
 
163
  $off_country = "";
164
  $off_credit_amt = "";
@@ -185,33 +185,33 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
185
  #wpadminbar{display: none;}
186
  </style>
187
  <div class="bodyrightpart onbordingbody-wapper">
188
- <div class="loader-section" id="loader-section"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/ajax-loader.gif';?>" alt="loader"></div>
189
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
190
  <div class="onbordingbody">
191
  <div class="site-header">
192
  <div class="container">
193
- <div class="brand"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/logo.png';?>" alt="Conversios" /></div>
194
  </div>
195
  </div>
196
  <div class="onbording-wrapper">
197
  <div class="container">
198
  <div class="smallcontainer">
199
  <div class="onbordingtop">
200
- <h2>Let’s get you started.</h2>
201
- <p>Automate Google Analytics, Dynamic Remarketing & Google Shopping in just 5 minutes.</p>
202
  </div>
203
  <div class="row">
204
  <!-- onborading left start -->
205
  <div class="onboardingstepwrap">
206
  <!-- step-0 start -->
207
  <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']=="" || $this->is_refresh_token_expire == true ){ echo "activestep"; }else{echo "selectedactivestep";} ?>">
208
- <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-0']; ?>" id="google-signing" data-id="step_0">
209
  <div class="stepleftround">
210
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
211
  </div>
212
  <div class="stepdetwrap">
213
- <h4>Connect Conversios with your website <?php /*<span class="helpicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/help-icon.png'; ?>" alt="" /></span> */ ?></h4>
214
- <p><?php echo (isset($this->tvc_data['g_mail']) && $this->subscriptionId)?$this->tvc_data['g_mail']:""; ?></p>
215
  </div>
216
  </div>
217
  <div class="stepmoredtlwrp">
@@ -219,30 +219,30 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
219
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
220
  <div class="google_connect_url google-btn">
221
  <div class="google-icon-wrapper">
222
- <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
223
  </div>
224
- <p class="btn-text"><b>Sign in with google</b></p>
225
  </div>
226
  <?php } else{?>
227
 
228
  <?php if($this->is_refresh_token_expire == true){?>
229
- <p class="alert alert-primary">It seems the token to access your Google accounts is expired. Sign in again to continue.</p>
230
  <div class="google_connect_url google-btn">
231
  <div class="google-icon-wrapper">
232
- <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
233
  </div>
234
- <p class="btn-text"><b>Sign in with google</b></p>
235
  </div>
236
  <?php } else{ ?>
237
  <div class="google_connect_url google-btn">
238
  <div class="google-icon-wrapper">
239
- <img class="google-icon" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'; ?>"/>
240
  </div>
241
- <p class="btn-text mr-35"><b>Reauthorize</b></p>
242
  </div>
243
  <?php } ?>
244
  <?php } ?>
245
- <p>Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.</p>
246
  </div>
247
  </div>
248
  </div>
@@ -251,35 +251,32 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
251
  <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
252
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-1']; ?>" id="google-analytics" data-id="step_1">
253
  <div class="stepleftround">
254
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
255
  </div>
256
  <div class="stepdetwrap">
257
- <h4>Connect Google Analytics Account </h4>
258
- <p>Tag your website with all important e-commerce events in Google Analytics.</p>
259
  </div>
260
  </div>
261
  <div class="stepmoredtlwrp">
262
  <div class="stepmoredtl">
263
  <form action="#">
264
  <div class="form-row">
265
- <h5>How do you plan to tag your website?</h5>
266
  <div class="cstmrdobtn-item">
267
  <label for="univeral">
268
  <input type="radio" <?php echo $this->is_checked($tracking_option, "UA"); ?> name="analytic_tag_type" id="univeral" value="UA">
269
  <span class="checkmark"></span>
270
- Universal Analytics (Google Analytics 3)
271
  </label>
272
  <div id="UA" class="slctunivr-filed">
273
- <?php /*<select class="slect2bx google_analytics_sel" id="ua_web_property_id">
274
- <option value=''>Select Property Id</option>
275
- </select> */ ?>
276
  <div class="tvc-dropdown">
277
- <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo $googleDetail->property_id; } ?>"><?php if($googleDetail->property_id){
278
- echo $googleDetail->property_id;
279
- }else{?>Select Property Id<?php } ?></div>
280
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
281
- <div class="tvc-select-items"><option value="">Select Property Id</option></div>
282
- <div class="tvc-ua-option-more option">Load More</div>
283
  </div>
284
  </div>
285
 
@@ -289,21 +286,19 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
289
  <label for="gglanytc">
290
  <input type="radio" <?php echo $this->is_checked($tracking_option, "GA4"); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
291
  <span class="checkmark"></span>
292
- Google Analytics 4
293
  </label>
294
  <div id="GA4" class="slctunivr-filed">
295
- <?php /*<select class="slect2bx google_analytics_sel" id="ga4_web_measurement_id">
296
- <option value=''>Select Measurement Id</option>
297
- </select> */ ?>
298
  <div class="tvc-dropdown">
299
  <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
300
  <?php if($googleDetail->measurement_id){
301
- echo $googleDetail->measurement_id;
302
- }else{?>Select Measurement Id
303
  <?php } ?></div>
304
  <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
305
- <div class="tvc-select-items"><option value="">Select Measurement Id</option></div>
306
- <div class="tvc-ga4-option-more option">Load More</div>
307
  </div>
308
  </div>
309
 
@@ -317,33 +312,29 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
317
  </label>
318
  <div id="BOTH" class="slctunivr-filed">
319
  <div class="botslectbxitem">
320
- <?php /*<select class="slect2bx google_analytics_sel" id="both_web_property_id">
321
- <option value=''>Select Property Id</option>
322
- </select>*/ ?>
323
  <div class="tvc-dropdown">
324
  <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo $googleDetail->property_id; } ?>"><?php if($googleDetail->property_id){
325
- echo $googleDetail->property_id;
326
- }else{?>Select Property Id<?php } ?></div>
327
  <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
328
- <div class="tvc-select-items"><option value="">Select Property Id</option></div>
329
- <div class="tvc-ua-option-more option">Load More</div>
330
  </div>
331
  </div>
332
 
333
  </div>
334
  <div class="botslectbxitem">
335
- <?php /*<select class="slect2bx google_analytics_sel" id="both_web_measurement_id">
336
- <option value=''>Select Measurement Id</option>
337
- </select> */ ?>
338
  <div class="tvc-dropdown">
339
  <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
340
  <?php if($googleDetail->measurement_id){
341
- echo $googleDetail->measurement_id;
342
- }else{?>Select Measurement Id
343
  <?php } ?></div>
344
  <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
345
- <div class="tvc-select-items"><option value="">Select Measurement Id</option></div>
346
- <div class="tvc-ga4-option-more option">Load More</div>
347
  </div>
348
  </div>
349
  </div>
@@ -358,14 +349,14 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
358
  <label for="enhanced_e_commerce_tracking">
359
  <input type="checkbox" class="custom-control-input" name="enhanced_e_commerce_tracking" id="enhanced_e_commerce_tracking" <?php echo $is_e_e_tracking; ?>>
360
  <span class="checkmark"></span>
361
- Enhaced e-commerce tracking
362
  </label>
363
  </div>
364
  <div class="cstmcheck-item">
365
  <label for="add_gtag_snippet">
366
  <input type="checkbox" class="custom-control-input" name="add_gtag_snippe" id="add_gtag_snippet" <?php echo $is_a_g_snippet; ?>>
367
  <span class="checkmark"></span>
368
- Add gtag.js snippet
369
  </label>
370
  </div>
371
  </div>
@@ -373,8 +364,7 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
373
  <div class="stepsbmtbtn">
374
  <input type="hidden" id="subscriptionPropertyId" name="subscriptionPropertyId" value="<?php echo (property_exists($googleDetail,"property_id"))?$googleDetail->property_id:""; ?>">
375
  <input type="hidden" id="subscriptionMeasurementId" name="subscriptionMeasurementId" value="<?php echo (property_exists($googleDetail,"measurement_id"))?$googleDetail->measurement_id:""; ?>">
376
- <button type="button" disabled id="step_1" class="stepnextbtn stpnxttrgr">Next</button>
377
- <!-- remove dslbbtn class for green button -->
378
  </div>
379
  </form>
380
  </div>
@@ -385,11 +375,11 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
385
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
386
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-2']; ?>" id="google-ads" data-id="step_2">
387
  <div class="stepleftround">
388
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
389
  </div>
390
  <div class="stepdetwrap">
391
- <h4>Select Google Ads account</h4>
392
- <p>With dynamic reamarketing tags, you will be able to show ads to your past visitors with specific product information tailored to your customer’s previous site visit.</p>
393
  </div>
394
  </div>
395
  <div class="stepmoredtlwrp">
@@ -399,23 +389,23 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
399
  <div class="ggladsselectbx">
400
  <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?$googleDetail->google_ads_id:""; ?>">
401
  <select class="slect2bx google_ads_sel" id="ads-account" name="customer_id">
402
- <option value=''>Select Google Ads Account</option>
403
  </select>
404
  </div>
405
  <div class="orwrp">or</div>
406
  <div class="creatnewwrp">
407
- <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'; ?>" alt="" /></span> Create New</button>
408
  </div>
409
  </div>
410
 
411
  <div class="selcttopwrap">
412
  <div class="onbrdpp-body alert alert-primary" style="display:none;" id="new_google_ads_section">
413
- <h4>Account Created</h4>
414
- <p>Your Google Ads Account has been created <strong>(<b><span id="new_google_ads_id"></span></b>).</strong></p>
415
- <h5>Steps to claim your Google Ads Account:</h5>
416
  <ol>
417
- <li>Accept invitation mail from Google Ads sent to your email address <em><?php echo (isset($this->tvc_data['g_mail']))?$this->tvc_data['g_mail']:""; ?></em></li>
418
- <li>Log into your Google Ads account and set up your <em>billing preferences</em></li>
419
  </ol>
420
  </div>
421
  </div>
@@ -427,20 +417,20 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
427
  $is_d_r_tags = (property_exists($googleDetail,"dynamic_remarketing_tags") && $googleDetail->dynamic_remarketing_tags == 1)?"checked":(($defaulSelection == 1)?"checked":"");
428
  $is_g_ad_c_tracking = (property_exists($googleDetail,"google_ads_conversion_tracking") && $googleDetail->google_ads_conversion_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
429
  ?>
430
- <h5>Advance Settings (Optional)</h5>
431
  <div class="chckbxbgbx dsplcolmview">
432
  <div class="cstmcheck-item">
433
  <label for="remarketing_tag">
434
  <input type="checkbox" class="custom-control-input" name="remarketing_tag" id="remarketing_tag" value="1" <?php echo $is_r_tags; ?>>
435
  <span class="checkmark"></span>
436
- Enable Google Remarketing Tag
437
  </label>
438
  </div>
439
  <div class="cstmcheck-item">
440
  <label for="dynamic_remarketing_tags">
441
  <input type="checkbox" class="custom-control-input" name="dynamic_remarketing_tags" id="dynamic_remarketing_tags" value="1" <?php echo $is_d_r_tags; ?>>
442
  <span class="checkmark"></span>
443
- Enable Dynamic Remarketing Tag
444
  </label>
445
  </div>
446
  <div class="cstmcheck-item <?php if($this->plan_id == 1){?>cstmcheck-item-pro <?php } ?>">
@@ -448,9 +438,9 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
448
  <?php if($this->plan_id != 1){?>
449
  <input type="checkbox" class="custom-control-input" name="google_ads_conversion_tracking" id="google_ads_conversion_tracking" value="1" <?php echo $is_g_ad_c_tracking; ?>>
450
  <span class="checkmark"></span>
451
- Google Ads conversion tracking
452
  <?php }else{?>
453
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/lock.svg'; ?>"><label>Google Ads conversion tracking (Pro Plan)</label>
454
  <?php } ?>
455
  </label>
456
  </div>
@@ -458,13 +448,13 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
458
  <label for="link_google_analytics_with_google_ads">
459
  <input type="checkbox" class="custom-control-input" name="link_google_analytics_with_google_ads" id="link_google_analytics_with_google_ads" value="1" <?php echo $is_l_g_an_w_g_ad; ?>>
460
  <span class="checkmark"></span>
461
- Link Google Analytics with Google Ads
462
  </label>
463
  </div>
464
  </div>
465
  </div>
466
  <div class="stepsbmtbtn">
467
- <button type="button" id="step_2" class="stepnextbtn stpnxttrgr">Next</button>
468
  <!-- add dslbbtn class for disable button -->
469
  </div>
470
  </form>
@@ -476,11 +466,11 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
476
  <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1 && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?>">
477
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-3']; ?>" id="gmc-account" data-id="step_3">
478
  <div class="stepleftround">
479
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'; ?>" alt="" />
480
  </div>
481
  <div class="stepdetwrap">
482
- <h4>Select Google Merchant Center Account</h4>
483
- <p>Make your WooCommerce shop and products available to millions of shoppers across google.</p>
484
  </div>
485
  </div>
486
  <div class="stepmoredtlwrp">
@@ -490,37 +480,37 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
490
  <div class="form-group" style="display:none;" id="new_merchant_section">
491
  <div class="text-center">
492
  <div class="alert alert-primary" style="padding: 10px;" role="alert">
493
- <label class="form-label-control font-weight-bold">We have created new merchant center account with ID: <span id="new_merchant_id"></span>. Click on finish button to save new account.</label>
494
  </div>
495
  </div>
496
  </div>
497
  <div id="tvc_merchant_section">
498
  <div class="ggladsselectbx">
499
  <select class="slect2bx" id="google_merchant_center_id" name="google_merchant_center_id">
500
- <option value=''>Select Measurement Id</option>
501
  </select>
502
  </div>
503
  <div class="orwrp">or</div>
504
  <div class="creatnewwrp">
505
- <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'; ?>" alt="" /></span> Create New</button>
506
  </div>
507
  </div>
508
  </div>
509
  <div class="stepsbmtbtn">
510
- <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn">Finish</button>
511
  <!-- add dslbbtn class for disable button -->
512
  </div>
513
  <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?$googleDetail->google_merchant_center_id:""; ?>">
514
- <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo $login_customer_id; ?>">
515
- <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo $this->subscriptionId; ?>">
516
  <input type="hidden" id="plan_id" name="plan_id" value="<?php echo $this->plan_id; ?>">
517
  <input type="hidden" id="conversios_onboarding_nonce" name="conversios_onboarding_nonce" value="<?php echo wp_create_nonce( 'conversios_onboarding_nonce' ); ?>">
518
 
519
- <input type="hidden" id="ga_view_id" name="ga_view_id" value="<?php echo get_option('ee_ga_view_id'); ?>">
520
  </form>
521
  </div>
522
  <div class="stepnotewrp">
523
- If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at <a href="">Google Merchant Center Help</a> website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.
524
  </div>
525
  </div>
526
  </div>
@@ -532,17 +522,17 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
532
  <div class="sidebrcontainer">
533
  <div class="onbrd-rdmbx">
534
  <div class="rdm-amnt">
535
- <small>Redeem upto</small>
536
  <?php echo $off_credit_amt; ?>
537
  </div>
538
- <p>Create your first Google Ads account with us and redeem upto <?php echo $off_credit_amt; ?> on the spend you make in the next 31 days.</p>
539
- <a target="_blank" href="https://conversios.io/help-center/Google-Spend-Match.pdf" class="lrnmorbtn">Learn more <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/arrow_right.png'; ?>" alt="" /></a>
540
  </div>
541
  <div class="onbrdrgt-nav">
542
  <ul>
543
- <li><a target="_blank" href="https://conversios.io/help-center/Installation-Manual.pdf">Installation Manual</a></li>
544
- <li><a target="_blank" href="https://conversios.io/help-center/Google-shopping-Guide.pdf" href="">Google Shopping Guide</a></li>
545
- <li><a target="_blank" href="https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/" href="">FAQ</a></li>
546
  </ul>
547
  </div>
548
  </div>
@@ -559,21 +549,21 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
559
  <div class="onbrdppmain" role="document">
560
  <div class="onbrdnpp-cntner acccretppcntnr">
561
  <div class="onbrdnpp-hdr">
562
- <h4>You have not selected Google Ads account.</h4>
563
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png';?>" alt="" /></div>
564
  </div>
565
  <div class="onbrdpp-body">
566
- <p>If you do not select Google Ads account, you will not be able to use some of the major features like:</p>
567
  <ul>
568
- <li>Dynamic Remarketing Tags </li>
569
- <li>Google Smart Shopping Campaigns</li>
570
- <li>Google Analytics and Google Ads linking</li>
571
  </ul>
572
- <p>Are you sure you want to continue without selecting Google Ads account?</p>
573
  </div>
574
  <div class="ppfooterbtn">
575
- <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="ads-skip-cancel">Cancel</button>
576
- <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="ads-skip-continue">Continue</button>
577
  </div>
578
  </div>
579
  </div>
@@ -583,14 +573,14 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
583
  <div class="onbrdppmain">
584
  <div class="onbrdnpp-cntner ggladsppcntnr">
585
  <div class="onbrdnpp-hdr">
586
- <h4>Enable Google Ads Account</h4>
587
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png';?>" alt="" /></div>
588
  </div>
589
  <div class="onbrdpp-body">
590
- <p>You’ll receive an invite from Google on your email. Accept the invitation to enable your Google Ads Account.</p>
591
  </div>
592
  <div class="ppfooterbtn">
593
- <button type="button" id="ads-continue" class="ppblubtn sndinvitebtn">Send Invite</button>
594
  </div>
595
  </div>
596
  </div>
@@ -600,16 +590,16 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
600
  <div class="onbrdppmain">
601
  <div class="onbrdnpp-cntner acccretppcntnr">
602
  <div class="onbrdnpp-hdr">
603
- <h4>You have not selected Google merchant center account.</h4>
604
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png';?>" alt="" /></div>
605
  </div>
606
  <div class="onbrdpp-body">
607
- <p>If you do not select a merchant center account, you will not be able to use complete google shopping features.</p>
608
- <p>Are you sure you want to continue without selecting a merchant center account?</p>
609
  </div>
610
  <div class="ppfooterbtn">
611
- <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="merchant-center-skip-cancel">Cancel</button>
612
- <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="merchant-center-skip-continue">Continue</button>
613
  </div>
614
  </div>
615
  </div>
@@ -618,34 +608,34 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
618
  <div id="createmerchantpopup" class="pp-modal onbrd-popupwrp crtemrchntpp">
619
  <div class="onbrdppmain">
620
  <div class="onbrdnpp-cntner crtemrchntppcntnr">
621
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'; ?>" alt="" /></div>
622
  <div class="onbrdpp-body">
623
  <div class="row">
624
  <div class="crtemrchnpp-lft">
625
  <div class="crtemrchpplft-top">
626
- <h4>Create Google Merchant Center Account</h4>
627
- <p>Before you can upload product data, you’ll need to verify and claim your store’s website URL. Claiming associates your website URL with your Google Merchant Center account.</p>
628
  </div>
629
  <div class="claimedbx">
630
- Your site will automatically be claimed and verified.
631
  </div>
632
  <div class="mrchntformwrp">
633
  <form action="#">
634
  <div class="form-row">
635
- <input type="hidden" id="get-mail" name="g_email" value="<?php echo isset($this->tvc_data['g_mail'])?$this->tvc_data['g_mail']:""; ?>">
636
- <input type="text" value="<?php echo $this->tvc_data['user_domain']; ?>" class="fromfiled" name="url" id="url" placeholder="Enter Website">
637
  <div class="cstmcheck-item mt15">
638
  <label for="adult_content">
639
  <input class="" type="checkbox" name="adult_content" id="adult_content">
640
  <span class="checkmark"></span>
641
- My site contains
642
  </label>
643
- <strong>Adult Content</strong>
644
  </div>
645
  </div>
646
  <div class="form-row">
647
- <input type="text" class="fromfiled" name="store_name" id="store_name" placeholder="Enter Store Name" required>
648
- <div class="inputinfotxt">This name will appear in your Shopping Ads.</div>
649
  </div>
650
  <div class="form-row">
651
  <?php echo $this->get_countries($this->tvc_data['user_country']); ?>
@@ -655,27 +645,27 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
655
  <label for="terms_conditions">
656
  <input class="" type="checkbox" name="concent" id="terms_conditions">
657
  <span class="checkmark"></span>
658
- I accept the
659
  </label>
660
- <a target="_blank" href="https://support.google.com/merchants/answer/160173?hl=en">terms & conditions</a>
661
  </div>
662
  </div>
663
  </form>
664
  </div>
665
  <div class="ppfooterbtn">
666
- <button type="button" id="create_merchant_account" class="cretemrchntbtn">Create Account
667
  </button>
668
  </div>
669
  </div>
670
  <div class="crtemrchnpp-right">
671
- <h6>To use Google Shopping, your website must meet these requirements:</h6>
672
  <ul>
673
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6149970?hl=en">Google Shopping ads policies</a></li>
674
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6150127">Accurate Contact Information</a></li>
675
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6150122">Secure collection of process and personal data</a></li>
676
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6150127">Return Policy</a></li>
677
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6150127">Billing terms & conditions</a></li>
678
- <li><a target="_blank" href="https://support.google.com/merchants/answer/6150118">Complete checkout process</a></li>
679
  </ul>
680
  </div>
681
  </div>
@@ -690,44 +680,44 @@ if ( ! class_exists( 'Conversios_Onboarding' ) ) {
690
  <div class="onbrdppmain">
691
  <div class="onbrdnpp-cntner congratppcntnr">
692
  <div class="onbrdnpp-hdr txtcnter">
693
- <h2>Congratulations!!</h2>
694
- <div class="ppclsbtn clsbtntrgr"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'; ?>" alt="" /></div>
695
  </div>
696
  <div class="onbrdpp-body congratppbody">
697
- <p>You have been successfully onboarded. Please check the account summary below and confirm.</p>
698
  <div class="congratppdtlwrp">
699
  <div class="cngrtppdtl-item" id="google_analytics_property_id_info">
700
  <div class="cngtrpplft">
701
- <span class="cngrtchckicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'; ?>" alt="" /></span>
702
- Google Analytics Property Id:
703
  </div>
704
  <div class="cngtrpprgt" id="selected_google_analytics_property"></div>
705
  </div>
706
  <div class="cngrtppdtl-item" id="google_analytics_measurement_id_info">
707
  <div class="cngtrpplft">
708
- <span class="cngrtchckicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'; ?>" alt="" /></span>
709
- Google Analytics Measurement Id:
710
  </div>
711
  <div class="cngtrpprgt" id="selected_google_analytics_measurement"></div>
712
  </div>
713
  <div class="cngrtppdtl-item" id="google_ads_info">
714
  <div class="cngtrpplft">
715
- <span class="cngrtchckicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'; ?>" alt="" /></span>
716
- Google Ads Account:
717
  </div>
718
  <div class="cngtrpprgt" id="selected_google_ads_account"></div>
719
  </div>
720
  <div class="cngrtppdtl-item" id="google_merchant_center_info">
721
  <div class="cngtrpplft">
722
- <span class="cngrtchckicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'; ?>" alt="" /></span>
723
- Google Merchant Center Account
724
  </div>
725
  <div class="cngtrpprgt" id="selected_google_merchant_center"></div>
726
  </div>
727
  </div>
728
  </div>
729
  <div class="ppfooterbtn">
730
- <button type="button" id="confirm_selection" class="ppblubtn">Confirm</button>
731
  </div>
732
  </div>
733
  </div>
68
  }
69
 
70
  public function get_countries($user_country) {
71
+ $getCountris = file_get_contents(ENHANCAD_PLUGIN_DIR . "includes/setup/json/countries.json");
72
  $contData = json_decode($getCountris);
73
  if (!empty($user_country)) {
74
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx' readonly='true'>";
75
+ $data .= "<option value=''>".__("Please select country","conversios")."</option>";
76
  foreach ($contData as $key => $value) {
77
  $selected = ($value->code == $user_country) ? "selected='selected'" : "";
78
+ $data .= "<option value=" . esc_attr($value->code) . " " . $selected . " >" . esc_attr($value->name) . "</option>";
79
  }
80
  $data .= "</select>";
81
  } else {
82
  $data = "<select id='selectCountry' name='country' class='form-control slect2bx'>";
83
+ $data .= "<option value=''>".__("Please select country","conversios")."</option>";
84
  foreach ($contData as $key => $value) {
85
+ $data .= "<option value=" . esc_attr($value->code) . ">" . esc_attr($value->name) . "</option>";
86
  }
87
  $data .= "</select>";
88
  }
157
  $is_e_tracking = (property_exists($googleDetail,"exception_tracking") && $googleDetail->exception_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
158
  $is_e_l_a_tracking = (property_exists($googleDetail,"enhanced_link_attribution_tracking") && $googleDetail->enhanced_link_attribution_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
159
 
160
+ $countries = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR . "includes/setup/json/countries.json"));
161
+ $credit = json_decode(file_get_contents(ENHANCAD_PLUGIN_DIR . "includes/setup/json/country_reward.json"));
162
 
163
  $off_country = "";
164
  $off_credit_amt = "";
185
  #wpadminbar{display: none;}
186
  </style>
187
  <div class="bodyrightpart onbordingbody-wapper">
188
+ <div class="loader-section" id="loader-section"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/ajax-loader.gif');?>" alt="loader"></div>
189
  <div class="alert-message" id="tvc_onboarding_popup_box"></div>
190
  <div class="onbordingbody">
191
  <div class="site-header">
192
  <div class="container">
193
+ <div class="brand"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/logo.png');?>" alt="Conversios" /></div>
194
  </div>
195
  </div>
196
  <div class="onbording-wrapper">
197
  <div class="container">
198
  <div class="smallcontainer">
199
  <div class="onbordingtop">
200
+ <h2><?php _e("Let’s get you started.","conversios"); ?></h2>
201
+ <p><?php _e("Automate Google Analytics, Dynamic Remarketing & Google Shopping in just 5 minutes.","conversios"); ?></p>
202
  </div>
203
  <div class="row">
204
  <!-- onborading left start -->
205
  <div class="onboardingstepwrap">
206
  <!-- step-0 start -->
207
  <div class="onbordording-step onbrdstep-0 gglanystep <?php if($this->subscriptionId == "" || $this->tvc_data['g_mail']=="" || $this->is_refresh_token_expire == true ){ echo "activestep"; }else{echo "selectedactivestep";} ?>">
208
+ <div class="stepdtltop" data-is-done="<?php echo esc_attr($complete_step['step-0']); ?>" id="google-signing" data-id="step_0">
209
  <div class="stepleftround">
210
+ <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
211
  </div>
212
  <div class="stepdetwrap">
213
+ <h4><?php _e("Connect Conversios with your website","conversios"); ?></h4>
214
+ <p><?php echo esc_attr((isset($this->tvc_data['g_mail']) && $this->subscriptionId)?$this->tvc_data['g_mail']:""); ?></p>
215
  </div>
216
  </div>
217
  <div class="stepmoredtlwrp">
219
  <?php if(!isset($this->tvc_data['g_mail']) || $this->tvc_data['g_mail'] == "" || $this->subscriptionId == ""){?>
220
  <div class="google_connect_url google-btn">
221
  <div class="google-icon-wrapper">
222
+ <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
223
  </div>
224
+ <p class="btn-text"><b><?php _e("Sign in with google","conversios"); ?></b></p>
225
  </div>
226
  <?php } else{?>
227
 
228
  <?php if($this->is_refresh_token_expire == true){?>
229
+ <p class="alert alert-primary"><?php _e("It seems the token to access your Google accounts is expired. Sign in again to continue.","conversios"); ?></p>
230
  <div class="google_connect_url google-btn">
231
  <div class="google-icon-wrapper">
232
+ <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
233
  </div>
234
+ <p class="btn-text"><b><?php _e("Sign in with google","conversios"); ?></b></p>
235
  </div>
236
  <?php } else{ ?>
237
  <div class="google_connect_url google-btn">
238
  <div class="google-icon-wrapper">
239
+ <img class="google-icon" src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/g-logo.png'); ?>"/>
240
  </div>
241
+ <p class="btn-text mr-35"><b><?php _e("Reauthorize","conversios"); ?></b></p>
242
  </div>
243
  <?php } ?>
244
  <?php } ?>
245
+ <p><?php _e("Make sure you sign in with the google account that has all privileges to access google analytics, google ads and google merchant center account.","conversios"); ?></p>
246
  </div>
247
  </div>
248
  </div>
251
  <div class="onbordording-step onbrdstep-1 gglanystep <?php echo ($complete_step['step-1']==1 && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?> <?php if($this->subscriptionId != "" && $this->tvc_data['g_mail'] && $this->is_refresh_token_expire == false){ echo "activestep"; } ?>">
252
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-1']; ?>" id="google-analytics" data-id="step_1">
253
  <div class="stepleftround">
254
+ <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
255
  </div>
256
  <div class="stepdetwrap">
257
+ <h4><?php _e("Connect Google Analytics Account","conversios"); ?></h4>
258
+ <p><?php _e("Tag your website with all important e-commerce events in Google Analytics.","conversios"); ?></p>
259
  </div>
260
  </div>
261
  <div class="stepmoredtlwrp">
262
  <div class="stepmoredtl">
263
  <form action="#">
264
  <div class="form-row">
265
+ <h5><?php _e("How do you plan to tag your website?","conversios"); ?></h5>
266
  <div class="cstmrdobtn-item">
267
  <label for="univeral">
268
  <input type="radio" <?php echo $this->is_checked($tracking_option, "UA"); ?> name="analytic_tag_type" id="univeral" value="UA">
269
  <span class="checkmark"></span>
270
+ <?php _e("Universal Analytics (Google Analytics 3)","conversios"); ?>
271
  </label>
272
  <div id="UA" class="slctunivr-filed">
 
 
 
273
  <div class="tvc-dropdown">
274
+ <div class="tvc-dropdown-header" id="ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo esc_attr($googleDetail->property_id); } ?>"><?php if($googleDetail->property_id){
275
+ echo esc_attr($googleDetail->property_id);
276
+ }else{?><?php _e("Select Property Id","conversios"); ?><?php } ?></div>
277
  <div class="tvc-dropdown-content" id="ua_web_property_id_option">
278
+ <div class="tvc-select-items"><option value=""><?php _e("Select Property Id","conversios"); ?></option></div>
279
+ <div class="tvc-ua-option-more option"><?php _e("Load More","conversios"); ?></div>
280
  </div>
281
  </div>
282
 
286
  <label for="gglanytc">
287
  <input type="radio" <?php echo $this->is_checked($tracking_option, "GA4"); ?> name="analytic_tag_type" id="gglanytc" value="GA4">
288
  <span class="checkmark"></span>
289
+ <?php _e("Google Analytics 4","conversios"); ?>
290
  </label>
291
  <div id="GA4" class="slctunivr-filed">
292
+
 
 
293
  <div class="tvc-dropdown">
294
  <div class="tvc-dropdown-header" id="ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
295
  <?php if($googleDetail->measurement_id){
296
+ echo esc_attr($googleDetail->measurement_id);
297
+ }else{?><?php _e("Select Measurement Id","conversios"); ?>
298
  <?php } ?></div>
299
  <div class="tvc-dropdown-content" id="ga4_web_measurement_id_option">
300
+ <div class="tvc-select-items"><option value=""><?php _e("Select Measurement Id","conversios"); ?></option></div>
301
+ <div class="tvc-ga4-option-more option"><?php _e("Load More","conversios"); ?></div>
302
  </div>
303
  </div>
304
 
312
  </label>
313
  <div id="BOTH" class="slctunivr-filed">
314
  <div class="botslectbxitem">
315
+
 
 
316
  <div class="tvc-dropdown">
317
  <div class="tvc-dropdown-header" id="both_ua_web_property_id_option_val" data-accountid="<?php if($googleDetail->ua_analytic_account_id){ echo $googleDetail->ua_analytic_account_id; } ?>" data-val="<?php if($googleDetail->property_id){ echo $googleDetail->property_id; } ?>"><?php if($googleDetail->property_id){
318
+ echo esc_attr($googleDetail->property_id);
319
+ }else{?><?php _e("Select Property Id","conversios"); ?><?php } ?></div>
320
  <div class="tvc-dropdown-content" id="both_ua_web_property_id_option">
321
+ <div class="tvc-select-items"><option value=""><?php _e("Select Property Id","conversios"); ?></option></div>
322
+ <div class="tvc-ua-option-more option"><?php _e("Load More","conversios"); ?></div>
323
  </div>
324
  </div>
325
 
326
  </div>
327
  <div class="botslectbxitem">
328
+
 
 
329
  <div class="tvc-dropdown">
330
  <div class="tvc-dropdown-header" id="both_ga4_web_measurement_id_option_val" data-accountid="<?php if($googleDetail->ga4_analytic_account_id){ echo $googleDetail->ga4_analytic_account_id; } ?>" data-val="<?php if($googleDetail->measurement_id){ echo $googleDetail->measurement_id; } ?>">
331
  <?php if($googleDetail->measurement_id){
332
+ echo esc_attr($googleDetail->measurement_id);
333
+ }else{?><?php _e("Select Measurement Id","conversios"); ?>
334
  <?php } ?></div>
335
  <div class="tvc-dropdown-content" id="both_ga4_web_measurement_id_option">
336
+ <div class="tvc-select-items"><option value=""><?php _e("Select Measurement Id","conversios"); ?></option></div>
337
+ <div class="tvc-ga4-option-more option"><?php _e("Load More","conversios"); ?></div>
338
  </div>
339
  </div>
340
  </div>
349
  <label for="enhanced_e_commerce_tracking">
350
  <input type="checkbox" class="custom-control-input" name="enhanced_e_commerce_tracking" id="enhanced_e_commerce_tracking" <?php echo $is_e_e_tracking; ?>>
351
  <span class="checkmark"></span>
352
+ <?php _e("Enhaced e-commerce tracking","conversios"); ?>
353
  </label>
354
  </div>
355
  <div class="cstmcheck-item">
356
  <label for="add_gtag_snippet">
357
  <input type="checkbox" class="custom-control-input" name="add_gtag_snippe" id="add_gtag_snippet" <?php echo $is_a_g_snippet; ?>>
358
  <span class="checkmark"></span>
359
+ <?php _e("Add gtag.js snippet","conversios"); ?>
360
  </label>
361
  </div>
362
  </div>
364
  <div class="stepsbmtbtn">
365
  <input type="hidden" id="subscriptionPropertyId" name="subscriptionPropertyId" value="<?php echo (property_exists($googleDetail,"property_id"))?$googleDetail->property_id:""; ?>">
366
  <input type="hidden" id="subscriptionMeasurementId" name="subscriptionMeasurementId" value="<?php echo (property_exists($googleDetail,"measurement_id"))?$googleDetail->measurement_id:""; ?>">
367
+ <button type="button" disabled id="step_1" class="stepnextbtn stpnxttrgr"><?php _e("Next","conversios"); ?></button>
 
368
  </div>
369
  </form>
370
  </div>
375
  <div class="onbordording-step onbrdstep-2 ggladsstep <?php echo ($complete_step['step-2']==1 && $this->is_refresh_token_expire == false)?'selectedactivestep':''; ?>">
376
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-2']; ?>" id="google-ads" data-id="step_2">
377
  <div class="stepleftround">
378
+ <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
379
  </div>
380
  <div class="stepdetwrap">
381
+ <h4><?php _e("Select Google Ads account","conversios"); ?></h4>
382
+ <p><?php _e("With dynamic reamarketing tags, you will be able to show ads to your past visitors with specific product information tailored to your customer’s previous site visit.","conversios"); ?></p>
383
  </div>
384
  </div>
385
  <div class="stepmoredtlwrp">
389
  <div class="ggladsselectbx">
390
  <input type="hidden" id="subscriptionGoogleAdsId" name="subscriptionGoogleAdsId" value="<?php echo property_exists($googleDetail,"google_ads_id")?$googleDetail->google_ads_id:""; ?>">
391
  <select class="slect2bx google_ads_sel" id="ads-account" name="customer_id">
392
+ <option value=''><?php _e("Select Google Ads Account","conversios"); ?></option>
393
  </select>
394
  </div>
395
  <div class="orwrp">or</div>
396
  <div class="creatnewwrp">
397
+ <button type="button" class="cretnewbtn newggladsbtn"><span class="plusicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php _e("Create New","conversios"); ?></button>
398
  </div>
399
  </div>
400
 
401
  <div class="selcttopwrap">
402
  <div class="onbrdpp-body alert alert-primary" style="display:none;" id="new_google_ads_section">
403
+ <h4><?php _e("Account Created","conversios"); ?></h4>
404
+ <p><?php _e("Your Google Ads Account has been created","conversios"); ?> <strong>(<b><span id="new_google_ads_id"></span></b>).</strong></p>
405
+ <h5><?php _e("Steps to claim your Google Ads Account:","conversios"); ?></h5>
406
  <ol>
407
+ <li><?php _e("Accept invitation mail from Google Ads sent to your email address","conversios"); ?> <em><?php echo (isset($this->tvc_data['g_mail']))?$this->tvc_data['g_mail']:""; ?></em></li>
408
+ <li><?php _e("Log into your Google Ads account and set up your <em>billing preferences</em>","conversios"); ?></li>
409
  </ol>
410
  </div>
411
  </div>
417
  $is_d_r_tags = (property_exists($googleDetail,"dynamic_remarketing_tags") && $googleDetail->dynamic_remarketing_tags == 1)?"checked":(($defaulSelection == 1)?"checked":"");
418
  $is_g_ad_c_tracking = (property_exists($googleDetail,"google_ads_conversion_tracking") && $googleDetail->google_ads_conversion_tracking == 1)?"checked":(($defaulSelection == 1)?"checked":"");
419
  ?>
420
+ <h5><?php _e("Advance Settings (Optional)","conversios"); ?></h5>
421
  <div class="chckbxbgbx dsplcolmview">
422
  <div class="cstmcheck-item">
423
  <label for="remarketing_tag">
424
  <input type="checkbox" class="custom-control-input" name="remarketing_tag" id="remarketing_tag" value="1" <?php echo $is_r_tags; ?>>
425
  <span class="checkmark"></span>
426
+ <?php _e("Enable Google Remarketing Tag","conversios"); ?>
427
  </label>
428
  </div>
429
  <div class="cstmcheck-item">
430
  <label for="dynamic_remarketing_tags">
431
  <input type="checkbox" class="custom-control-input" name="dynamic_remarketing_tags" id="dynamic_remarketing_tags" value="1" <?php echo $is_d_r_tags; ?>>
432
  <span class="checkmark"></span>
433
+ <?php _e("Enable Dynamic Remarketing Tag","conversios"); ?>
434
  </label>
435
  </div>
436
  <div class="cstmcheck-item <?php if($this->plan_id == 1){?>cstmcheck-item-pro <?php } ?>">
438
  <?php if($this->plan_id != 1){?>
439
  <input type="checkbox" class="custom-control-input" name="google_ads_conversion_tracking" id="google_ads_conversion_tracking" value="1" <?php echo $is_g_ad_c_tracking; ?>>
440
  <span class="checkmark"></span>
441
+ <?php _e("Google Ads conversion tracking","conversios"); ?>
442
  <?php }else{?>
443
+ <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/icon/lock.svg'); ?>"><label><?php _e("Google Ads conversion tracking (Pro Plan)","conversios"); ?></label>
444
  <?php } ?>
445
  </label>
446
  </div>
448
  <label for="link_google_analytics_with_google_ads">
449
  <input type="checkbox" class="custom-control-input" name="link_google_analytics_with_google_ads" id="link_google_analytics_with_google_ads" value="1" <?php echo $is_l_g_an_w_g_ad; ?>>
450
  <span class="checkmark"></span>
451
+ <?php _e("Link Google Analytics with Google Ads","conversios"); ?>
452
  </label>
453
  </div>
454
  </div>
455
  </div>
456
  <div class="stepsbmtbtn">
457
+ <button type="button" id="step_2" class="stepnextbtn stpnxttrgr"><?php _e("Next","conversios"); ?></button>
458
  <!-- add dslbbtn class for disable button -->
459
  </div>
460
  </form>
466
  <div class="onbordording-step onbrdstep-3 gglmrchntstep <?php echo ($complete_step['step-3']==1 && $this->is_refresh_token_expire == false )?'selectedactivestep':''; ?>">
467
  <div class="stepdtltop" data-is-done="<?php echo $complete_step['step-3']; ?>" id="gmc-account" data-id="step_3">
468
  <div class="stepleftround">
469
+ <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/check-wbg.png'); ?>" alt="" />
470
  </div>
471
  <div class="stepdetwrap">
472
+ <h4><?php _e("Select Google Merchant Center Account","conversios"); ?></h4>
473
+ <p><?php _e("Make your WooCommerce shop and products available to millions of shoppers across google.","conversios"); ?></p>
474
  </div>
475
  </div>
476
  <div class="stepmoredtlwrp">
480
  <div class="form-group" style="display:none;" id="new_merchant_section">
481
  <div class="text-center">
482
  <div class="alert alert-primary" style="padding: 10px;" role="alert">
483
+ <label class="form-label-control font-weight-bold"><?php _e("We have created new merchant center account with ID: ","conversios"); ?><span id="new_merchant_id"></span>. <?php _e("Click on finish button to save new account.","conversios"); ?></label>
484
  </div>
485
  </div>
486
  </div>
487
  <div id="tvc_merchant_section">
488
  <div class="ggladsselectbx">
489
  <select class="slect2bx" id="google_merchant_center_id" name="google_merchant_center_id">
490
+ <option value=''><?php _e("Select Measurement Id","conversios"); ?></option>
491
  </select>
492
  </div>
493
  <div class="orwrp">or</div>
494
  <div class="creatnewwrp">
495
+ <button type="button" class="cretnewbtn newmrchntbtn"><span class="plusicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/blue-plus.png'); ?>" alt="" /></span> <?php _e("Create New","conversios"); ?></button>
496
  </div>
497
  </div>
498
  </div>
499
  <div class="stepsbmtbtn">
500
+ <button type="button" id="step_3" data-enchanter="finish" class="stepnextbtn finishbtn"><?php _e("Finish","conversios"); ?></button>
501
  <!-- add dslbbtn class for disable button -->
502
  </div>
503
  <input type="hidden" id="subscriptionMerchantCenId" name="subscriptionMerchantCenId" value="<?php echo property_exists($googleDetail,"google_merchant_center_id")?$googleDetail->google_merchant_center_id:""; ?>">
504
+ <input type="hidden" id="loginCustomerId" name="loginCustomerId" value="<?php echo esc_attr($login_customer_id); ?>">
505
+ <input type="hidden" id="subscriptionId" name="subscriptionId" value="<?php echo esc_attr($this->subscriptionId); ?>">
506
  <input type="hidden" id="plan_id" name="plan_id" value="<?php echo $this->plan_id; ?>">
507
  <input type="hidden" id="conversios_onboarding_nonce" name="conversios_onboarding_nonce" value="<?php echo wp_create_nonce( 'conversios_onboarding_nonce' ); ?>">
508
 
509
+ <input type="hidden" id="ga_view_id" name="ga_view_id" value="<?php echo esc_attr(get_option('ee_ga_view_id')); ?>">
510
  </form>
511
  </div>
512
  <div class="stepnotewrp">
513
+ <?php _e('If you are in the European Economic Area or Switzerland your Merchant Center account must be associated with a Comparison Shopping Service (CSS). Please find more information at <a href="">Google Merchant Center Help</a> website. If you create a new Merchant Center account through this application, it will be associated with Google Shopping, Google’s CSS, by default. You can change the CSS associated with your account at any time. Please find more information about our CSS Partners <a href="">here</a>. Once you have set up your Merchant Center account you can use our onboarding tool regardless of which CSS you use.','conversios'); ?>
514
  </div>
515
  </div>
516
  </div>
522
  <div class="sidebrcontainer">
523
  <div class="onbrd-rdmbx">
524
  <div class="rdm-amnt">
525
+ <small><?php _e("Redeem upto","conversios"); ?></small>
526
  <?php echo $off_credit_amt; ?>
527
  </div>
528
+ <p><?php _e("Create your first Google Ads account with us and redeem upto","conversios"); ?> <?php echo $off_credit_amt; ?> <?php _e("on the spend you make in the next 31 days.","conversios"); ?></p>
529
+ <a target="_blank" href="https://conversios.io/help-center/Google-Spend-Match.pdf" class="lrnmorbtn"><?php _e("Learn more","conversios"); ?> <img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/arrow_right.png'); ?>" alt="" /></a>
530
  </div>
531
  <div class="onbrdrgt-nav">
532
  <ul>
533
+ <li><a target="_blank" href="<?php echo esc_url("https://conversios.io/help-center/Installation-Manual.pdf"); ?>"><?php echo _e("Installation Manual","conversios"); ?></a></li>
534
+ <li><a target="_blank" href="<?php echo esc_url("https://conversios.io/help-center/Google-shopping-Guide.pdf"); ?>" href=""><?php _e("Google Shopping Guide","conversios"); ?></a></li>
535
+ <li><a target="_blank" href="<?php echo esc_url("https://wordpress.org/plugins/enhanced-e-commerce-for-woocommerce-store/faq/"); ?>" href=""><?php _e("FAQ","conversios"); ?></a></li>
536
  </ul>
537
  </div>
538
  </div>
549
  <div class="onbrdppmain" role="document">
550
  <div class="onbrdnpp-cntner acccretppcntnr">
551
  <div class="onbrdnpp-hdr">
552
+ <h4><?php _e("You have not selected Google Ads account.","conversios"); ?></h4>
553
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
554
  </div>
555
  <div class="onbrdpp-body">
556
+ <p><?php _e("If you do not select Google Ads account, you will not be able to use some of the major features like:","conversios"); ?></p>
557
  <ul>
558
+ <li><?php _e("Dynamic Remarketing Tags","conversios"); ?> </li>
559
+ <li><?php _e("Google Smart Shopping Campaigns","conversios"); ?></li>
560
+ <li><?php _e("Google Analytics and Google Ads linking","conversios"); ?></li>
561
  </ul>
562
+ <p><?php _e("Are you sure you want to continue without selecting Google Ads account?","conversios"); ?></p>
563
  </div>
564
  <div class="ppfooterbtn">
565
+ <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="ads-skip-cancel"><?php _e("Cancel","conversios"); ?></button>
566
+ <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="ads-skip-continue"><?php _e("Continue","conversios"); ?></button>
567
  </div>
568
  </div>
569
  </div>
573
  <div class="onbrdppmain">
574
  <div class="onbrdnpp-cntner ggladsppcntnr">
575
  <div class="onbrdnpp-hdr">
576
+ <h4><?php _e("Enable Google Ads Account","conversios"); ?></h4>
577
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
578
  </div>
579
  <div class="onbrdpp-body">
580
+ <p><?php _e("You’ll receive an invite from Google on your email. Accept the invitation to enable your Google Ads Account.","conversios"); ?></p>
581
  </div>
582
  <div class="ppfooterbtn">
583
+ <button type="button" id="ads-continue" class="ppblubtn sndinvitebtn"><?php _e("Send Invite","conversios"); ?></button>
584
  </div>
585
  </div>
586
  </div>
590
  <div class="onbrdppmain">
591
  <div class="onbrdnpp-cntner acccretppcntnr">
592
  <div class="onbrdnpp-hdr">
593
+ <h4><?php _e("You have not selected Google merchant center account.","conversios"); ?></h4>
594
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png');?>" alt="" /></div>
595
  </div>
596
  <div class="onbrdpp-body">
597
+ <p><?php _e("If you do not select a merchant center account, you will not be able to use complete google shopping features.","conversios"); ?></p>
598
+ <p><?php _e("Are you sure you want to continue without selecting a merchant center account?","conversios"); ?></p>
599
  </div>
600
  <div class="ppfooterbtn">
601
+ <button type="button" class="ppblubtn btn-secondary" data-dismiss="modal" id="merchant-center-skip-cancel"><?php _e("Cancel","conversios"); ?></button>
602
+ <button type="button" class="ppblubtn btn-primary" data-dismiss="modal" id="merchant-center-skip-continue"><?php _e("Continue","conversios"); ?></button>
603
  </div>
604
  </div>
605
  </div>
608
  <div id="createmerchantpopup" class="pp-modal onbrd-popupwrp crtemrchntpp">
609
  <div class="onbrdppmain">
610
  <div class="onbrdnpp-cntner crtemrchntppcntnr">
611
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
612
  <div class="onbrdpp-body">
613
  <div class="row">
614
  <div class="crtemrchnpp-lft">
615
  <div class="crtemrchpplft-top">
616
+ <h4><?php _e("Create Google Merchant Center Account","conversios"); ?></h4>
617
+ <p><?php _e("Before you can upload product data, you’ll need to verify and claim your store’s website URL. Claiming associates your website URL with your Google Merchant Center account.","conversios"); ?></p>
618
  </div>
619
  <div class="claimedbx">
620
+ <?php _e("Your site will automatically be claimed and verified.","conversios"); ?>
621
  </div>
622
  <div class="mrchntformwrp">
623
  <form action="#">
624
  <div class="form-row">
625
+ <input type="hidden" id="get-mail" name="g_email" value="<?php echo esc_attr(isset($this->tvc_data['g_mail'])?$this->tvc_data['g_mail']:""); ?>">
626
+ <input type="text" value="<?php echo esc_attr($this->tvc_data['user_domain']); ?>" class="fromfiled" name="url" id="url" placeholder="Enter Website">
627
  <div class="cstmcheck-item mt15">
628
  <label for="adult_content">
629
  <input class="" type="checkbox" name="adult_content" id="adult_content">
630
  <span class="checkmark"></span>
631
+ <?php _e("My site contains","conversios"); ?>
632
  </label>
633
+ <strong><?php _e("Adult Content","conversios"); ?></strong>
634
  </div>
635
  </div>
636
  <div class="form-row">
637
+ <input type="text" class="fromfiled" name="store_name" id="store_name" placeholder="<?php _e("Enter Store Name","conversios"); ?>" required>
638
+ <div class="inputinfotxt"><?php _e("This name will appear in your Shopping Ads.","conversios"); ?></div>
639
  </div>
640
  <div class="form-row">
641
  <?php echo $this->get_countries($this->tvc_data['user_country']); ?>
645
  <label for="terms_conditions">
646
  <input class="" type="checkbox" name="concent" id="terms_conditions">
647
  <span class="checkmark"></span>
648
+ <?php _e("I accept the","conversios"); ?>
649
  </label>
650
+ <a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/160173?hl=en"); ?>"><?php _e("terms & conditions","conversios"); ?></a>
651
  </div>
652
  </div>
653
  </form>
654
  </div>
655
  <div class="ppfooterbtn">
656
+ <button type="button" id="create_merchant_account" class="cretemrchntbtn"><?php _e("Create Account","conversios"); ?>
657
  </button>
658
  </div>
659
  </div>
660
  <div class="crtemrchnpp-right">
661
+ <h6><?php _e("To use Google Shopping, your website must meet these requirements:","conversios"); ?></h6>
662
  <ul>
663
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6149970?hl=en"); ?>"><?php _e("Google Shopping ads policies","conversios"); ?></a></li>
664
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Accurate Contact Information","conversios"); ?></a></li>
665
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150122"); ?>"><?php _e("Secure collection of process and personal data","conversios"); ?></a></li>
666
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Return Policy","conversios"); ?></a></li>
667
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150127"); ?>"><?php _e("Billing terms & conditions","conversios"); ?></a></li>
668
+ <li><a target="_blank" href="<?php echo esc_url("https://support.google.com/merchants/answer/6150118"); ?>"><?php _e("Complete checkout process","conversios"); ?></a></li>
669
  </ul>
670
  </div>
671
  </div>
680
  <div class="onbrdppmain">
681
  <div class="onbrdnpp-cntner congratppcntnr">
682
  <div class="onbrdnpp-hdr txtcnter">
683
+ <h2><?php _e("Congratulations!!","conversios"); ?></h2>
684
+ <div class="ppclsbtn clsbtntrgr"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/close-icon.png'); ?>" alt="" /></div>
685
  </div>
686
  <div class="onbrdpp-body congratppbody">
687
+ <p><?php _e("You have been successfully onboarded. Please check the account summary below and confirm.","conversios"); ?></p>
688
  <div class="congratppdtlwrp">
689
  <div class="cngrtppdtl-item" id="google_analytics_property_id_info">
690
  <div class="cngtrpplft">
691
+ <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
692
+ <?php _e("Google Analytics Property Id:","conversios"); ?>
693
  </div>
694
  <div class="cngtrpprgt" id="selected_google_analytics_property"></div>
695
  </div>
696
  <div class="cngrtppdtl-item" id="google_analytics_measurement_id_info">
697
  <div class="cngtrpplft">
698
+ <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
699
+ <?php _e("Google Analytics Measurement Id:","conversios"); ?>
700
  </div>
701
  <div class="cngtrpprgt" id="selected_google_analytics_measurement"></div>
702
  </div>
703
  <div class="cngrtppdtl-item" id="google_ads_info">
704
  <div class="cngtrpplft">
705
+ <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
706
+ <?php _e("Google Ads Account:","conversios"); ?>
707
  </div>
708
  <div class="cngtrpprgt" id="selected_google_ads_account"></div>
709
  </div>
710
  <div class="cngrtppdtl-item" id="google_merchant_center_info">
711
  <div class="cngtrpplft">
712
+ <span class="cngrtchckicon"><img src="<?php echo esc_url(ENHANCAD_PLUGIN_URL.'/admin/images/green-check.png'); ?>" alt="" /></span>
713
+ <?php _e("Google Merchant Center Account","conversios"); ?>
714
  </div>
715
  <div class="cngtrpprgt" id="selected_google_merchant_center"></div>
716
  </div>
717
  </div>
718
  </div>
719
  <div class="ppfooterbtn">
720
+ <button type="button" id="confirm_selection" class="ppblubtn"><?php _e("Confirm","conversios"); ?></button>
721
  </div>
722
  </div>
723
  </div>
admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -62,7 +62,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
62
  $this->pro_plan_site = $this->get_pro_plan_site();
63
  $this->google_detail = $this->get_ee_options_data();
64
  //remove container_old_ui_head hook once new UI all implemented
65
- add_action('container_old_ui_head',array($this,'create_head'));
66
  }
67
  public function tvc_admin_notice(){
68
  // add fixed message notification
@@ -72,7 +72,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
72
  }else{
73
  if(!$this->get_subscriptionId()){
74
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
75
- <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=conversios"><b><u>CONFIGURE NOW</u></b></a></p>
76
  </div>';
77
  }
78
  }
@@ -83,7 +83,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
83
  $googleDetail = $google_detail['setting'];
84
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
85
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_b">
86
- <p>Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business. <a href="admin.php?page=conversios"><b><u>Automate now</u></b></a></p>
87
  </div>';
88
 
89
  }
@@ -92,7 +92,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
92
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
93
  }else{
94
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_c">
95
- <p>Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI. <a href="admin.php?page=conversios"><b><u>View it from here.</u></b></a></p>
96
  </div>';
97
 
98
  }
@@ -128,29 +128,26 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
128
  if($_GET['page'] == "conversios_onboarding"){
129
  return;
130
  }
131
- wp_register_style('font_awesome', '//use.fontawesome.com/releases/v5.0.13/css/all.css');
132
- wp_enqueue_style('font_awesome');
133
- wp_register_style('plugin-bootstrap',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css');
134
  wp_enqueue_style('plugin-bootstrap');
135
- wp_enqueue_style('custom-css', ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css', array(), $this->version, 'all' );
136
  //if(is_rtl()){ }
137
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
138
- wp_register_style('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css');
139
  wp_enqueue_style('plugin-select2');
140
- wp_register_style('plugin-steps',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.css');
141
  wp_enqueue_style('plugin-steps');
142
- wp_register_style('tvc-dataTables-css', ENHANCAD_PLUGIN_URL.'/admin/css/dataTables.bootstrap4.min.css');
143
  wp_enqueue_style('tvc-dataTables-css');
144
  }
145
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
146
- wp_register_style('aga_confirm', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.css');
147
- wp_enqueue_style('aga_confirm');
148
- wp_register_style('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css');
149
  wp_enqueue_style('plugin-select2');
150
- wp_register_style('tvc-bootstrap-datepicker-css',ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css');
151
  wp_enqueue_style('tvc-bootstrap-datepicker-css');
152
  }
153
- wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css', array(), $this->version, 'all');
154
  }
155
  }
156
 
@@ -165,170 +162,36 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
165
  if($_GET['page'] == "conversios_onboarding"){
166
  return;
167
  }
168
- wp_enqueue_script( 'custom-jquery', ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js', array( 'jquery' ), $this->version, false );
169
- wp_register_script('popper_bootstrap', '//cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js');
170
  wp_enqueue_script('popper_bootstrap');
171
- wp_register_script('atvc_bootstrap', '//maxcdn.bootstrapcdn.com/bootstrap/4.5.1/js/bootstrap.min.js');
172
  wp_enqueue_script('atvc_bootstrap');
173
- wp_register_script('tvc_bootstrap_mod', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js');
174
- wp_enqueue_script('tvc_bootstrap_mod');
175
 
176
- wp_enqueue_script( 'tvc-ee-custom-js', ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js', array( 'jquery' ), $this->version, false );
177
 
178
- wp_enqueue_script( 'tvc-ee-slick-js', ENHANCAD_PLUGIN_URL . '/admin/js/slick.min.js', array( 'jquery' ), $this->version, false );
179
 
180
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
181
- wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
182
- wp_enqueue_script('plugin-select2');
183
- wp_register_script('plugin-step-js',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.js');
184
- wp_enqueue_script('plugin-step-js');
185
  }
186
  if($this->is_current_tab_in(array('sync_product_page'))){
187
- wp_enqueue_script( 'tvc-ee-dataTables-js', ENHANCAD_PLUGIN_URL . '/admin/js/jquery.dataTables.min.js', array( 'jquery' ), $this->version, false );
188
- wp_enqueue_script( 'tvc-ee-dataTables-1-js', ENHANCAD_PLUGIN_URL . '/admin/js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, false );
189
  }
190
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
191
- wp_register_script('tvc_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
192
- wp_enqueue_script('tvc_confirm_js');
193
- wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
194
  wp_enqueue_script('plugin-select2');
195
- wp_register_script('plugin-chart',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/chart/chart.js');
196
  wp_enqueue_script('plugin-chart');
197
- wp_register_script('tvc-bootstrap-datepicker-js',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js');
198
  wp_enqueue_script('tvc-bootstrap-datepicker-js');
199
  }
200
  }
201
  }
202
-
203
- public function create_head(){
204
- $google_detail = $this->google_detail;
205
- if(isset($google_detail['setting'])){
206
- $googleDetail = $google_detail['setting'];
207
- }
208
- $plan_name = "Free Plan";
209
- $plan_price = "";
210
- $product_sync_max_limit ="Products sync limit ( 100 )";
211
- $plan_id = 1;
212
- if(isset($googleDetail->plan_id) && !in_array($googleDetail->plan_id, array("1"))){
213
- $plan_id = $googleDetail->plan_id;
214
- }
215
- if(isset($googleDetail->plan_name) && !in_array($googleDetail->plan_id, array("1"))){
216
- $plan_name = $googleDetail->plan_name;
217
- }
218
- if(isset($googleDetail->price) && !in_array($googleDetail->plan_id, array("1"))){
219
- $plan_price = " (".$googleDetail->price." USD)";
220
- }
221
- if(isset($googleDetail->max_limit)){
222
- $max_limit = $googleDetail->max_limit;
223
- if(in_array($plan_id, array("7","8"))){
224
- $max_limit = "Unlimited";
225
- }
226
- $product_sync_max_limit = "Product sync limit ( ".$max_limit." )";
227
- }
228
- ?>
229
- <div class="container">
230
- <div class="header-section">
231
- <?php if($plan_id == 1){?>
232
- <div class="top-section">
233
- <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>
234
- </div>
235
- <?php } ?>
236
- <nav class="navbar navbar-section">
237
- <a class="navbar-brand">
238
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/logo.png'; ?>"/>
239
- </a>
240
- <div class="form-inline">
241
- <span class="nav-btn">
242
- <span class="badge badge-primary free-plan"><?php echo $plan_name; //echo $plan_price;?> - <?php echo $product_sync_max_limit; ?></span>
243
- </span>
244
- <?php $ee_msg_list = $this->get_ee_msg_nofification_list();
245
- $active_count = 0;
246
- if(!empty($ee_msg_list)){
247
- $html = "";
248
- foreach ($ee_msg_list as $key => $value) {
249
- if( isset($value["active"]) && $value["active"] == 1 ){
250
- $active_count++;
251
- $m_date = isset($value["date"])?"<span class=\"tvc-msg_date\">".$value["date"]."</span>":"";
252
- $m_title = isset($value["title"])?"<h4 class=\"tvc-msg_title\">".$value["title"]."</h4>":"";
253
- $m_html = isset($value["html"])?"<span class=\"tvc-msg_text\">".base64_decode($value["html"])."</span>":"";
254
- $target = (isset($value["link_type"]) && $value["link_type"] == "external")?"target=\"_blank\"":"";
255
- $m_link = isset($value["link"])?"<a ".$target." href=".$value["link"]." class=\"tvc-notification-button is-secondary\">".$value["link_title"]."</a>":"";
256
-
257
- $html.="<li>
258
- <section class=\"tvc-msg plain\">
259
- <div class=\"tvc-msg_wrapper\">
260
- <div class=\"tvc-msg_content\">".$m_title.$m_html."</div>
261
- <div class=\"tvc-msg_actions\">
262
- ".$m_link."
263
- <div class=\"tvc-dropdown\">
264
- <button type=\"button\" data-id=".$key." class=\"tvc-notification-button is-tertiary is-dismissible-notification\">Dismiss</button>
265
- </div>
266
- ".$m_date."
267
- </div>
268
- </div>
269
- </section>
270
- </li>";
271
- }
272
- }
273
- }
274
- ?>
275
- <div class="tvc-notification">
276
- <a href="javascript:void(0)" class="nav-btn" aria-haspopup="true" aria-expanded="false">
277
- <img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/icon/notification.svg'; ?>" alt="notification" class="nav-icon"/>
278
- <span class="badge badge-primary not-count"><?php echo $active_count; ?></span>
279
- </a>
280
- <?php if($html!=""){?>
281
- <div class="dropdown-menu tvc-notification-dropdown-menu">
282
- <ul>
283
- <?php echo $html; ?>
284
- </ul>
285
- <script>
286
- (function( $ ) {
287
- $('.tvc-notification a.nav-btn').on('click', function (event) {
288
- event.preventDefault();
289
- $(this).parent().toggleClass('show');
290
- $(".tvc-notification-dropdown-menu").toggleClass('show');
291
- });
292
- $('body').on('click', function (e) {
293
- if(!$('.tvc-notification').is(e.target) && $('.tvc-notification').has(e.target).length === 0 && $('.show').has(e.target).length === 0 ){
294
- $('.tvc-notification-dropdown-menu').removeClass('show');
295
- $('.tvc-notification').removeClass('show');
296
- }
297
- });
298
- $(function(){
299
- $( '.tvc-notification' ).on( 'click', '.is-dismissible-notification', function( event, el ) {
300
- var this_id = $(this);
301
- var ee_dismiss_id = $(this).attr("data-id");
302
- jQuery.post(tvc_ajax_url,{
303
- action: "tvc_call_notification_dismiss",
304
- data:{ee_dismiss_id:ee_dismiss_id},
305
- dataType: "json"
306
- },function( response ){
307
- var rsp = JSON.parse(response);
308
- if(rsp.status == "success"){
309
- this_id.parent().parent().parent().parent().parent().slideUp();
310
- }
311
- });
312
- });
313
- });
314
- })( jQuery );
315
- </script>
316
- </div>
317
- <?php } ?>
318
- </div>
319
-
320
- </div>
321
- </nav>
322
- </div>
323
- </div>
324
- <?php
325
- }
326
-
327
- public function check_nall_and_message($val, $msg, $msg_false){
328
- if((isset($val) && $val != "" && $val != 0) ){
329
- return $msg;
330
- }else{
331
- return $msg_false;
332
- }
333
- }
334
  }
62
  $this->pro_plan_site = $this->get_pro_plan_site();
63
  $this->google_detail = $this->get_ee_options_data();
64
  //remove container_old_ui_head hook once new UI all implemented
65
+ //add_action('container_old_ui_head',array($this,'create_head'));
66
  }
67
  public function tvc_admin_notice(){
68
  // add fixed message notification
72
  }else{
73
  if(!$this->get_subscriptionId()){
74
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_a">
75
+ <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.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("CONFIGURE NOW","conversios").'</u></b></a></p>
76
  </div>';
77
  }
78
  }
83
  $googleDetail = $google_detail['setting'];
84
  if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
85
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_b">
86
+ <p>'. __("Leverage the power of Google Shopping to reach out millions of shoppers across Google. Automate entire Google Shopping and get eligible for free listing when user searches on Google for products similar to your eCommerce business.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("Automate now","conversios").'</u></b></a></p>
87
  </div>';
88
 
89
  }
92
  if(isset($ee_additional_data['dismissed_ee_adimin_notic_c']) && $ee_additional_data['dismissed_ee_adimin_notic_c'] == 1){
93
  }else{
94
  echo '<div class="notice notice-info is-dismissible" data-id="ee_adimin_notic_c">
95
+ <p>'. __("Now access important eCommerce KPIs and Google Ads campaign performance data directly in your wordpress backend to improve your marketing ROI.","conversios").' <a href="admin.php?page=conversios"><b><u>'. __("View it from here.","conversios").'</u></b></a></p>
96
  </div>';
97
 
98
  }
128
  if($_GET['page'] == "conversios_onboarding"){
129
  return;
130
  }
131
+ wp_register_style('plugin-bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/bootstrap/css/bootstrap.min.css') );
 
 
132
  wp_enqueue_style('plugin-bootstrap');
133
+ wp_enqueue_style('custom-css', esc_url(ENHANCAD_PLUGIN_URL . '/admin/css/custom-style.css'), array(), $this->version, 'all' );
134
  //if(is_rtl()){ }
135
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
136
+ wp_register_style('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css') );
137
  wp_enqueue_style('plugin-select2');
138
+ wp_register_style('plugin-steps', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.css'));
139
  wp_enqueue_style('plugin-steps');
140
+ wp_register_style('tvc-dataTables-css', esc_url(ENHANCAD_PLUGIN_URL.'/admin/css/dataTables.bootstrap4.min.css'));
141
  wp_enqueue_style('tvc-dataTables-css');
142
  }
143
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
144
+
145
+ wp_register_style('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.css') );
 
146
  wp_enqueue_style('plugin-select2');
147
+ wp_register_style('tvc-bootstrap-datepicker-css', esc_url(ENHANCAD_PLUGIN_URL. '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.css'));
148
  wp_enqueue_style('tvc-bootstrap-datepicker-css');
149
  }
150
+ wp_enqueue_style($this->plugin_name, esc_url(plugin_dir_url(__FILE__) . 'css/enhanced-ecommerce-google-analytics-admin.css'), array(), $this->version, 'all');
151
  }
152
  }
153
 
162
  if($_GET['page'] == "conversios_onboarding"){
163
  return;
164
  }
165
+ wp_enqueue_script( 'custom-jquery', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery-3.5.1.min.js'), array( 'jquery' ), $this->version, false );
166
+ wp_register_script('popper_bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/popper.min.js') );
167
  wp_enqueue_script('popper_bootstrap');
168
+ wp_register_script('atvc_bootstrap', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/bootstrap.min.js') );
169
  wp_enqueue_script('atvc_bootstrap');
170
+ //wp_register_script('tvc_bootstrap_mod', 'https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js');
171
+ //wp_enqueue_script('tvc_bootstrap_mod');
172
 
173
+ wp_enqueue_script( 'tvc-ee-custom-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js'), array( 'jquery' ), $this->version, false );
174
 
175
+ wp_enqueue_script( 'tvc-ee-slick-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/slick.min.js'), array( 'jquery' ), $this->version, false );
176
 
177
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
178
+ wp_register_script('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js') );
179
+ wp_enqueue_script('plugin-select2');
180
+ wp_register_script('plugin-step-js', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/jquery-steps/jquery.steps.js') );
181
+ wp_enqueue_script('plugin-step-js');
182
  }
183
  if($this->is_current_tab_in(array('sync_product_page'))){
184
+ wp_enqueue_script( 'tvc-ee-dataTables-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/jquery.dataTables.min.js'), array( 'jquery' ), $this->version, false );
185
+ wp_enqueue_script( 'tvc-ee-dataTables-1-js', esc_url(ENHANCAD_PLUGIN_URL . '/admin/js/dataTables.bootstrap4.min.js'), array( 'jquery' ), $this->version, false );
186
  }
187
  if($this->is_current_tab_in(array("shopping_campaigns_page","add_campaign_page"))){
188
+ wp_register_script('plugin-select2', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js') );
 
 
189
  wp_enqueue_script('plugin-select2');
190
+ wp_register_script('plugin-chart', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/chart/chart.js'));
191
  wp_enqueue_script('plugin-chart');
192
+ wp_register_script('tvc-bootstrap-datepicker-js', esc_url(ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/datepicker/bootstrap-datepicker.min.js'));
193
  wp_enqueue_script('tvc-bootstrap-datepicker-js');
194
  }
195
  }
196
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
197
  }
admin/class-enhanced-ecommerce-google-analytics-settings.php CHANGED
@@ -1,14 +1,4 @@
1
  <?php
2
- /**
3
- * The admin-setting functionality of the plugin.
4
- *
5
- * @link tatvic.com
6
- * @since 1.0.0
7
- *
8
- * @package Enhanced_Ecommerce_Google_Analytics
9
- * @subpackage Enhanced_Ecommerce_Google_Analytics/admin
10
- */
11
-
12
  /**
13
  * The admin-setting functionality of the plugin.
14
  *
@@ -39,7 +29,7 @@ class Enhanced_Ecommerce_Google_Settings {
39
  $_POST[$key] = '';
40
  }
41
  if(isset($_POST[$key])) {
42
- $ee_options[$key] = $_POST[$key];
43
  }
44
  }
45
  }
@@ -59,7 +49,7 @@ class Enhanced_Ecommerce_Google_Settings {
59
  $_POST[$key] = '';
60
  }
61
  if( $_POST[$key] != $value ) {
62
- $get_ee_settings[$key] = $_POST[$key];
63
  }
64
  }
65
  }
@@ -70,7 +60,7 @@ class Enhanced_Ecommerce_Google_Settings {
70
  continue;
71
  }
72
  if(!array_key_exists($key,$get_ee_settings)){
73
- $get_ee_settings[$key] = $value;
74
  }
75
  }
76
  }
@@ -89,10 +79,10 @@ class Enhanced_Ecommerce_Google_Settings {
89
  continue;
90
  }
91
  if(!isset($_POST[$key])){
92
- $_POST[$key] = $value;
93
  }
94
  if(isset($_POST[$key])) {
95
- $ee_options[$key] = $_POST[$key];
96
  }
97
  }
98
  }
@@ -106,10 +96,10 @@ class Enhanced_Ecommerce_Google_Settings {
106
  continue;
107
  }
108
  if(!isset($_POST[$key])){
109
- $_POST[$key] = $value;
110
  }
111
  if( $_POST[$key] != $value && $_POST[$key] != '') {
112
- $get_ee_settings[$key] = $_POST[$key];
113
  }
114
  }
115
  }
@@ -121,11 +111,11 @@ class Enhanced_Ecommerce_Google_Settings {
121
  continue;
122
  }
123
  if(!array_key_exists($key,$get_ee_settings)){
124
- $get_ee_settings[$key] = $value;
125
  }
126
  }
127
  }
128
  update_option($settings, serialize( $get_ee_settings ));
129
  }
130
  }
131
- }
1
  <?php
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * The admin-setting functionality of the plugin.
4
  *
29
  $_POST[$key] = '';
30
  }
31
  if(isset($_POST[$key])) {
32
+ $ee_options[$key] = sanitize_text_field($_POST[$key]);
33
  }
34
  }
35
  }
49
  $_POST[$key] = '';
50
  }
51
  if( $_POST[$key] != $value ) {
52
+ $get_ee_settings[$key] = sanitize_text_field($_POST[$key]);
53
  }
54
  }
55
  }
60
  continue;
61
  }
62
  if(!array_key_exists($key,$get_ee_settings)){
63
+ $get_ee_settings[$key] = sanitize_text_field($value);
64
  }
65
  }
66
  }
79
  continue;
80
  }
81
  if(!isset($_POST[$key])){
82
+ $_POST[$key] = sanitize_text_field($value);
83
  }
84
  if(isset($_POST[$key])) {
85
+ $ee_options[$key] = sanitize_text_field($_POST[$key]);
86
  }
87
  }
88
  }
96
  continue;
97
  }
98
  if(!isset($_POST[$key])){
99
+ $_POST[$key] = sanitize_text_field($value);
100
  }
101
  if( $_POST[$key] != $value && $_POST[$key] != '') {
102
+ $get_ee_settings[$key] = sanitize_text_field($_POST[$key]);
103
  }
104
  }
105
  }
111
  continue;
112
  }
113
  if(!array_key_exists($key,$get_ee_settings)){
114
+ $get_ee_settings[$key] = sanitize_text_field($value);
115
  }
116
  }
117
  }
118
  update_option($settings, serialize( $get_ee_settings ));
119
  }
120
  }
121
+ }
admin/class-survey.php CHANGED
@@ -1,6 +1,5 @@
1
  <?php
2
- if ( ! class_exists( 'TVC_Survey' ) ) {
3
-
4
  class TVC_Survey {
5
  public $api_url = TVC_API_CALL_URL.'/customersurvey';
6
  public $name;
@@ -79,7 +78,7 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
79
  <script type="text/javascript">
80
  jQuery(function($){
81
  var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
82
- $overlay = $('#ee-survey-<?php echo $this->plugin; ?>'),
83
  $form = $overlay.find('form'),
84
  formOpen = false;
85
  // Plugin listing table deactivate link.
@@ -101,8 +100,8 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
101
  event.preventDefault();
102
  var data = {
103
  action:'tvc_call_add_survey',
104
- customer_id:'<?php echo $this->apiCustomerId; ?>',
105
- subscription_id:'<?php echo $this->subscriptionId; ?>',
106
  radio_option_val: "skip",
107
  other_reason: "",
108
  site_url: '<?php echo esc_url( home_url() ); ?>',
@@ -119,8 +118,8 @@ if ( ! class_exists( 'TVC_Survey' ) ) {
119
  }
120
  var data = {
121
  action:'tvc_call_add_survey',
122
- customer_id:'<?php echo $this->apiCustomerId; ?>',
123
- subscription_id:'<?php echo $this->subscriptionId; ?>',
124
  radio_option_val: $form.find('.selected input[type=radio]').val(),
125
  other_reason: $form.find('.selected input[type=text]').val(),
126
  site_url: '<?php echo esc_url( home_url() ); ?>',
1
  <?php
2
+ if ( ! class_exists( 'TVC_Survey' ) ) {
 
3
  class TVC_Survey {
4
  public $api_url = TVC_API_CALL_URL.'/customersurvey';
5
  public $name;
78
  <script type="text/javascript">
79
  jQuery(function($){
80
  var $deactivateLink = $('#the-list').find('[data-slug="<?php echo $this->plugin; ?>"] span.deactivate a'),
81
+ $overlay = $('#ee-survey-<?php echo esc_attr($this->plugin); ?>'),
82
  $form = $overlay.find('form'),
83
  formOpen = false;
84
  // Plugin listing table deactivate link.
100
  event.preventDefault();
101
  var data = {
102
  action:'tvc_call_add_survey',
103
+ customer_id:'<?php echo esc_attr($this->apiCustomerId); ?>',
104
+ subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
105
  radio_option_val: "skip",
106
  other_reason: "",
107
  site_url: '<?php echo esc_url( home_url() ); ?>',
118
  }
119
  var data = {
120
  action:'tvc_call_add_survey',
121
+ customer_id:'<?php echo esc_attr($this->apiCustomerId); ?>',
122
+ subscription_id:'<?php echo esc_attr($this->subscriptionId); ?>',
123
  radio_option_val: $form.find('.selected input[type=radio]').val(),
124
  other_reason: $form.find('.selected input[type=text]').val(),
125
  site_url: '<?php echo esc_url( home_url() ); ?>',
admin/class-tvc-admin-auto-product-sync-helper.php CHANGED
@@ -46,9 +46,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
46
  if ( $wpdb->get_var( $query ) === $tablename ) {
47
 
48
  }else{
49
- $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 , `g_attribute_mapping` LONGTEXT NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) );";
50
  if(maybe_create_table( $tablename, $sql_create )){
51
- $this->import_last_sync_in_db();
52
  }
53
  }
54
  /* cteate table for save auto sync product call */
@@ -56,7 +56,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
56
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
57
  if ( $wpdb->get_var( $query ) === $tablename ) {
58
  }else{
59
- $sql_create = "CREATE TABLE ".$tablename." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `sync_product_ids` LONGTEXT NULL, `w_total_product` INT(10) NOT NULL , `total_sync_product` INT(10) NOT NULL ,last_sync DATETIME NOT NULL, create_sync DATETIME NOT NULL, next_sync DATETIME NOT NULL, `last_sync_product_id` BIGINT(20) NOT NULL, `action_scheduler_id` INT(10) NOT NULL, `status` INT(1) NOT NULL COMMENT '0 failed, 1 completed', PRIMARY KEY (`id`) );";
60
  if(!maybe_create_table( $tablename, $sql_create )){ }
61
  }
62
 
@@ -65,15 +65,17 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
65
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
66
  if ( $wpdb->get_var( $query ) === $tablename ) {
67
  }else{
68
- $sql_create = "CREATE TABLE ".$tablename." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `gmc_id` VARCHAR(200) NOT NULL , `name` VARCHAR(200) NOT NULL , `product_id` VARCHAR(100) NOT NULL , `google_status` VARCHAR(50) NOT NULL , `image_link` VARCHAR(200) NOT NULL, `issues` LONGTEXT NOT NULL, PRIMARY KEY (`id`) );";
69
  if(maybe_create_table( $tablename, $sql_create )){
70
  $this->TVC_Admin_Helper->import_gmc_products_sync_in_db();
71
 
72
  $product_status = $this->TVC_Admin_DB_Helper->tvc_get_counts_groupby('ee_products_sync_list','google_status');
73
  $syncProductStat = array("approved" => 0, "disapproved" => 0, "pending" => 0 );
74
- foreach ($product_status as $key => $value) {
75
- if(isset($value['google_status']) ){
76
- $syncProductStat[$value['google_status']] = (isset($value['count']) && $value['count'] >0)?$value['count']:0;
 
 
77
  }
78
  }
79
  $syncProductStat["total"] = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_products_sync_list');
@@ -88,7 +90,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
88
  $output = [];
89
  $terms_ids = wp_get_post_terms( $product_id, 'product_cat', array('fields' => 'ids') );
90
  // Loop though terms ids (product categories)
91
- foreach( $terms_ids as $term_id ) {
 
92
  $term_names = [];
93
  // Loop through product category ancestors
94
  foreach( get_ancestors( $term_id, 'product_cat') as $ancestor_id ){
@@ -100,11 +103,12 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
100
  $term_names[] = get_term( $term_id, 'product_cat' )->name;
101
  // Add the formatted ancestors with the product category to main array
102
  $output[$term_id] = implode(' > ', $term_names);
 
103
  }
104
  $output = array_values($output);
105
  return $output;
106
  }
107
- public function import_last_sync_in_db(){
108
  $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
109
  $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
110
  if($ee_prod_mapped_cats != "" && $ee_prod_mapped_attrs != ""){
@@ -145,24 +149,31 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
145
  }
146
  }
147
  }
148
- }
149
-
 
 
150
  public function update_last_sync_in_db(){
151
  $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
152
  $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
153
  if($ee_prod_mapped_cats != "" && $ee_prod_mapped_attrs != "" &&!empty($ee_prod_mapped_cats)){
154
- global $wpdb;
 
155
  foreach($ee_prod_mapped_cats as $mc_key => $mappedCat){
 
 
 
156
  $args= array(
157
  'post_type' => 'product',
158
  'numberposts' => -1,
159
  'post_status' => 'publish',
160
- 'tax_query' => array( array(
161
  'taxonomy' => 'product_cat',
162
  'field' => 'term_id',
163
  'terms' =>$mc_key,
164
- 'operator' => 'IN'
165
- )
 
166
  )
167
  );
168
  $all_products = get_posts($args);
@@ -171,9 +182,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
171
  if(!empty($all_products)){
172
  foreach($all_products as $postkey => $postvalue){
173
  $t_data = array(
174
- 'w_product_id'=>$postvalue->ID,
175
- 'w_cat_id'=>$mc_key,
176
- 'g_cat_id'=>$mappedCat['id'],
177
  'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
178
  'update_date'=>date('Y-m-d')
179
  );
@@ -205,10 +216,10 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
205
  $postObj = (object) array_merge((array) get_post($postvalue->w_product_id), (array) $postmeta);
206
 
207
  $product = array(
208
- 'offer_id'=>$postvalue->w_product_id,
209
  'channel'=>'online',
210
  'link'=>get_permalink($postvalue->w_product_id),
211
- 'google_product_category'=>$postvalue->g_cat_id
212
  );
213
 
214
  $temp_product=array();
@@ -231,19 +242,20 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
231
  }
232
 
233
  $product = array_merge($temp_product,$product);
234
- if( !empty($prd) && $prd->get_type() == "variable" ){
 
235
  //$variation_attributes = $prd->get_variation_attributes();
236
  $p_variations = $prd->get_available_variations();
237
- if(!empty($p_variations)){
238
  foreach ($p_variations as $v_key => $v_value) {
239
  $postmeta_var = (object)$this->TVC_Admin_Helper->tvc_get_post_meta($v_value['variation_id']);
240
  $formArray_val = $formArray['title'];
241
  $product['title'] = (isset($postObj->$formArray_val))?$postObj->$formArray_val:get_the_title($postvalue->w_product_id);
242
  $tvc_temp_desc_key = $formArray['description'];
243
  $product['description'] = (isset($v_value['variation_description']) && $v_value['variation_description'] != "")?$v_value['variation_description']:$postObj->$tvc_temp_desc_key;
244
- $product['offer_id'] = $v_value['variation_id'];
245
- $product['id'] = $v_value['variation_id'];
246
- $product['item_group_id'] = $postvalue->w_product_id;
247
  $productTypes = $this->get_product_category($postvalue->w_product_id);
248
  if(!empty($productTypes)){
249
  $product['productTypes'] = $productTypes;
@@ -274,6 +286,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
274
  $product[$key]['value'] = $postmeta_var->_price;
275
  }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
276
  $product[$key]['value'] = $postmeta_var->_sale_price;
 
 
277
  }
278
  if(isset($product[$key]['value']) && $product[$key]['value'] >0){
279
  $product[$key]['currency'] = $tvc_currency;
@@ -285,6 +299,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
285
  $product[$key]['value'] = $postmeta_var->$value;
286
  }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
287
  $product[$key]['value'] = $postmeta_var->_sale_price;
 
 
288
  }
289
  if(isset($product[$key]['value']) && $product[$key]['value'] >0){
290
  $product[$key]['currency'] = $tvc_currency;
@@ -305,7 +321,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
305
  }
306
  }
307
  $item = [
308
- 'merchant_id' => $merchantId,
309
  'batch_id' => ++$batchId,
310
  'method' => 'insert',
311
  'product' => $product
@@ -314,7 +330,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
314
  }
315
  }
316
 
317
- }else if( !empty($prd) ){
318
  $image_id = $prd->get_image_id();
319
  $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
320
  $productTypes = $this->get_product_category($postvalue->w_product_id);
@@ -364,7 +380,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
364
  }
365
  }
366
  $item = [
367
- 'merchant_id' => $merchantId,
368
  'batch_id' => ++$batchId,
369
  'method' => 'insert',
370
  'product' => $product
@@ -380,15 +396,15 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
380
  //$count = 0;
381
  $pre_last_sync_product_id = $last_sync_product_id;
382
  if( $product_count > 0 ){
383
- $tvc_currency = $this->TVC_Admin_Helper->get_woo_currency();
384
- $merchantId = $this->TVC_Admin_Helper->get_merchantId();
385
- $customerId = $this->TVC_Admin_Helper->get_currentCustomerId();
386
- $accountId = $this->TVC_Admin_Helper->get_main_merchantId();
387
- $subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
388
- $last_sync_product_id =( $last_sync_product_id > 0)?$last_sync_product_id:0;
389
  global $wpdb;
390
  $tablename = $wpdb->prefix .'ee_product_sync_data';
391
- $sql = "select * from ".$tablename." where id > ".$last_sync_product_id." LIMIT ".$this->batch_size;
392
  $products = $wpdb->get_results($sql, OBJECT);
393
  $entries = [];
394
  if(!empty($products)){
@@ -396,9 +412,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
396
  if(!empty($p_map_attribute) && isset($p_map_attribute['items']) && !empty($p_map_attribute['items'])){
397
  // call product sync API
398
  $data = [
399
- 'merchant_id' => $accountId,
400
- 'account_id' => $merchantId,
401
- 'subscription_id' => $subscriptionId,
402
  'entries' => $p_map_attribute['items']
403
  ];
404
  $url = $this->apiDomain.'/products/batch';
@@ -449,8 +465,8 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
449
  }
450
  $t_data = array(
451
  'sync_product_ids'=>json_encode($sync_product_ids),
452
- 'w_total_product'=>$product_count,
453
- 'total_sync_product'=>$total_sync_product,
454
  'last_sync'=>$last_sync,
455
  'create_sync'=>date( 'Y-m-d H:i:s', current_time( 'timestamp') ),
456
  'next_sync'=>$next_sync,
@@ -469,7 +485,7 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
469
  if($row_count >0){
470
  if ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'ee_auto_product_sync_check' ) ) {
471
  //strtotime( 'midnight tonight' )
472
- as_schedule_recurring_action( strtotime( "+2 minutes" ), $this->time_space, 'ee_auto_product_sync_check',array("last_sync_product_id"=>0),"product_sync");
473
  }
474
  }
475
  }
@@ -505,9 +521,9 @@ if ( ! class_exists( 'TVC_Admin_Auto_Product_sync_Helper' ) ) {
505
  $refreshToken = $refresh_token;
506
  $data = [
507
  "grant_type" => 'refresh_token',
508
- "client_id" => $clientId,
509
- 'client_secret' => $clientSecret,
510
- 'refresh_token' => $refreshToken,
511
  ];
512
 
513
  $postData = json_encode($data);
46
  if ( $wpdb->get_var( $query ) === $tablename ) {
47
 
48
  }else{
49
+ $sql_create = "CREATE TABLE ".esc_sql($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 , `g_attribute_mapping` LONGTEXT NOT NULL , `update_date` DATE NOT NULL , `status` INT(1) NOT NULL DEFAULT '1', PRIMARY KEY (`id`) );";
50
  if(maybe_create_table( $tablename, $sql_create )){
51
+ //$this->import_last_sync_in_db();
52
  }
53
  }
54
  /* cteate table for save auto sync product call */
56
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
57
  if ( $wpdb->get_var( $query ) === $tablename ) {
58
  }else{
59
+ $sql_create = "CREATE TABLE ".esc_sql($tablename)." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT, `sync_product_ids` LONGTEXT NULL, `w_total_product` INT(10) NOT NULL , `total_sync_product` INT(10) NOT NULL ,last_sync DATETIME NOT NULL, create_sync DATETIME NOT NULL, next_sync DATETIME NOT NULL, `last_sync_product_id` BIGINT(20) NOT NULL, `action_scheduler_id` INT(10) NOT NULL, `status` INT(1) NOT NULL COMMENT '0 failed, 1 completed', PRIMARY KEY (`id`) );";
60
  if(!maybe_create_table( $tablename, $sql_create )){ }
61
  }
62
 
65
  $query = $wpdb->prepare( 'SHOW TABLES LIKE %s', $wpdb->esc_like( $tablename ) );
66
  if ( $wpdb->get_var( $query ) === $tablename ) {
67
  }else{
68
+ $sql_create = "CREATE TABLE ".esc_sql($tablename)." ( `id` BIGINT(20) NOT NULL AUTO_INCREMENT , `gmc_id` VARCHAR(200) NOT NULL , `name` VARCHAR(200) NOT NULL , `product_id` VARCHAR(100) NOT NULL , `google_status` VARCHAR(50) NOT NULL , `image_link` VARCHAR(200) NOT NULL, `issues` LONGTEXT NOT NULL, PRIMARY KEY (`id`) );";
69
  if(maybe_create_table( $tablename, $sql_create )){
70
  $this->TVC_Admin_Helper->import_gmc_products_sync_in_db();
71
 
72
  $product_status = $this->TVC_Admin_DB_Helper->tvc_get_counts_groupby('ee_products_sync_list','google_status');
73
  $syncProductStat = array("approved" => 0, "disapproved" => 0, "pending" => 0 );
74
+ if(!empty( $product_status)){
75
+ foreach ($product_status as $key => $value) {
76
+ if(isset($value['google_status']) ){
77
+ $syncProductStat[$value['google_status']] = esc_attr((isset($value['count']) && $value['count'] >0)?$value['count']:0);
78
+ }
79
  }
80
  }
81
  $syncProductStat["total"] = $this->TVC_Admin_DB_Helper->tvc_row_count('ee_products_sync_list');
90
  $output = [];
91
  $terms_ids = wp_get_post_terms( $product_id, 'product_cat', array('fields' => 'ids') );
92
  // Loop though terms ids (product categories)
93
+ if(!empty($terms_ids)){
94
+ foreach( $terms_ids as $term_id ) {
95
  $term_names = [];
96
  // Loop through product category ancestors
97
  foreach( get_ancestors( $term_id, 'product_cat') as $ancestor_id ){
103
  $term_names[] = get_term( $term_id, 'product_cat' )->name;
104
  // Add the formatted ancestors with the product category to main array
105
  $output[$term_id] = implode(' > ', $term_names);
106
+ }
107
  }
108
  $output = array_values($output);
109
  return $output;
110
  }
111
+ /*public function import_last_sync_in_db(){
112
  $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
113
  $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
114
  if($ee_prod_mapped_cats != "" && $ee_prod_mapped_attrs != ""){
149
  }
150
  }
151
  }
152
+ }*/
153
+ /*
154
+ * update last product sync data in DB table "ee_product_sync_data"
155
+ */
156
  public function update_last_sync_in_db(){
157
  $ee_prod_mapped_cats = unserialize(get_option('ee_prod_mapped_cats'));
158
  $ee_prod_mapped_attrs = unserialize(get_option('ee_prod_mapped_attrs'));
159
  if($ee_prod_mapped_cats != "" && $ee_prod_mapped_attrs != "" &&!empty($ee_prod_mapped_cats)){
160
+ global $wpdb;
161
+ $ee_product_sync_data =$wpdb->prefix ."ee_product_sync_data";
162
  foreach($ee_prod_mapped_cats as $mc_key => $mappedCat){
163
+ //delete old product data of the category
164
+ $query = "DELETE FROM $ee_product_sync_data where w_cat_id = %s";
165
+ $wpdb->query($wpdb->prepare( "$query", $mc_key ));
166
  $args= array(
167
  'post_type' => 'product',
168
  'numberposts' => -1,
169
  'post_status' => 'publish',
170
+ 'tax_query' => array( array(
171
  'taxonomy' => 'product_cat',
172
  'field' => 'term_id',
173
  'terms' =>$mc_key,
174
+ 'operator' => 'IN',
175
+ 'include_children' => false
176
+ )
177
  )
178
  );
179
  $all_products = get_posts($args);
182
  if(!empty($all_products)){
183
  foreach($all_products as $postkey => $postvalue){
184
  $t_data = array(
185
+ 'w_product_id'=>esc_sql($postvalue->ID),
186
+ 'w_cat_id'=>esc_sql($mc_key),
187
+ 'g_cat_id'=>esc_sql($mappedCat['id']),
188
  'g_attribute_mapping'=> json_encode($ee_prod_mapped_attrs),
189
  'update_date'=>date('Y-m-d')
190
  );
216
  $postObj = (object) array_merge((array) get_post($postvalue->w_product_id), (array) $postmeta);
217
 
218
  $product = array(
219
+ 'offer_id'=>esc_attr($postvalue->w_product_id),
220
  'channel'=>'online',
221
  'link'=>get_permalink($postvalue->w_product_id),
222
+ 'google_product_category'=>esc_attr($postvalue->g_cat_id)
223
  );
224
 
225
  $temp_product=array();
242
  }
243
 
244
  $product = array_merge($temp_product,$product);
245
+ // for variable
246
+ if( !empty($prd) && $prd->get_type() == "variable" ){
247
  //$variation_attributes = $prd->get_variation_attributes();
248
  $p_variations = $prd->get_available_variations();
249
+ if(!empty($p_variations)){
250
  foreach ($p_variations as $v_key => $v_value) {
251
  $postmeta_var = (object)$this->TVC_Admin_Helper->tvc_get_post_meta($v_value['variation_id']);
252
  $formArray_val = $formArray['title'];
253
  $product['title'] = (isset($postObj->$formArray_val))?$postObj->$formArray_val:get_the_title($postvalue->w_product_id);
254
  $tvc_temp_desc_key = $formArray['description'];
255
  $product['description'] = (isset($v_value['variation_description']) && $v_value['variation_description'] != "")?$v_value['variation_description']:$postObj->$tvc_temp_desc_key;
256
+ $product['offer_id'] = esc_attr($v_value['variation_id']);
257
+ $product['id'] = esc_attr($v_value['variation_id']);
258
+ $product['item_group_id'] = esc_attr($postvalue->w_product_id);
259
  $productTypes = $this->get_product_category($postvalue->w_product_id);
260
  if(!empty($productTypes)){
261
  $product['productTypes'] = $productTypes;
286
  $product[$key]['value'] = $postmeta_var->_price;
287
  }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
288
  $product[$key]['value'] = $postmeta_var->_sale_price;
289
+ }else{
290
+ unset($product[$key]);
291
  }
292
  if(isset($product[$key]['value']) && $product[$key]['value'] >0){
293
  $product[$key]['currency'] = $tvc_currency;
299
  $product[$key]['value'] = $postmeta_var->$value;
300
  }else if(isset($postmeta_var->_sale_price) && $postmeta_var->_sale_price && $postmeta_var->_sale_price >0 ){
301
  $product[$key]['value'] = $postmeta_var->_sale_price;
302
+ }else{
303
+ unset($product[$key]);
304
  }
305
  if(isset($product[$key]['value']) && $product[$key]['value'] >0){
306
  $product[$key]['currency'] = $tvc_currency;
321
  }
322
  }
323
  $item = [
324
+ 'merchant_id' => esc_attr($merchantId),
325
  'batch_id' => ++$batchId,
326
  'method' => 'insert',
327
  'product' => $product
330
  }
331
  }
332
 
333
+ }else if( !empty($prd) ){ // for somple product
334
  $image_id = $prd->get_image_id();
335
  $product['image_link'] = wp_get_attachment_image_url($image_id, 'full');
336
  $productTypes = $this->get_product_category($postvalue->w_product_id);
380
  }
381
  }
382
  $item = [
383
+ 'merchant_id' => esc_attr($merchantId),
384
  'batch_id' => ++$batchId,
385
  'method' => 'insert',
386
  'product' => $product
396
  //$count = 0;
397
  $pre_last_sync_product_id = $last_sync_product_id;
398
  if( $product_count > 0 ){
399
+ $tvc_currency = esc_attr($this->TVC_Admin_Helper->get_woo_currency());
400
+ $merchantId = esc_attr($this->TVC_Admin_Helper->get_merchantId());
401
+ $customerId = esc_attr($this->TVC_Admin_Helper->get_currentCustomerId());
402
+ $accountId = esc_attr($this->TVC_Admin_Helper->get_main_merchantId());
403
+ $subscriptionId = esc_attr($this->TVC_Admin_Helper->get_subscriptionId());
404
+ $last_sync_product_id =esc_attr(( $last_sync_product_id > 0)?$last_sync_product_id:0);
405
  global $wpdb;
406
  $tablename = $wpdb->prefix .'ee_product_sync_data';
407
+ $sql = "select * from ".esc_sql($tablename)." where id > ".esc_sql($last_sync_product_id)." LIMIT ".$this->batch_size;
408
  $products = $wpdb->get_results($sql, OBJECT);
409
  $entries = [];
410
  if(!empty($products)){
412
  if(!empty($p_map_attribute) && isset($p_map_attribute['items']) && !empty($p_map_attribute['items'])){
413
  // call product sync API
414
  $data = [
415
+ 'merchant_id' => esc_attr($accountId),
416
+ 'account_id' => esc_attr($merchantId),
417
+ 'subscription_id' => esc_attr($subscriptionId),
418
  'entries' => $p_map_attribute['items']
419
  ];
420
  $url = $this->apiDomain.'/products/batch';
465
  }
466
  $t_data = array(
467
  'sync_product_ids'=>json_encode($sync_product_ids),
468
+ 'w_total_product'=>esc_attr($product_count),
469
+ 'total_sync_product'=>esc_attr($total_sync_product),
470
  'last_sync'=>$last_sync,
471
  'create_sync'=>date( 'Y-m-d H:i:s', current_time( 'timestamp') ),
472
  'next_sync'=>$next_sync,
485
  if($row_count >0){
486
  if ( function_exists( 'as_next_scheduled_action' ) && false === as_next_scheduled_action( 'ee_auto_product_sync_check' ) ) {
487
  //strtotime( 'midnight tonight' )
488
+ as_schedule_recurring_action( strtotime( "+2 minutes" ), esc_attr($this->time_space), 'ee_auto_product_sync_check',array("last_sync_product_id"=>0),"product_sync");
489
  }
490
  }
491
  }
521
  $refreshToken = $refresh_token;
522
  $data = [
523
  "grant_type" => 'refresh_token',
524
+ "client_id" => esc_attr($clientId),
525
+ 'client_secret' => esc_attr($clientSecret),
526
+ 'refresh_token' => esc_attr($refreshToken),
527
  ];
528
 
529
  $postData = json_encode($data);
admin/class-tvc-admin-db-helper.php CHANGED
@@ -17,7 +17,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
17
  }else{
18
  global $wpdb;
19
  $tablename = $wpdb->prefix .$table;
20
- $sql = "select count(".$field_name.") from ".$tablename;
21
  return $wpdb->get_var($sql);
22
  }
23
  }
@@ -28,7 +28,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
28
  }else{
29
  global $wpdb;
30
  $tablename = $wpdb->prefix .$table;
31
- return $wpdb->insert($tablename, $t_data);
32
  }
33
  }
34
 
@@ -38,7 +38,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
38
  }else{
39
  global $wpdb;
40
  $tablename = $wpdb->prefix .$table;
41
- return $wpdb->update($tablename, $t_data, $where);
42
  }
43
  }
44
 
@@ -52,7 +52,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
52
  foreach ($where as $key => $value) {
53
  $key=($key!="")?$key."=%d":", ".$key."=%d";
54
  }
55
- $sql = $wpdb->prepare("select count(".$field_name.") from ".$tablename. "where ".$key,$where);
56
  return $wpdb->get_var($sql);
57
  }
58
  return ;
@@ -64,7 +64,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
64
  if($table =="" || $where == ""){
65
  return;
66
  }else{
67
- $sql = "select count(*) from ".$tablename." where ".$where;
68
  return $wpdb->get_var($sql);
69
  }
70
  }
@@ -77,11 +77,11 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
77
  }else{
78
  if($concat == true){
79
  $fields = implode(',\'_\',', $fields);
80
- $sql = "select CONCAT(".$fields.") as p_c_id from ".$tablename." where ".$where;
81
  return $wpdb->get_col($sql);
82
  }else{
83
  $fields = implode(',', $fields);
84
- $sql = "select ".$fields." from ".$tablename." where ".$where;
85
  return $wpdb->get_results($sql, ARRAY_A);
86
  }
87
  }
@@ -99,10 +99,10 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
99
  }
100
  if( !empty($fields) ) {
101
  $fields = implode(',', $fields);
102
- $sql = "select ".$fields." from ".$tablename." ".$p_where." ".$where;
103
  return $wpdb->get_results($sql);
104
  }else{
105
- $sql = "select * from ".$tablename." ".$p_where." ".$where;
106
  return $wpdb->get_results($sql);
107
  }
108
  }
@@ -114,10 +114,10 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
114
  }else{
115
  global $wpdb;
116
  $tablename = $wpdb->prefix .$table;
117
- $sql = "select * from ".$tablename." ORDER BY id DESC LIMIT 1";
118
  if($fields){
119
  $fields = implode(',', $fields);
120
- $sql = "select ".$fields." from ".$tablename." ORDER BY id DESC LIMIT 1";
121
  }
122
 
123
  return $wpdb->get_row($sql,ARRAY_A);
@@ -130,7 +130,7 @@ if ( ! class_exists( 'TVC_Admin_DB_Helper' ) ) {
130
  if($table =="" || $fields_by == ""){
131
  return;
132
  }else{
133
- $sql = "select ".$fields_by.", count(*) as count from ".$tablename." GROUP BY ".$fields_by." ORDER BY count DESC ";
134
  return $wpdb->get_results($sql, ARRAY_A);
135
  }
136
  }
@@ -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 ".$table);
143
  }
144
  }
145
  }
17
  }else{
18
  global $wpdb;
19
  $tablename = $wpdb->prefix .$table;
20
+ $sql = "select count(".esc_sql($field_name).") from ".esc_sql($tablename);
21
  return $wpdb->get_var($sql);
22
  }
23
  }
28
  }else{
29
  global $wpdb;
30
  $tablename = $wpdb->prefix .$table;
31
+ return $wpdb->insert(esc_sql($tablename), $t_data);
32
  }
33
  }
34
 
38
  }else{
39
  global $wpdb;
40
  $tablename = $wpdb->prefix .$table;
41
+ return $wpdb->update(esc_sql($tablename), $t_data, $where);
42
  }
43
  }
44
 
52
  foreach ($where as $key => $value) {
53
  $key=($key!="")?$key."=%d":", ".$key."=%d";
54
  }
55
+ $sql = $wpdb->prepare("select count(".$field_name.") from ".esc_sql($tablename). "where ".$key, $where);
56
  return $wpdb->get_var($sql);
57
  }
58
  return ;
64
  if($table =="" || $where == ""){
65
  return;
66
  }else{
67
+ $sql = "select count(*) from ".esc_sql($tablename)." where ".$where;
68
  return $wpdb->get_var($sql);
69
  }
70
  }
77
  }else{
78
  if($concat == true){
79
  $fields = implode(',\'_\',', $fields);
80
+ $sql = "select CONCAT(".$fields.") as p_c_id from ".esc_sql($tablename)." where ".$where;
81
  return $wpdb->get_col($sql);
82
  }else{
83
  $fields = implode(',', $fields);
84
+ $sql = "select ".esc_sql($fields)." from ".esc_sql($tablename)." where ".$where;
85
  return $wpdb->get_results($sql, ARRAY_A);
86
  }
87
  }
99
  }
100
  if( !empty($fields) ) {
101
  $fields = implode(',', $fields);
102
+ $sql = "select ".$fields." from ".esc_sql($tablename)." ".$p_where." ".$where;
103
  return $wpdb->get_results($sql);
104
  }else{
105
+ $sql = "select * from ".esc_sql($tablename)." ".$p_where." ".$where;
106
  return $wpdb->get_results($sql);
107
  }
108
  }
114
  }else{
115
  global $wpdb;
116
  $tablename = $wpdb->prefix .$table;
117
+ $sql = "select * from ".esc_sql($tablename)." ORDER BY id DESC LIMIT 1";
118
  if($fields){
119
  $fields = implode(',', $fields);
120
+ $sql = "select ".$fields." from ".esc_sql($tablename)." ORDER BY id DESC LIMIT 1";
121
  }
122
 
123
  return $wpdb->get_row($sql,ARRAY_A);
130
  if($table =="" || $fields_by == ""){
131
  return;
132
  }else{
133
+ $sql = "select ".$fields_by.", count(*) as count from ".esc_sql($tablename)." GROUP BY ".$fields_by." ORDER BY count DESC ";
134
  return $wpdb->get_results($sql, ARRAY_A);
135
  }
136
  }
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 ".esc_sql($table));
143
  }
144
  }
145
  }
admin/class-tvc-admin-helper.php CHANGED
@@ -115,7 +115,7 @@ Class TVC_Admin_Helper{
115
  $googleDetail = $google_detail->data;
116
  }
117
  }else{
118
- return array("error"=>true, "message"=>"Please try after some time.");
119
  }
120
  }
121
  $syncProductStat = [];
@@ -157,7 +157,7 @@ Class TVC_Admin_Helper{
157
  }
158
 
159
  $this->set_ee_options_data(array("setting" => $googleDetail, "prod_sync_status" => (object) $syncProductStat, "campaigns_list"=>$campaigns_list, "sync_time"=>current_time( 'timestamp' )));
160
- return array("error"=>false, "message"=>"Details updated successfully.");
161
  }
162
  /*
163
  * update remarketing snippets
@@ -501,19 +501,19 @@ Class TVC_Admin_Helper{
501
  }
502
 
503
  public function get_gmcAttributes() {
504
- $path = ENHANCAD_PLUGIN_URL . '/includes/setup/json/gmc_attrbutes.json';
505
  $str = file_get_contents($path);
506
  $attributes = $str ? json_decode($str, true) : [];
507
  return $attributes;
508
  }
509
  public function get_gmc_countries_list() {
510
- $path = ENHANCAD_PLUGIN_URL . '/includes/setup/json/countries.json';
511
  $str = file_get_contents($path);
512
  $attributes = $str ? json_decode($str, true) : [];
513
  return $attributes;
514
  }
515
  public function get_gmc_language_list() {
516
- $path = ENHANCAD_PLUGIN_URL . '/includes/setup/json/iso_lang.json';
517
  $str = file_get_contents($path);
518
  $attributes = $str ? json_decode($str, true) : [];
519
  return $attributes;
@@ -523,10 +523,10 @@ Class TVC_Admin_Helper{
523
  if($name){
524
  $countries_list = $this->get_gmc_language_list();
525
  ?>
526
- <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
527
- <option value=""><?php echo $label; ?></option>
528
  <?php foreach ($countries_list as $Key => $val) {?>
529
- <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"]." (".$val["native_name"].")";?></option>
530
  <?php
531
  }?>
532
  </select>
@@ -538,10 +538,10 @@ Class TVC_Admin_Helper{
538
  $countries_list = $this->get_gmc_countries_list();
539
  $sel_val = $this->get_woo_country();
540
  ?>
541
- <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
542
- <option value=""><?php echo $label; ?></option>
543
  <?php foreach ($countries_list as $Key => $val) {?>
544
- <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"];?></option>
545
  <?php
546
  }?>
547
  </select>
@@ -551,10 +551,10 @@ Class TVC_Admin_Helper{
551
  public function tvc_select($name, $class_id="", string $label="Please Select", string $sel_val = null, bool $require = false, $option_list = array()){
552
  if(!empty($option_list) && $name){
553
  ?>
554
- <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
555
- <option value=""><?php echo $label; ?></option>
556
  <?php foreach ($option_list as $Key => $val) {?>
557
- <option value="<?php echo $val["field"];?>" <?php echo($val["field"] == $sel_val)?"selected":""; ?>><?php echo $val["field"];?></option>
558
  <?php
559
  }?>
560
  </select>
@@ -563,7 +563,7 @@ Class TVC_Admin_Helper{
563
  }
564
  public function tvc_text($name, string $type="text", string $class_id="", string $label=null, $sel_val = null, bool $require = false){
565
  ?>
566
- <input type="<?php echo $type; ?>" name="<?php echo $name; ?>" class="tvc-text <?php echo $class_id; ?>" id="<?php echo $class_id; ?>" placeholder="<?php echo $label; ?>" value="<?php echo $sel_val; ?>">
567
  <?php
568
  }
569
 
@@ -578,16 +578,16 @@ Class TVC_Admin_Helper{
578
  $googleDetail = $google_detail['setting'];
579
  //for google analytic
580
  if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "BOTH" ){
581
- if($googleDetail->property_id != "" && $googleDetail->measurement_id != ""){
582
- $setting_status['google_analytic']= true;
583
- $setting_status['google_analytic_msg']= "";
584
- }else if($googleDetail->property_id == "" ){
585
- $setting_status['google_analytic']= false;
586
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a href='".esc_url($this->get_onboarding_page_url())."'>click here</a>.";
587
- }else if($googleDetail->measurement_id == "" ){
588
- $setting_status['google_analytic']= false;
589
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a href='".esc_url($this->get_onboarding_page_url())."'>click here</a>.";
590
- }
591
  }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
592
  if( $googleDetail->measurement_id != ""){
593
  $setting_status['google_analytic']= true;
@@ -656,20 +656,17 @@ Class TVC_Admin_Helper{
656
  if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"is_site_verified") && property_exists($googleDetail,"is_domain_claim") && property_exists($googleDetail,"google_ads_id")){
657
  if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != "" && $googleDetail->is_site_verified == 1 && $googleDetail->is_domain_claim == 1 ){
658
  $setting_status['google_shopping_conf']= true;
659
- $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
660
  }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
661
  $setting_status['google_shopping_conf']= false;
662
  $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a href='".esc_url($this->get_onboarding_page_url())."'>click here</a>.";
663
  }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
664
  $setting_status['google_shopping_conf']= false;
665
- $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
666
  }else if($googleDetail->is_site_verified ==0 ){
667
  $setting_status['google_shopping_conf']= false;
668
- $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
669
- }/*else if($googleDetail->is_domain_claim ==0 ){
670
- $setting_status['google_shopping_conf']= false;
671
- $setting_status['google_shopping_conf_msg']= "Domain claim is pending. Your store url may be linked to other merchant center account.";
672
- } */
673
  }else{
674
  $setting_status['google_shopping_conf']= false;
675
  $missing="";
@@ -687,13 +684,13 @@ Class TVC_Admin_Helper{
687
 
688
  if($sync_product_total > 1 && $sync_product_approved > 1 && $sync_product_disapproved < 1){
689
  $setting_status['google_shopping_p_sync']= true;
690
- $setting_status['google_shopping_p_sync_msg']= "Google Shopping product sync is a success.";
691
  }else if($sync_product_total < 1){
692
  $setting_status['google_shopping_p_sync']= false;
693
- $setting_status['google_shopping_p_sync_msg']= "Sync your product data into Merchant center and get eligible for free listing across Google.";
694
  }else if($sync_product_disapproved > 0){
695
  $setting_status['google_shopping_p_sync']= false;
696
- $setting_status['google_shopping_p_sync_msg']= "There seems to be some problem with your product data. Rectify the issues by selecting right attributes.";
697
  }
698
  }
699
  }else{
@@ -708,13 +705,13 @@ Class TVC_Admin_Helper{
708
  $totalCampaigns = count($campaigns_list);
709
  if($totalCampaigns < 1){
710
  $setting_status['google_shopping_p_campaigns']= false;
711
- $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
712
  }else{
713
  $setting_status['google_shopping_p_campaigns']= true;
714
  }
715
  }else{
716
  $setting_status['google_shopping_p_campaigns']= false;
717
- $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
718
  }
719
  }else{
720
  $setting_status['google_shopping_p_campaigns']= false;
@@ -748,7 +745,7 @@ Class TVC_Admin_Helper{
748
  }
749
  public function get_tvc_product_cat_list_with_name(){
750
  $args = array(
751
- 'hide_empty' => 1,
752
  'taxonomy' => 'product_cat',
753
  'orderby' => 'term_id'
754
  );
@@ -770,16 +767,16 @@ Class TVC_Admin_Helper{
770
  $notice_text ="";
771
  $call_js_function_args="";
772
  if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
773
- $title = "Site verification and Domain claim for merchant center account failed.";
774
- $message = "Without a verified and claimed website, your product will get disapproved.";
775
  $call_js_function_args = "both";
776
  }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
777
- $title = "Site verification for merchant center account failed.";
778
- $message = "Without a verified and claimed website, your product will get disapproved.";
779
  $call_js_function_args = "site_verified";
780
  }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
781
- $title = "Site verification for merchant center account failed.";
782
- $message = "Without a verified and claimed website, your product will get disapproved.";
783
  $call_js_function_args = "domain_claim";
784
  }
785
  if($message!= "" && $title != ""){
@@ -787,11 +784,11 @@ Class TVC_Admin_Helper{
787
  <div class="errormsgtopbx claimalert">
788
  <div class="errmscntbx">
789
  <div class="errmsglft">
790
- <span class="errmsgicon"><img src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/error-white-icon.png'; ?>" alt="error" /></span>
791
  </div>
792
  <div class="erralertrigt">
793
  <h6><?php echo $title; ?></h6>
794
- <p><?php echo $message; ?> <a href="javascript:void(0)" id="call_both_verification" onclick="call_tvc_site_verified_and_domain_claim('<?php echo $call_js_function_args; ?>');">Click here</a> to verify and claim the domain.</p>
795
  </div>
796
  </div>
797
  </div>
@@ -858,7 +855,7 @@ Class TVC_Admin_Helper{
858
  if(isset($google_detail['setting']) && $google_detail['setting']){
859
  $googleDetail = $google_detail['setting'];
860
  if($googleDetail->is_site_verified == '0'){
861
- return array('error'=>true, 'msg'=>"First need to verified your site. Click on site verification refresh icon to verified your site.");
862
  }else if(property_exists($googleDetail,"is_domain_claim") && $googleDetail->is_domain_claim == '0'){
863
  //'website_url' => $googleDetail->site_url,
864
  $postData = [
@@ -872,10 +869,10 @@ Class TVC_Admin_Helper{
872
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
873
  }else{
874
  $this->update_subscription_details_api_to_db();
875
- return array('error'=>false, 'msg'=>"Domain claimed successfully.");
876
  }
877
  }else{