Enhanced Ecommerce Google Analytics Plugin for WooCommerce - Version 3.0.3

Version Description

  • 30/03/2021 =
    • Added double check for auto site verification for merchant center accounts
    • Added double check for auto domain claim for merchant center accounts
    • Bug fix for HTTP_HOST php warning raised by some clients
    • User friendly feature notifications
    • Removal of Brand, GTIN and MPN custom product meta fields addition from the plugin
Download this release

Release Info

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

Code changes from version 3.0.2 to 3.0.3

admin/class-enhanced-ecommerce-google-analytics-admin.php CHANGED
@@ -51,17 +51,38 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
51
  protected $ga_id;
52
  protected $ga_LC;
53
  protected $ga_eeT;
54
- protected $setting_status;
55
  protected $site_url;
56
  public function __construct($plugin_name, $version) {
57
  $this->plugin_name = $plugin_name;
58
  $this->version = $version;
59
- $this->accessToken = isset($_GET['access_token']) ? $_GET['access_token'] : '';
60
- $this->refreshToken = isset($_GET['refresh_token']) ? $_GET['refresh_token'] : '';
61
- $this->email = isset($_GET['email']) ? $_GET['email'] : '';
62
  $this->url = $this->get_connect_url();
63
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
64
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
 
66
  /**
67
  * Register the stylesheets for the admin area.
@@ -113,7 +134,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
113
  wp_enqueue_script('aga_bootstrap_mod');
114
  wp_register_script('aga_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
115
  wp_enqueue_script('aga_confirm_js');
116
- // wp_enqueue_script($this->plugin_name, plugin_dir_url(__FILE__) . 'js/enhanced-ecommerce-google-analytics-admin.js', array('jquery'), $this->version, false);
117
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
118
  wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
119
  wp_enqueue_script('plugin-select2');
@@ -166,6 +187,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
166
  echo '<div class="tvc_plugin_container">';
167
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
168
  new TVC_Tabs();
 
169
  if (!empty($_GET['tab'])) {
170
  $get_action = $_GET['tab'];
171
  } else {
@@ -175,6 +197,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
175
  $this->$get_action();
176
  }
177
  echo '</div>';
 
178
  }
179
  public function check_nall_and_message($val, $msg, $msg_false){
180
  if((isset($val) && $val != "" && $val != 0) ){
@@ -183,161 +206,7 @@ class Enhanced_Ecommerce_Google_Analytics_Admin extends TVC_Admin_Helper {
183
  return $msg_false;
184
  }
185
  }
186
- public function check_setting_status(){
187
- if(!empty($this->setting_status)){
188
- return $this->setting_status;
189
- }else{
190
- $google_detail = $this->get_ee_options_data();
191
- $setting_status = array();
192
- if(isset($google_detail['setting'])){
193
- $googleDetail = $google_detail['setting'];
194
- //for google analytic
195
- if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "BOTH" ){
196
- if($googleDetail->property_id != "" && $googleDetail->measurement_id != ""){
197
- $setting_status['google_analytic']= true;
198
- $setting_status['google_analytic_msg']= "";
199
- }else if($googleDetail->property_id == "" ){
200
- $setting_status['google_analytic']= false;
201
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
202
- }else if($googleDetail->measurement_id == "" ){
203
- $setting_status['google_analytic']= false;
204
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
205
- }
206
- }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
207
- if( $googleDetail->measurement_id != ""){
208
- $setting_status['google_analytic']= true;
209
- $setting_status['google_analytic_msg']= "";
210
- }else{
211
- $setting_status['google_analytic']= false;
212
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
213
- }
214
- }else if(isset($googleDetail->tracking_option) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "UA" ){
215
- if($googleDetail->property_id != ""){
216
- $setting_status['google_analytic']= true;
217
- $setting_status['google_analytic_msg']= "";
218
- }else{
219
- $setting_status['google_analytic']= false;
220
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
221
- }
222
- }else{
223
- $setting_status['google_analytic']= false;
224
- $setting_status['google_analytic_msg']= "";
225
- }
226
- // for google shopping
227
- if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"google_ads_id") ){
228
- //main tab
229
- if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
230
- $setting_status['google_shopping']= true;
231
- $setting_status['google_shopping_msg']= "";
232
- }else if($googleDetail->google_merchant_center_id == ""){
233
- $setting_status['google_shopping']= false;
234
- $setting_status['google_shopping_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
235
- }else if($googleDetail->google_ads_id == ""){
236
- $setting_status['google_shopping']= false;
237
- $setting_status['google_shopping_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
238
- }
239
- }else{
240
- $setting_status['google_shopping']= false;
241
- $setting_status['google_shopping_msg']= "";
242
- }
243
-
244
- //google_ads_id
245
- if(property_exists($googleDetail,"google_ads_id") && property_exists($googleDetail,"google_merchant_center_id") ){
246
- if( $googleDetail->google_ads_id != "" && $googleDetail->google_merchant_center_id != ""){
247
- $setting_status['google_ads']= true;
248
- $setting_status['google_ads_msg']= "";
249
- }else if($googleDetail->google_merchant_center_id == ""){
250
- $setting_status['google_ads']= false;
251
- $setting_status['google_ads_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
252
- }else if($googleDetail->google_ads_id == ""){
253
- $setting_status['google_ads']= false;
254
- $setting_status['google_ads_msg']= "Configure Google Ads account to reach to millions of interested shoppers <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
255
- }
256
- }else{
257
- $setting_status['google_ads']= false;
258
- $setting_status['google_ads_msg']= "";
259
- }
260
- }
261
- $this->setting_status = $setting_status;
262
- return $setting_status;
263
- }
264
- }
265
- public function check_setting_status_sub_tabs(){
266
- $google_detail = $this->get_ee_options_data();
267
- $setting_status = array();
268
- if(isset($google_detail['setting'])){
269
- $googleDetail = $google_detail['setting'];
270
- //sub tab shopping config
271
- 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")){
272
- if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != "" && $googleDetail->is_site_verified == 1 && $googleDetail->is_domain_claim == 1 ){
273
- $setting_status['google_shopping_conf']= true;
274
- $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
275
- }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
276
- $setting_status['google_shopping_conf']= false;
277
- $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
278
- }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
279
- $setting_status['google_shopping_conf']= false;
280
- $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
281
- }else if($googleDetail->is_site_verified ==0 ){
282
- $setting_status['google_shopping_conf']= false;
283
- $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
284
- }else if($googleDetail->is_domain_claim ==0 ){
285
- $setting_status['google_shopping_conf']= false;
286
- $setting_status['google_shopping_conf_msg']= "Domain claim is pending. Your store url may be linked to other merchant center account.";
287
- }
288
- }else{
289
- $setting_status['google_shopping_conf']= false;
290
- $missing="";
291
- }
292
- //sub tab product sync
293
- $syncProductList = [];
294
- $syncProductStat = [];
295
- if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
296
- if(isset($google_detail['prod_sync_status']) && $google_detail['prod_sync_status']){
297
- $syncProductStat = $google_detail['prod_sync_status'];
298
- $sync_product_total = (!empty($syncProductStat)) ? $syncProductStat->total : "0";
299
- $sync_product_approved = (!empty($syncProductStat)) ? $syncProductStat->approved : "0";
300
- $sync_product_disapproved = (!empty($syncProductStat)) ? $syncProductStat->disapproved : "0";
301
- $sync_product_pending = (!empty($syncProductStat)) ? $syncProductStat->pending : "0";
302
-
303
- if($sync_product_total > 1 && $sync_product_approved > 1 && $sync_product_disapproved < 1){
304
- $setting_status['google_shopping_p_sync']= true;
305
- $setting_status['google_shopping_p_sync_msg']= "Google Shopping product sync is a success.";
306
- }else if($sync_product_total < 1){
307
- $setting_status['google_shopping_p_sync']= false;
308
- $setting_status['google_shopping_p_sync_msg']= "Sync your product data into Merchant center and get eligible for free listing across Google.";
309
- }else if($sync_product_disapproved > 0){
310
- $setting_status['google_shopping_p_sync']= false;
311
- $setting_status['google_shopping_p_sync_msg']= "There seems to be some problem with your product data. Rectify the issues by selecting right attributes.";
312
- }
313
- }
314
- }else{
315
- $setting_status['google_shopping_p_sync']= false;
316
- $setting_status['google_shopping_p_sync_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
317
- }
318
-
319
- //sub tab product Campaigns
320
- if(property_exists($googleDetail,"google_merchant_center_id") && $googleDetail->google_merchant_center_id != ''){
321
- if(isset($google_detail['campaigns_list']) && $google_detail['campaigns_list']){
322
- $campaigns_list = $google_detail['campaigns_list'];
323
- $totalCampaigns = count($campaigns_list);
324
- if($totalCampaigns < 1){
325
- $setting_status['google_shopping_p_campaigns']= false;
326
- $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
327
- }else{
328
- $setting_status['google_shopping_p_campaigns']= true;
329
- }
330
- }else{
331
- $setting_status['google_shopping_p_campaigns']= false;
332
- $setting_status['google_shopping_p_campaigns_msg']= "Reach out to customers based on their past site behavior by running start shopping campaign.";
333
- }
334
- }else{
335
- $setting_status['google_shopping_p_campaigns']= false;
336
- $setting_status['google_shopping_p_campaigns_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
337
- }
338
- }
339
- return $setting_status;
340
- }
341
  public function general_settings() {
342
  require_once( 'partials/general-fields.php');
343
  }
51
  protected $ga_id;
52
  protected $ga_LC;
53
  protected $ga_eeT;
 
54
  protected $site_url;
55
  public function __construct($plugin_name, $version) {
56
  $this->plugin_name = $plugin_name;
57
  $this->version = $version;
 
 
 
58
  $this->url = $this->get_connect_url();
59
  $this->site_url = "admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=";
60
  }
61
+ public function tvc_admin_notice(){
62
+ //global $pagenow;
63
+ if(!$this->get_subscriptionId()){
64
+ echo '<div class="notice notice-info is-dismissible">
65
+ <p>Tatvic EE plugin is now fully compatible with Google Analytics 4. Also, explore the new features of Google Shopping and Dynamic remarketing to reach million of shoppers across Google and scale your eCommerce business faster. <a href="admin.php?page=enhanced-ecommerce-google-analytics-admin-display"><b><u>CONFIGURE NOW</u></b></a></p>
66
+ </div>';
67
+ }
68
+ $google_detail = $this->get_ee_options_data();
69
+ if(isset($google_detail['setting']) && $google_detail['setting']){
70
+ $googleDetail = $google_detail['setting'];
71
+ if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id =="" && $this->subscriptionId != "" ){
72
+ echo '<div class="notice notice-info is-dismissible">
73
+ <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=enhanced-ecommerce-google-analytics-admin-display"><b><u>Automate now</u></b></a></p>
74
+ </div>';
75
+ ?>
76
+ <style>
77
+ <?php
78
+
79
+ }
80
+ }
81
+
82
+
83
+
84
+ }
85
+
86
 
87
  /**
88
  * Register the stylesheets for the admin area.
134
  wp_enqueue_script('aga_bootstrap_mod');
135
  wp_register_script('aga_confirm_js', '//cdnjs.cloudflare.com/ajax/libs/jquery-confirm/3.3.2/jquery-confirm.min.js');
136
  wp_enqueue_script('aga_confirm_js');
137
+ wp_enqueue_script( 'tvc-ee-custom-js', ENHANCAD_PLUGIN_URL . '/admin/js/tvc-ee-custom.js', array( 'jquery' ), $this->version, false );
138
  if($this->is_current_tab_in(array('sync_product_page','gaa_config_page'))){
139
  wp_register_script('plugin-select2',ENHANCAD_PLUGIN_URL . '/includes/setup/plugins/select2/select2.min.js');
140
  wp_enqueue_script('plugin-select2');
187
  echo '<div class="tvc_plugin_container">';
188
  require_once( 'partials/enhanced-ecommerce-google-analytics-admin-display.php');
189
  new TVC_Tabs();
190
+ echo $this->call_tvc_site_verified_and_domain_claim();
191
  if (!empty($_GET['tab'])) {
192
  $get_action = $_GET['tab'];
193
  } else {
197
  $this->$get_action();
198
  }
199
  echo '</div>';
200
+ echo $this->get_tvc_popup_message();
201
  }
202
  public function check_nall_and_message($val, $msg, $msg_false){
203
  if((isset($val) && $val != "" && $val != 0) ){
206
  return $msg_false;
207
  }
208
  }
209
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
210
  public function general_settings() {
211
  require_once( 'partials/general-fields.php');
212
  }
admin/class-tvc-admin-helper.php CHANGED
@@ -14,10 +14,12 @@ Class TVC_Admin_Helper{
14
  protected $currentCustomerId = "";
15
  protected $user_currency_symbol = "";
16
  protected $setting_status = "";
17
- public function __construct($theURL = '') {
 
18
  $this->includes();
19
  $this->customApiObj = new CustomApi();
20
  }
 
21
  public function includes() {
22
  if (!class_exists('CustomApi.php')) {
23
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
@@ -27,6 +29,22 @@ Class TVC_Admin_Helper{
27
  }
28
  }
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
  public function is_ee_options_data_empty(){
31
  if($this->get_subscriptionId() != ""){
32
  if(empty($this->get_ee_options_data())){
@@ -78,7 +96,6 @@ Class TVC_Admin_Helper{
78
  $syncProductList = [];
79
  $campaigns_list = [];
80
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
81
-
82
  $syncProduct_list_res = $this->customApiObj->getSyncProductList(['merchant_id' => $this->get_merchantId()]);
83
  if(isset($syncProduct_list_res->data) && isset($syncProduct_list_res->status) && $syncProduct_list_res->status == 200){
84
  if (isset($syncProduct_list_res->data->statistics)) {
@@ -98,7 +115,7 @@ Class TVC_Admin_Helper{
98
  }
99
  }
100
  $this->set_ee_options_data(array("setting" => $googleDetail, "prod_sync_status" =>$syncProductStat,"prod_sync_list" =>$syncProductList, "campaigns_list"=>$campaigns_list, "sync_time"=>current_time( 'timestamp' )));
101
- $tvc_msg ="";
102
  if(!empty($googleDetail)){
103
  $tvc_msg = "Configuration Setting";
104
  }
@@ -107,14 +124,27 @@ Class TVC_Admin_Helper{
107
  }
108
  if(!empty($campaigns_list)){
109
  $tvc_msg = ($tvc_msg != "")?$tvc_msg.", Shopping Campaigns":"Shopping Campaigns";
110
- }
111
- return "Success to sync up of ".$tvc_msg.".";
112
  }
113
 
114
  public function set_ee_options_data($ee_options_data){
115
  update_option("ee_api_data", serialize($ee_options_data));
116
  }
117
 
 
 
 
 
 
 
 
 
 
 
 
 
 
118
  public function get_ee_options_settings(){
119
  if(!empty($this->e_options_settings)){
120
  return $this->e_options_settings;
@@ -169,8 +199,8 @@ Class TVC_Admin_Helper{
169
  }else{
170
  $timezone = get_option('timezone_string');
171
  if($timezone == ""){
172
- $timezone = "America/New_York";
173
- }
174
  $this->time_zone = $timezone;
175
  return $this->time_zone;
176
  }
@@ -180,7 +210,7 @@ Class TVC_Admin_Helper{
180
  if(!empty($this->connect_actual_link)){
181
  return $this->connect_actual_link;
182
  }else{
183
- $this->connect_actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
184
  return $this->connect_actual_link;
185
  }
186
  }
@@ -198,9 +228,9 @@ Class TVC_Admin_Helper{
198
  if(!empty($this->woo_currency)){
199
  return $this->woo_currency;
200
  }else{
201
- $this->woo_currency = get_option('woocommerce_currency');
202
  return $this->woo_currency;
203
- }
204
  }
205
 
206
  public function get_woo_country(){
@@ -209,9 +239,9 @@ Class TVC_Admin_Helper{
209
  }else{
210
  $store_raw_country = get_option('woocommerce_default_country');
211
  $country = explode(":", $store_raw_country);
212
- $this->woo_country = (isset($country[0]))?$country[0]:"";
213
- return $this->woo_country;
214
- }
215
  }
216
  //tvc_customer = >google_ads_id
217
  public function get_currentCustomerId(){
@@ -227,18 +257,18 @@ Class TVC_Admin_Helper{
227
  }
228
  }
229
  public function get_user_currency_symbol(){
230
- if(!empty($this->get_user_currency_symbol)){
231
- return $this->get_user_currency_symbol;
232
  }else{
233
  $currency_symbol="";
234
  $currency_symbol_rs = $this->customApiObj->getCampaignCurrencySymbol(['customer_id' => $this->get_currentCustomerId()]);
235
- if(isset($currency_symbol_rs->data) && isset($currency_symbol_rs->data['status']) && $currency_symbol_rs->data['status'] == 200){
236
- $currency_symbol = get_woocommerce_currency_symbol($currency_symbol_rs->data['data']->currency);
237
- }else{
238
- $currency_symbol = get_woocommerce_currency_symbol("USD");
239
- }
240
- $this->currentCustomerId = $currency_symbol;
241
- return $this->currentCustomerId;
242
  }
243
  }
244
 
@@ -279,7 +309,7 @@ Class TVC_Admin_Helper{
279
  $countries_list = $this->get_gmc_language_list();
280
  ?>
281
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
282
- <option value="0"><?php echo $label; ?></option>
283
  <?php foreach ($countries_list as $Key => $val) {?>
284
  <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"]." (".$val["native_name"].")";?></option>
285
  <?php
@@ -294,7 +324,7 @@ Class TVC_Admin_Helper{
294
  $sel_val = $this->get_woo_country();
295
  ?>
296
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
297
- <option value="0"><?php echo $label; ?></option>
298
  <?php foreach ($countries_list as $Key => $val) {?>
299
  <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"];?></option>
300
  <?php
@@ -307,7 +337,7 @@ Class TVC_Admin_Helper{
307
  if(!empty($option_list) && $name){
308
  ?>
309
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
310
- <option value="0"><?php echo $label; ?></option>
311
  <?php foreach ($option_list as $Key => $val) {?>
312
  <option value="<?php echo $val["field"];?>" <?php echo($val["field"] == $sel_val)?"selected":""; ?>><?php echo $val["field"];?></option>
313
  <?php
@@ -338,10 +368,10 @@ Class TVC_Admin_Helper{
338
  $setting_status['google_analytic_msg']= "";
339
  }else if($googleDetail->property_id == "" ){
340
  $setting_status['google_analytic']= false;
341
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
342
  }else if($googleDetail->measurement_id == "" ){
343
  $setting_status['google_analytic']= false;
344
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
345
  }
346
  }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
347
  if( $googleDetail->measurement_id != ""){
@@ -349,7 +379,7 @@ Class TVC_Admin_Helper{
349
  $setting_status['google_analytic_msg']= "";
350
  }else{
351
  $setting_status['google_analytic']= false;
352
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
353
  }
354
  }else if(isset($googleDetail->tracking_option) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "UA" ){
355
  if($googleDetail->property_id != ""){
@@ -357,13 +387,15 @@ Class TVC_Admin_Helper{
357
  $setting_status['google_analytic_msg']= "";
358
  }else{
359
  $setting_status['google_analytic']= false;
360
- $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
361
  }
362
  }else{
363
  $setting_status['google_analytic']= false;
364
  $setting_status['google_analytic_msg']= "";
365
  }
366
  // for google shopping
 
 
367
  if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"google_ads_id") ){
368
  //main tab
369
  if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
@@ -371,10 +403,10 @@ Class TVC_Admin_Helper{
371
  $setting_status['google_shopping_msg']= "";
372
  }else if($googleDetail->google_merchant_center_id == ""){
373
  $setting_status['google_shopping']= false;
374
- $setting_status['google_shopping_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
375
  }else if($googleDetail->google_ads_id == ""){
376
  $setting_status['google_shopping']= false;
377
- $setting_status['google_shopping_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
378
  }
379
  }else{
380
  $setting_status['google_shopping']= false;
@@ -388,10 +420,10 @@ Class TVC_Admin_Helper{
388
  $setting_status['google_ads_msg']= "";
389
  }else if($googleDetail->google_merchant_center_id == ""){
390
  $setting_status['google_ads']= false;
391
- $setting_status['google_ads_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
392
  }else if($googleDetail->google_ads_id == ""){
393
  $setting_status['google_ads']= false;
394
- $setting_status['google_ads_msg']= "Configure Google Ads account to reach to millions of interested shoppers <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
395
  }
396
  }else{
397
  $setting_status['google_ads']= false;
@@ -414,7 +446,7 @@ Class TVC_Admin_Helper{
414
  $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
415
  }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
416
  $setting_status['google_shopping_conf']= false;
417
- $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
418
  }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
419
  $setting_status['google_shopping_conf']= false;
420
  $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
@@ -453,7 +485,7 @@ Class TVC_Admin_Helper{
453
  }
454
  }else{
455
  $setting_status['google_shopping_p_sync']= false;
456
- $setting_status['google_shopping_p_sync_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
457
  }
458
 
459
  //sub tab product Campaigns
@@ -473,7 +505,7 @@ Class TVC_Admin_Helper{
473
  }
474
  }else{
475
  $setting_status['google_shopping_p_campaigns']= false;
476
- $setting_status['google_shopping_p_campaigns_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->url)."'>click here</a>.";
477
  }
478
  }
479
  return $setting_status;
@@ -515,13 +547,95 @@ Class TVC_Admin_Helper{
515
  return $tvc_cat_id_list;
516
  }
517
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
518
  public function call_domain_claim(){
519
  $googleDetail = [];
520
  $google_detail = $this->get_ee_options_data();
521
  //print_r($google_detail);
522
  if(isset($google_detail['setting']) && $google_detail['setting']){
523
  $googleDetail = $google_detail['setting'];
524
- if($googleDetail->is_domain_claim == '0'){
 
 
525
  $postData = [
526
  'merchant_id' => $googleDetail->merchant_id,
527
  'website_url' => $googleDetail->site_url,
@@ -529,7 +643,6 @@ Class TVC_Admin_Helper{
529
  'account_id' => $googleDetail->google_merchant_center_id
530
  ];
531
  $claimWebsite = $this->customApiObj->claimWebsite($postData);
532
- //print_r($claimWebsite);
533
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
534
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
535
  }else{
@@ -537,9 +650,80 @@ Class TVC_Admin_Helper{
537
  return array('error'=>false, 'msg'=>"Domain claimed successfully.");
538
  }
539
  }else{
540
- return array('error'=>true, 'msg'=>"already domain claimed successfully");
541
  }
542
  }
543
  }
544
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
545
  }?>
14
  protected $currentCustomerId = "";
15
  protected $user_currency_symbol = "";
16
  protected $setting_status = "";
17
+ protected $ee_additional_data = "";
18
+ public function __construct() {
19
  $this->includes();
20
  $this->customApiObj = new CustomApi();
21
  }
22
+
23
  public function includes() {
24
  if (!class_exists('CustomApi.php')) {
25
  require_once(ENHANCAD_PLUGIN_DIR . 'includes/setup/CustomApi.php');
29
  }
30
  }
31
 
32
+ public function is_need_to_update_api_to_db(){
33
+ if($this->get_subscriptionId() != ""){
34
+ $google_detail = $this->get_ee_options_data();
35
+ if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
36
+ $current = current_time( 'timestamp' );
37
+ //echo date( 'M-d-Y H:i', current_time( 'timestamp' ))."==>".date( 'M-d-Y H:i', $google_detail['sync_time']);
38
+ $diffrent_hours = floor(( $current - $google_detail['sync_time'])/(60*60));
39
+ if($diffrent_hours > 5){
40
+ return true;
41
+ }
42
+ }else if(empty($google_detail)){
43
+ return true;
44
+ }
45
+ }
46
+ return false;
47
+ }
48
  public function is_ee_options_data_empty(){
49
  if($this->get_subscriptionId() != ""){
50
  if(empty($this->get_ee_options_data())){
96
  $syncProductList = [];
97
  $campaigns_list = [];
98
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
 
99
  $syncProduct_list_res = $this->customApiObj->getSyncProductList(['merchant_id' => $this->get_merchantId()]);
100
  if(isset($syncProduct_list_res->data) && isset($syncProduct_list_res->status) && $syncProduct_list_res->status == 200){
101
  if (isset($syncProduct_list_res->data->statistics)) {
115
  }
116
  }
117
  $this->set_ee_options_data(array("setting" => $googleDetail, "prod_sync_status" =>$syncProductStat,"prod_sync_list" =>$syncProductList, "campaigns_list"=>$campaigns_list, "sync_time"=>current_time( 'timestamp' )));
118
+ /*$tvc_msg ="";
119
  if(!empty($googleDetail)){
120
  $tvc_msg = "Configuration Setting";
121
  }
124
  }
125
  if(!empty($campaigns_list)){
126
  $tvc_msg = ($tvc_msg != "")?$tvc_msg.", Shopping Campaigns":"Shopping Campaigns";
127
+ }*/
128
+ return "Details updated successfully.";
129
  }
130
 
131
  public function set_ee_options_data($ee_options_data){
132
  update_option("ee_api_data", serialize($ee_options_data));
133
  }
134
 
135
+ public function set_ee_additional_data($ee_additional_data){
136
+ update_option("ee_additional_data", serialize($ee_additional_data));
137
+ }
138
+
139
+ public function get_ee_additional_data(){
140
+ if(!empty($this->ee_additional_data)){
141
+ return $this->ee_additional_data;
142
+ }else{
143
+ $this->ee_additional_data = unserialize(get_option('ee_additional_data'));
144
+ return $this->ee_additional_data;
145
+ }
146
+ }
147
+
148
  public function get_ee_options_settings(){
149
  if(!empty($this->e_options_settings)){
150
  return $this->e_options_settings;
199
  }else{
200
  $timezone = get_option('timezone_string');
201
  if($timezone == ""){
202
+ $timezone = "America/New_York";
203
+ }
204
  $this->time_zone = $timezone;
205
  return $this->time_zone;
206
  }
210
  if(!empty($this->connect_actual_link)){
211
  return $this->connect_actual_link;
212
  }else{
213
+ $this->connect_actual_link = get_site_url();
214
  return $this->connect_actual_link;
215
  }
216
  }
228
  if(!empty($this->woo_currency)){
229
  return $this->woo_currency;
230
  }else{
231
+ $this->woo_currency = get_option('woocommerce_currency');
232
  return $this->woo_currency;
233
+ }
234
  }
235
 
236
  public function get_woo_country(){
239
  }else{
240
  $store_raw_country = get_option('woocommerce_default_country');
241
  $country = explode(":", $store_raw_country);
242
+ $this->woo_country = (isset($country[0]))?$country[0]:"";
243
+ return $this->woo_country;
244
+ }
245
  }
246
  //tvc_customer = >google_ads_id
247
  public function get_currentCustomerId(){
257
  }
258
  }
259
  public function get_user_currency_symbol(){
260
+ if(!empty($this->user_currency_symbol)){
261
+ return $this->user_currency_symbol;
262
  }else{
263
  $currency_symbol="";
264
  $currency_symbol_rs = $this->customApiObj->getCampaignCurrencySymbol(['customer_id' => $this->get_currentCustomerId()]);
265
+ if(isset($currency_symbol_rs->data) && isset($currency_symbol_rs->data['status']) && $currency_symbol_rs->data['status'] == 200){
266
+ $currency_symbol = get_woocommerce_currency_symbol($currency_symbol_rs->data['data']->currency);
267
+ }else{
268
+ $currency_symbol = get_woocommerce_currency_symbol("USD");
269
+ }
270
+ $this->user_currency_symbol = $currency_symbol;
271
+ return $this->user_currency_symbol;
272
  }
273
  }
274
 
309
  $countries_list = $this->get_gmc_language_list();
310
  ?>
311
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
312
+ <option value=""><?php echo $label; ?></option>
313
  <?php foreach ($countries_list as $Key => $val) {?>
314
  <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"]." (".$val["native_name"].")";?></option>
315
  <?php
324
  $sel_val = $this->get_woo_country();
325
  ?>
326
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
327
+ <option value=""><?php echo $label; ?></option>
328
  <?php foreach ($countries_list as $Key => $val) {?>
329
  <option value="<?php echo $val["code"];?>" <?php echo($val["code"] == $sel_val)?"selected":""; ?>><?php echo $val["name"];?></option>
330
  <?php
337
  if(!empty($option_list) && $name){
338
  ?>
339
  <select class="form-control select2 <?php echo $class_id; ?> <?php echo ($require == true)?"field-required":""; ?>" name="<?php echo $name; ?>" id="<?php echo $class_id; ?>" >
340
+ <option value=""><?php echo $label; ?></option>
341
  <?php foreach ($option_list as $Key => $val) {?>
342
  <option value="<?php echo $val["field"];?>" <?php echo($val["field"] == $sel_val)?"selected":""; ?>><?php echo $val["field"];?></option>
343
  <?php
368
  $setting_status['google_analytic_msg']= "";
369
  }else if($googleDetail->property_id == "" ){
370
  $setting_status['google_analytic']= false;
371
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
372
  }else if($googleDetail->measurement_id == "" ){
373
  $setting_status['google_analytic']= false;
374
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
375
  }
376
  }else if(isset($googleDetail->tracking_option) && isset($googleDetail->measurement_id) && $googleDetail->tracking_option == "GA4"){
377
  if( $googleDetail->measurement_id != ""){
379
  $setting_status['google_analytic_msg']= "";
380
  }else{
381
  $setting_status['google_analytic']= false;
382
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
383
  }
384
  }else if(isset($googleDetail->tracking_option) && isset($googleDetail->property_id) && $googleDetail->tracking_option == "UA" ){
385
  if($googleDetail->property_id != ""){
387
  $setting_status['google_analytic_msg']= "";
388
  }else{
389
  $setting_status['google_analytic']= false;
390
+ $setting_status['google_analytic_msg']= "There is a configuration issue in your Google Analytics account set up <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
391
  }
392
  }else{
393
  $setting_status['google_analytic']= false;
394
  $setting_status['google_analytic_msg']= "";
395
  }
396
  // for google shopping
397
+ //echo "<pre>";
398
+ //print_r($googleDetail);
399
  if(property_exists($googleDetail,"google_merchant_center_id") && property_exists($googleDetail,"google_ads_id") ){
400
  //main tab
401
  if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
403
  $setting_status['google_shopping_msg']= "";
404
  }else if($googleDetail->google_merchant_center_id == ""){
405
  $setting_status['google_shopping']= false;
406
+ $setting_status['google_shopping_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
407
  }else if($googleDetail->google_ads_id == ""){
408
  $setting_status['google_shopping']= false;
409
+ $setting_status['google_shopping_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
410
  }
411
  }else{
412
  $setting_status['google_shopping']= false;
420
  $setting_status['google_ads_msg']= "";
421
  }else if($googleDetail->google_merchant_center_id == ""){
422
  $setting_status['google_ads']= false;
423
+ $setting_status['google_ads_msg']= "Link your Google Ads with Merchant center to start running shopping campaigns <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
424
  }else if($googleDetail->google_ads_id == ""){
425
  $setting_status['google_ads']= false;
426
+ $setting_status['google_ads_msg']= "Configure Google Ads account to reach to millions of interested shoppers <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
427
  }
428
  }else{
429
  $setting_status['google_ads']= false;
446
  $setting_status['google_shopping_conf_msg']= "Google Shopping Configuration Success.";
447
  }else if($googleDetail->google_merchant_center_id == "" || $googleDetail->google_ads_id == "" ){
448
  $setting_status['google_shopping_conf']= false;
449
+ $setting_status['google_shopping_conf_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
450
  }else if($googleDetail->is_site_verified ==0 && $googleDetail->is_domain_claim ==0 ){
451
  $setting_status['google_shopping_conf']= false;
452
  $setting_status['google_shopping_conf_msg']= "Site verification and domain claim for your merchant center account failed.";
485
  }
486
  }else{
487
  $setting_status['google_shopping_p_sync']= false;
488
+ $setting_status['google_shopping_p_sync_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
489
  }
490
 
491
  //sub tab product Campaigns
505
  }
506
  }else{
507
  $setting_status['google_shopping_p_campaigns']= false;
508
+ $setting_status['google_shopping_p_campaigns_msg']= "Connect your merchant center account and make your products available to shoppers across Google <a target='_blank' href='".esc_url($this->get_connect_url())."'>click here</a>.";
509
  }
510
  }
511
  return $setting_status;
547
  return $tvc_cat_id_list;
548
  }
549
 
550
+ public function call_tvc_site_verified_and_domain_claim(){
551
+ $google_detail = $this->get_ee_options_data();
552
+ $class = 'notice notice-error tvc-notice-error';
553
+ if(!isset($_GET['welcome_msg']) && isset($google_detail['setting']) && $google_detail['setting'] ){
554
+ $googleDetail = $google_detail['setting'];
555
+ if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id){
556
+ $message = "";
557
+ $call_js_function_args="";
558
+ if (isset($googleDetail->is_site_verified) && isset($googleDetail->is_domain_claim) && $googleDetail->is_site_verified == '0' && $googleDetail->is_domain_claim == '0') {
559
+ $message = esc_html__('Site verification and domain claim for merchant center account failed. Without a verified and claimed website, your products will get disapproved.');
560
+ $call_js_function_args = "both";
561
+ }else if(isset($googleDetail->is_site_verified) && $googleDetail->is_site_verified == '0'){
562
+ $message = esc_html__('Site verification and domain claim for merchant center account failed. Without a verified and claimed website, your products will get disapproved.');
563
+ $call_js_function_args = "site_verified";
564
+ }else if(isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
565
+ $message = esc_html__('Domain claim for merchant center account failed. Without a verified and claimed website, your products will get disapproved.');
566
+ $call_js_function_args = "domain_claim";
567
+ }
568
+ if($message!= ""){
569
+ printf('<div class="%1$s"><p><b>%2$s Click <a href="javascript:void(0)" id="call_both_verification" onclick="call_tvc_site_verified_and_domain_claim(\'%3$s\');">here</a></b> to verify and claim the domain.</p></div>', esc_attr($class), esc_html($message),$call_js_function_args);
570
+ ?>
571
+ <script>
572
+ function call_tvc_site_verified_and_domain_claim(call_args){
573
+ var tvs_this = event.target;
574
+ $("#call_both_verification").css("visibility","hidden");
575
+ $(tvs_this).after('<div class="call_both_verification-spinner tvc-nb-spinner" id="both_verification-spinner"></div>');
576
+ if(call_args == "domain_claim"){
577
+ call_domain_claim_both();
578
+ }else{
579
+ jQuery.post(myAjaxNonces.ajaxurl,{
580
+ action: "tvc_call_site_verified",
581
+ apiDomainClaimNonce: myAjaxNonces.SiteVerifiedNonce
582
+ },function( response ){
583
+ var rsp = JSON.parse(response);
584
+ if(rsp.status == "success"){
585
+ if(call_args == "site_verified"){
586
+ tvc_helper.tvc_alert("success","",rsp.message);
587
+ location.reload();
588
+ }else{
589
+ call_domain_claim_both(rsp.message);
590
+ }
591
+ }else{
592
+ tvc_helper.tvc_alert("error","",rsp.message);
593
+ $("#both_verification-spinner").remove();
594
+ }
595
+ });
596
+ }
597
+ }
598
+ function call_domain_claim_both(first_message=null){
599
+ //console.log("call_domain_claim");
600
+ jQuery.post(myAjaxNonces.ajaxurl,{
601
+ action: "tvc_call_domain_claim",
602
+ apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
603
+ },function( response ){
604
+ var rsp = JSON.parse(response);
605
+ if(rsp.status == "success"){
606
+ if(first_message != "" || first_message == null){
607
+ tvc_helper.tvc_alert("success","",first_message,true,4000);
608
+ setTimeout(function(){
609
+ tvc_helper.tvc_alert("success","",rsp.message,true,4000);
610
+ location.reload();
611
+ }, 4000);
612
+ }else{
613
+ tvc_helper.tvc_alert("success","",rsp.message,true,4000);
614
+ setTimeout(function(){
615
+ location.reload();
616
+ }, 4000);
617
+ }
618
+ }else{
619
+ tvc_helper.tvc_alert("error","",rsp.message,true)
620
+ }
621
+ $("#both_verification-spinner").remove();
622
+ });
623
+ }
624
+ </script>
625
+ <?php
626
+ }
627
+ }
628
+ }
629
+ }
630
  public function call_domain_claim(){
631
  $googleDetail = [];
632
  $google_detail = $this->get_ee_options_data();
633
  //print_r($google_detail);
634
  if(isset($google_detail['setting']) && $google_detail['setting']){
635
  $googleDetail = $google_detail['setting'];
636
+ if($googleDetail->is_site_verified == '0'){
637
+ return array('error'=>true, 'msg'=>"First need to verified your site. Click on site verification refresh icon to verified your site.");
638
+ }else if(property_exists($googleDetail,"is_domain_claim") && $googleDetail->is_domain_claim == '0'){
639
  $postData = [
640
  'merchant_id' => $googleDetail->merchant_id,
641
  'website_url' => $googleDetail->site_url,
643
  'account_id' => $googleDetail->google_merchant_center_id
644
  ];
645
  $claimWebsite = $this->customApiObj->claimWebsite($postData);
 
646
  if(isset($claimWebsite->error) && !empty($claimWebsite->errors)){
647
  return array('error'=>true, 'msg'=>$claimWebsite->errors[0]);
648
  }else{
650
  return array('error'=>false, 'msg'=>"Domain claimed successfully.");
651
  }
652
  }else{
653
+ return array('error'=>false, 'msg'=>"Already domain claimed successfully.");
654
  }
655
  }
656
  }
657
 
658
+
659
+ public function call_site_verified(){
660
+ $googleDetail = [];
661
+ $google_detail = $this->get_ee_options_data();
662
+ if(isset($google_detail['setting']) && $google_detail['setting']){
663
+ $googleDetail = $google_detail['setting'];
664
+ if(property_exists($googleDetail,"is_site_verified") && $googleDetail->is_site_verified == '0'){
665
+ $postData = [
666
+ 'merchant_id' => $googleDetail->merchant_id,
667
+ 'website_url' => $googleDetail->site_url,
668
+ 'subscription_id' => $googleDetail->id,
669
+ 'account_id' => $googleDetail->google_merchant_center_id
670
+ ];
671
+ $postData['method']="file";
672
+ $siteVerificationToken = $this->customApiObj->siteVerificationToken($postData);
673
+
674
+ if(isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)){
675
+ goto call_method_tag;
676
+ }else{
677
+ $myFile = ABSPATH.$siteVerificationToken->data->token;
678
+ if(!file_exists($myFile)){
679
+ $fh = fopen($myFile, 'w+');
680
+ chmod($myFile,0777);
681
+ $stringData = "google-site-verification: ".$siteVerificationToken->data->token;
682
+ fwrite($fh, $stringData);
683
+ fclose($fh);
684
+ }
685
+ $postData['method']="file";
686
+ $siteVerification = $this->customApiObj->siteVerification($postData);
687
+ if(isset($siteVerification->error) && !empty($siteVerification->errors)){
688
+ call_method_tag:
689
+ //methd using tag
690
+ $postData['method']="meta";
691
+ $siteVerificationToken_tag = $this->customApiObj->siteVerificationToken($postData);
692
+ if(isset($siteVerificationToken_tag->data->token) && $siteVerificationToken_tag->data->token){
693
+ $this->set_ee_additional_data(array("add_site_varification_tag"=>1,"site_varification_tag_val"=> base64_encode($siteVerificationToken_tag->data->token)));
694
+ sleep(1);
695
+ $siteVerification_tag = $this->customApiObj->siteVerification($postData);
696
+ if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
697
+ return array('error'=>true, 'msg'=>$siteVerification_tag->errors[0]);
698
+ }else{
699
+ $this->set_update_api_to_db();
700
+ return array('error'=>false, 'msg'=>"Site verification successfully.");
701
+ }
702
+ }else{
703
+ return array('error'=>true, 'msg'=>$siteVerificationToken_tag->errors[0]);
704
+ }
705
+ // one more try
706
+ }else{
707
+ $this->set_update_api_to_db();
708
+ return array('error'=>false, 'msg'=>"Site verification successfully.");
709
+ }
710
+ }
711
+ }else{
712
+ return array('error'=>false, 'msg'=>"Already site verification successfully.");
713
+ }
714
+ }
715
+ }
716
+
717
+ public function get_tvc_popup_message(){
718
+ return '<div id="tvc_popup_box">
719
+ <span class="close" id="tvc_close_msg" onclick="tvc_helper.tvc_close_msg()"> × </span>
720
+ <div id="box">
721
+ <div class="tvc_msg_icon" id="tvc_msg_icon"></div>
722
+ <h4 id="tvc_msg_title"></h4>
723
+ <p id="tvc_msg_content"></p>
724
+ <div id="tvc_closeModal"></div>
725
+ </div>
726
+ </div>';
727
+ }
728
+
729
  }?>
admin/css/enhanced-ecommerce-google-analytics-admin.css CHANGED
@@ -290,11 +290,11 @@ img.config-success, .nav-tabs li img.config-success, .nav-tabs li img.config-fai
290
  visibility: hidden;
291
  position: absolute;
292
  min-width: 400px;
293
- background-color: #fff;
294
  border:1px solid #2D73C5;
295
- color: #212529;
296
- text-align: center;
297
- padding: 8px 0;
298
  border-radius: 6px;
299
  z-index: 999;
300
 
@@ -431,9 +431,10 @@ button.tvc_animate_btn:hover::after, button.tvc_animate_btn:focus::after {
431
  line-height: 22px;
432
  min-height: 30px;
433
  }
434
- ul.nav-tabs{
435
  margin-top: 20px;
436
  background-color: #fff;
 
437
  }
438
  .wp-core-ui .notice.is-dismissible {
439
  padding: 0 1.4rem 0 1rem;
@@ -510,7 +511,7 @@ ul.nav-tabs{
510
  }
511
  .tvc-menu-free-plan{ position: absolute;
512
  right: 35px;
513
- top: 31px;}
514
  .tvc-menu-free-plan span {
515
  color: #03a2b7;
516
  font-size: 14px;
@@ -563,3 +564,82 @@ ul.nav-tabs{
563
  font-size: 14px;
564
  }
565
  #feed-spinner img{width: 60px;}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  visibility: hidden;
291
  position: absolute;
292
  min-width: 400px;
293
+ background-color: #2D73C5;
294
  border:1px solid #2D73C5;
295
+ color: #fff;
296
+ text-align: left;
297
+ padding: 8px;
298
  border-radius: 6px;
299
  z-index: 999;
300
 
431
  line-height: 22px;
432
  min-height: 30px;
433
  }
434
+ .tvc_plugin_container ul.nav-tabs{
435
  margin-top: 20px;
436
  background-color: #fff;
437
+ position: relative;
438
  }
439
  .wp-core-ui .notice.is-dismissible {
440
  padding: 0 1.4rem 0 1rem;
511
  }
512
  .tvc-menu-free-plan{ position: absolute;
513
  right: 35px;
514
+ top: 11px;}
515
  .tvc-menu-free-plan span {
516
  color: #03a2b7;
517
  font-size: 14px;
564
  font-size: 14px;
565
  }
566
  #feed-spinner img{width: 60px;}
567
+ /* Popup box BEGIN */
568
+ @-webkit-keyframes tvc_popup_box_open {
569
+ 0%{opacity: 0; margin-top: -20%;}
570
+ 75%{margin-top: 5%;}
571
+ 100%{opacity: 1;}
572
+ }
573
+ @keyframes tvc_popup_box_open {
574
+ 0%{opacity: 0; margin-top: -20%;}
575
+ 75%{margin-top: 5%;}
576
+ 100%{opacity: 1;}
577
+ }
578
+ @-webkit-keyframes tvc_popup_box_close {
579
+ 0%{opacity: 1;}
580
+ 75%{opacity: 1; margin-top: -20%;}
581
+ 100%{opacity: 0;margin-top: 40%;}
582
+ }
583
+ @keyframes tvc_popup_box_close {
584
+ 0%{opacity: 1;}
585
+ 75%{opacity: 1; margin-top: -20%;}
586
+ 100%{opacity: 0;margin-top: 40%;}
587
+ }
588
+ #tvc_popup_box{
589
+ width: 500px;
590
+ overflow: hidden;
591
+ background: #EEEEEE;
592
+ box-shadow: 0 0 10px black;
593
+ border-radius: 10px;
594
+ position: absolute;
595
+ top: 30%;
596
+ left: 40%;
597
+ display: none;
598
+ }
599
+ #tvc_popup_box.tvc_popup_box{
600
+ width: 500px;
601
+ overflow: hidden;
602
+ background: #EEEEEE;
603
+ box-shadow: 0 0 10px black;
604
+ border-radius: 10px;
605
+ position: fixed;
606
+ top: 30%;
607
+ left: 50%;
608
+ margin-top: 100px;
609
+ transform: translate(-50%, -50%);
610
+ z-index: 9999;
611
+ padding: 10px;
612
+ text-align: center;
613
+ display: block;
614
+ animation: tvc_popup_box_open 0.5s;
615
+ -webkit-animation: tvc_popup_box_open 0.5s;
616
+
617
+ }
618
+ #tvc_popup_box.tvc_popup_box_close{
619
+ display: none;
620
+ animation: tvc_popup_box_close 0.5s;
621
+ -webkit-animation: tvc_popup_box_close 0.5s;
622
+ -webkit-animation-fill-mode: forwards;
623
+ animation-fill-mode: forwards;
624
+ }
625
+
626
+ #tvc_popup_box #tvc_msg_content{ color: #000000;
627
+ font-size: 16px; padding: 0 20px;line-height: 20px;}
628
+ #tvc_popup_box .close {
629
+ position: absolute;
630
+ top: 0px;
631
+ right: 10px;
632
+ transition: all 200ms;
633
+ font-size: 30px;
634
+ font-weight: bold;
635
+ text-decoration: none;
636
+ cursor: pointer;
637
+ }
638
+ #tvc_popup_box .fa-exclamation-circle, #tvc_popup_box .tvc-error{color: #FF0000;}
639
+ #tvc_popup_box .fa-check-circle.tvc-success, #tvc_popup_box .tvc-success{color: #218938;}
640
+
641
+ /* Popup box BEGIN */
642
+ .tvc-notice-error{position: relative;}
643
+ .tvc-notice-error .call_both_verification-spinner{
644
+ right: 5px;top: 10px;margin-left: 0;
645
+ }
admin/js/tvc-ee-custom.js ADDED
@@ -0,0 +1,49 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ var tvc_helper = {
2
+ tvc_alert:function(msg_type=null, msg_subject=null, msg, auto_close=false, tvc_time=7000){
3
+ document.getElementById('tvc_msg_title').innerHTML ="";
4
+ document.getElementById('tvc_msg_content').innerHTML ="";
5
+ document.getElementById('tvc_msg_icon').innerHTML ="";
6
+
7
+ if(msg != ""){
8
+ let tvc_popup_box = document.getElementById('tvc_popup_box');
9
+ tvc_popup_box.classList.remove("tvc_popup_box_close");
10
+ tvc_popup_box.classList.add("tvc_popup_box");
11
+
12
+ //tvc_popup_box.style.display = "block";
13
+ document.getElementById('tvc_msg_title').innerHTML =this.tvc_subject_title(msg_type, msg_subject);
14
+ document.getElementById('tvc_msg_content').innerHTML =msg;
15
+ if(msg_type=="success"){
16
+ document.getElementById('tvc_msg_icon').innerHTML ='<i class="fas fa-check-circle fa-3x tvc-success"></i>';
17
+ }else{
18
+ document.getElementById('tvc_msg_icon').innerHTML ='<i class="fas fa-exclamation-circle fa-3x"></i>';
19
+ }
20
+ if(auto_close == true){
21
+ setTimeout(function(){ //tvc_popup_box.style.display = "none";
22
+ tvc_popup_box.classList.add("tvc_popup_box_close");
23
+ tvc_popup_box.classList.remove("tvc_popup_box");
24
+ }
25
+ , tvc_time);
26
+ }
27
+ }
28
+ },
29
+ tvc_subject_title:function(msg_type=null, msg_subject=null){
30
+ if(msg_subject == null || msg_subject ==""){
31
+ if(msg_type=="success" ){
32
+ return '<span class="tvc-success">Success!!</span>';
33
+ }else{
34
+ return '<span class="tvc-error">Oops!</span>';
35
+ }
36
+ }else{
37
+ if(msg_type=="success" ){
38
+ return '<span class="tvc-success">'+msg_subject+'</span>';
39
+ }else{
40
+ return '<span>'+msg_subject+'</span>';
41
+ }
42
+ }
43
+ },
44
+ tvc_close_msg:function(){
45
+ let tvc_popup_box = document.getElementById('tvc_popup_box');
46
+ tvc_popup_box.classList.add("tvc_popup_box_close");
47
+ //tvc_popup_box.style.display = "none";
48
+ }
49
+ };
admin/partials/enhanced-ecommerce-google-analytics-admin-display.php CHANGED
@@ -97,7 +97,7 @@ class TVC_Tabs {
97
  <li class="nav-item"><div class="border-left aga-tab nav-link <?php echo $this->is_active_tabs('about_plugin'); ?>"><a href="<?php echo $this->site_url.'about_plugin'; ?>">Premium <img class="new-img-blink" src='<?php echo plugins_url('../images/new-2.gif', __FILE__ ) ?>' /></a></div></li>
98
  <?php }*/ ?>
99
  <li class="tvc-menu-free-plan">
100
- <span>Free Plan: 500 Product's sync limit</span>
101
  </li>
102
  </ul>
103
  </div>
97
  <li class="nav-item"><div class="border-left aga-tab nav-link <?php echo $this->is_active_tabs('about_plugin'); ?>"><a href="<?php echo $this->site_url.'about_plugin'; ?>">Premium <img class="new-img-blink" src='<?php echo plugins_url('../images/new-2.gif', __FILE__ ) ?>' /></a></div></li>
98
  <?php }*/ ?>
99
  <li class="tvc-menu-free-plan">
100
+ <span>Free Plan: Products sync limit - 500 </span>
101
  </li>
102
  </ul>
103
  </div>
admin/partials/general-fields.php CHANGED
@@ -21,10 +21,12 @@ if (isset($_GET['connect']) && isset($_GET['subscription_id'])) {
21
  ];
22
 
23
  if ($googleDetail->is_site_verified == '0') {
 
24
  $siteVerificationToken = $customApiObj->siteVerificationToken($postData);
25
  if (isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)) {
 
26
  } else {
27
- $myFile = ABSPATH.$siteVerificationToken->data->token; // or .php
28
  if (!file_exists($myFile)) {
29
  $fh = fopen($myFile, 'w+');
30
  chmod($myFile,0777);
@@ -32,15 +34,27 @@ if (isset($_GET['connect']) && isset($_GET['subscription_id'])) {
32
  fwrite($fh, $stringData);
33
  fclose($fh);
34
  }
35
-
36
  $siteVerification = $customApiObj->siteVerification($postData);
37
  if (isset($siteVerification->error) && !empty($siteVerification->errors)) {
 
 
 
 
 
 
 
 
 
 
 
 
 
38
  } else {
39
  $googleDetail->is_site_verified = '1';
40
  }
41
  }
42
  }
43
-
44
  if ($googleDetail->is_domain_claim == '0') {
45
  $claimWebsite = $customApiObj->claimWebsite($postData);
46
  if (isset($claimWebsite->error) && !empty($claimWebsite->errors)) {
@@ -69,10 +83,10 @@ if (isset($_GET['connect']) && isset($_GET['subscription_id'])) {
69
  update_option('ads_ert', $googleDetail->remarketing_tags);
70
  update_option('ads_edrt', $googleDetail->dynamic_remarketing_tags);
71
  Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
72
-
 
73
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
74
- if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
75
- $TVC_Admin_Helper->set_update_api_to_db($googleDetail);
76
  wp_redirect("admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=sync_product_page&welcome_msg=true");
77
  exit;
78
  }else{
21
  ];
22
 
23
  if ($googleDetail->is_site_verified == '0') {
24
+ $postData['method']="file";
25
  $siteVerificationToken = $customApiObj->siteVerificationToken($postData);
26
  if (isset($siteVerificationToken->error) && !empty($siteVerificationToken->errors)) {
27
+ goto call_method_tag;
28
  } else {
29
+ $myFile = ABSPATH.$siteVerificationToken->data->token;
30
  if (!file_exists($myFile)) {
31
  $fh = fopen($myFile, 'w+');
32
  chmod($myFile,0777);
34
  fwrite($fh, $stringData);
35
  fclose($fh);
36
  }
37
+ $postData['method']="file";
38
  $siteVerification = $customApiObj->siteVerification($postData);
39
  if (isset($siteVerification->error) && !empty($siteVerification->errors)) {
40
+ call_method_tag:
41
+ //methd using tag
42
+ $postData['method']="meta";
43
+ $siteVerificationToken_tag = $customApiObj->siteVerificationToken($postData);
44
+ if(isset($siteVerificationToken_tag->data->token) && $siteVerificationToken_tag->data->token){
45
+ $TVC_Admin_Helper->set_ee_additional_data(array("add_site_varification_tag"=>1,"site_varification_tag_val"=> base64_encode($siteVerificationToken_tag->data->token)));
46
+ sleep(1);
47
+ $siteVerification_tag = $customApiObj->siteVerification($postData);
48
+ if(isset($siteVerification_tag->error) && !empty($siteVerification_tag->errors)){
49
+ }else{
50
+ $googleDetail->is_site_verified = '1';
51
+ }
52
+ }
53
  } else {
54
  $googleDetail->is_site_verified = '1';
55
  }
56
  }
57
  }
 
58
  if ($googleDetail->is_domain_claim == '0') {
59
  $claimWebsite = $customApiObj->claimWebsite($postData);
60
  if (isset($claimWebsite->error) && !empty($claimWebsite->errors)) {
83
  update_option('ads_ert', $googleDetail->remarketing_tags);
84
  update_option('ads_edrt', $googleDetail->dynamic_remarketing_tags);
85
  Enhanced_Ecommerce_Google_Settings::add_update_settings('ee_options');
86
+ //save data in DB
87
+ $TVC_Admin_Helper->set_update_api_to_db($googleDetail);
88
  if(isset($googleDetail->google_merchant_center_id) || isset($googleDetail->google_ads_id) ){
89
+ if( $googleDetail->google_merchant_center_id != "" && $googleDetail->google_ads_id != ""){
 
90
  wp_redirect("admin.php?page=enhanced-ecommerce-google-analytics-admin-display&tab=sync_product_page&welcome_msg=true");
91
  exit;
92
  }else{
css/tvc_admin-page.css DELETED
@@ -1,548 +0,0 @@
1
- /*
2
- To change this license header, choose License Headers in Project Properties.
3
- To change this template file, choose Tools | Templates
4
- and open the template in the editor.
5
- */
6
-
7
- #feed-spinner {
8
- /*height: 200px;*/ /*height of the spinner gif +2px to fix IE8 issue */
9
- left: 50%;
10
- margin-left: -25px; /* half width of the spinner gif */
11
- margin-top: -25px; /* half height of the spinner gif */
12
- overflow: auto;
13
- position: fixed;
14
- text-align: center;
15
- top: 40%;
16
- /*width: 200px;*/ /* width of the spinner gif */
17
- z-index: 1234;
18
- }
19
- div.field-table-row-wrapper:nth-child(2n) {
20
- background-color: #f5f5f5;
21
- }
22
-
23
- #footer-left{
24
- display: none;
25
- }
26
-
27
- div.field-table-row-wrapper {
28
- display: block;
29
- padding-bottom: 5px;
30
- }
31
-
32
- div.filter-wrapper {
33
- margin-top: 5px;
34
- }
35
-
36
- aside.action-btn {
37
- margin-left: 8px;
38
- }
39
-
40
- .small-text {
41
- width: 15px;
42
- }
43
-
44
- .field-level {
45
- background: #e5e5e5;
46
- clear: both;
47
- font-size: 15px;
48
- line-height: 30px;
49
- padding-left: 5px;
50
- }
51
-
52
- .value-options-condition-selector {
53
- margin-left: 400px;
54
- }
55
-
56
- .value-options-query-selector {
57
- margin-bottom: 15px;
58
- margin-left: 37%;
59
- width: 65%
60
- }
61
-
62
- select.tvc-main-input-selector {
63
- height: 33px;
64
- max-width: 35rem;
65
- }
66
-
67
- select.select-value-options {
68
- height: 27px;
69
- vertical-align: initial;
70
- }
71
-
72
- select.align-left {
73
- float: left;
74
- }
75
-
76
- .condition-and-value-selector {
77
- margin-left: 5px;
78
- }
79
-
80
- div.condition-wrapper {
81
- float: left;
82
- line-height: 26px;
83
- margin-bottom: 15px;
84
- width: 100%;
85
- }
86
-
87
- div.source-data-column {
88
- }
89
-
90
- div.change-source-value-wrapper {
91
- background-color: #e2e2e2;
92
- float: left;
93
- margin-left: 16%;
94
- padding: 15px;
95
- width: 81%;
96
- }
97
-
98
- th#tvc-main-feed-input-label {
99
- text-align: left;
100
- width: 32%;
101
- }
102
-
103
- th#tvc-main-feed-input-label label {
104
- display: inline-block;
105
- }
106
-
107
- div.edit-value-control {
108
- float: right;
109
- margin: -50px 10px;
110
- }
111
-
112
- div.add-to-feed-column {
113
- margin-top: 4px;
114
- }
115
-
116
- div.tvc-header-wrapper {
117
- padding-bottom: 10px;
118
- }
119
-
120
- div.tvc-field-header-wrapper {
121
- background-color: white;
122
- height: 30px;
123
- margin-bottom: 10px;
124
- }
125
-
126
- div.field-header {
127
- float: left;
128
- margin-bottom: 8px;
129
- padding: 5px;
130
- }
131
-
132
- .col10w {
133
- width: 10%;
134
- }
135
-
136
- .col30w {
137
- width: 30%;
138
- }
139
-
140
- .col20w {
141
- width: 16%;
142
- }
143
-
144
- .col40w {
145
- width: 40%;
146
- }
147
-
148
- .col55w {
149
- width: 55%;
150
- }
151
-
152
- .col80w {
153
- width: 82%;
154
- }
155
-
156
- .condition-selector {
157
- width: 55%;
158
- }
159
-
160
- div#category-mapping-header {
161
- left: 15px;
162
- position: relative;
163
- }
164
-
165
- div.source-selector {
166
- margin-right: 6%;
167
- }
168
-
169
- div.tvc-feedback {
170
- background-color: #fff;
171
- border: 1px solid #e5e5e5;
172
- border-radius: 6px;
173
- float: right;
174
- padding: 6px 10px;
175
- }
176
-
177
- div.tvc-feedback a:link {
178
- color: #4D8C0F;
179
- text-decoration: none;
180
- }
181
-
182
- div.tvc-feedback a:visited {
183
- color: #555;
184
- text-decoration: none;
185
- }
186
-
187
- div.tvc-feedback a:hover {
188
- color: #3C3;
189
- text-decoration: none;
190
- }
191
-
192
- table.fm-category-mapping-table th {
193
- font-weight: 700;
194
- padding: 9px;
195
- }
196
-
197
- table.fm-category-mapping-table {
198
- clear: none;
199
- display: table;
200
- float: right;
201
- height: 280px;
202
- overflow-y: scroll;
203
- width: 59%;
204
- }
205
-
206
- table.tvc-feed-main-input-table {
207
- width: 100%;
208
- }
209
-
210
- table.fm-category-mapping-table td#shop-category {
211
- color: #0073aa;
212
- cursor: auto;
213
- font-size: 14px !important;
214
- font-weight: 600;
215
- padding-left: 2px;
216
- }
217
-
218
- table.fm-category-mapping-table th#shop-category-selector {
219
- vertical-align: top;
220
- width: 2.2em;
221
- }
222
-
223
- td.channel-tile {
224
- border: 1px solid #ccc;
225
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
226
- -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
227
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
228
- max-width: 340px;
229
- min-width: 250px;
230
- vertical-align: top;
231
- }
232
-
233
- img.channel-thumbnail {
234
- border: none;
235
- max-width: 300px;
236
- width: 100%;
237
- }
238
-
239
- div.channel-inner {
240
- margin: 20px;
241
- }
242
-
243
- div.channel-version {
244
- background-color: #eee;
245
- border: 1px solid #dadada;
246
- border-radius: 3px;
247
- -webkit-border-radius: 3px;
248
- -moz-border-radius: 3px;
249
- color: #424242;
250
- display: block;
251
- font-weight: bold;
252
- margin-bottom: 12px;
253
- padding: 6px;
254
- }
255
-
256
- div#outdated {
257
- color: red;
258
- }
259
-
260
- div.product-filter-condition-wrapper {
261
- float: right;
262
- font-size: 16px;
263
- margin-top: 20px;
264
- width: 59%;
265
- }
266
-
267
- section.tvc-main-input-wrapper {
268
- float: left;
269
- margin-top: 20px;
270
- width: 40%;
271
- }
272
-
273
- tr.tvc-main-feed-input-row {
274
- height: 47px;
275
- }
276
-
277
- table.fm-category-mapping-table thead, table.fm-category-mapping-table tbody {
278
- float: left;
279
- width: 100%;
280
- }
281
-
282
- table.fm-category-mapping-table tbody {
283
- height: 280px;
284
- overflow-y: scroll;
285
- }
286
-
287
- table.fm-category-mapping-table tr:nth-child(2n) td, table.fm-category-mapping-table tr:nth-child(2n) th {
288
- background-color: #fcfcfc;
289
- }
290
-
291
- thead.fm-category-mapping-titles th {
292
- font-weight: 400;
293
- }
294
-
295
- thead.fm-category-mapping-titles tr {
296
- width: 98% !important;
297
- }
298
-
299
- table.fm-category-mapping-table td:first-child {
300
- width: 16%;
301
- }
302
-
303
- table.fm-category-mapping-table tr {
304
- display: table;
305
- text-align: left;
306
- width: 100%;
307
- }
308
-
309
- table.tvc-feed-main-input-table th {
310
- padding-right: 0;
311
- width: 40%;
312
- }
313
-
314
- table.tvc-feed-main-input-table input {
315
- width: 90%;
316
- }
317
-
318
- table.tvc-feed-main-input-table input#aggregator, table.tvc-feed-main-input-table input#variations {
319
- width: 10px;
320
- }
321
-
322
- table.tvc-feed-main-input-table select {
323
- width: 90%;
324
- }
325
-
326
- .message-field {
327
- font-size: 16px;
328
- margin: 20px 0 3px 0;
329
- }
330
-
331
- #disposable-warning-message {
332
- margin: 20px 0 3px 0;
333
- }
334
-
335
- button#disposable-notice-button {
336
- position: relative;
337
- }
338
-
339
- .full-screen-message-field p {
340
- color: red;
341
- font-size: 17px;
342
- margin: 20px 0 3px 0;
343
- }
344
-
345
- span.output-field-label {
346
- background-color: #2ea2cc;
347
- border-radius: 3px;
348
- color: white;
349
- margin-top: 4px;
350
- padding: 4px 10px;
351
- }
352
-
353
- div.colw {
354
- float: left;
355
- padding: 5px;
356
- }
357
-
358
- div.edit-values-row {
359
- float: left;
360
- margin: 20px 10px 10px 30px;
361
- width: 80%;
362
- }
363
-
364
- div.end-row {
365
- clear: both;
366
- }
367
-
368
- div.field-table-row {
369
- height: 20px;
370
- }
371
-
372
- div.field-table-row-edit-source {
373
- clear: both;
374
- float: left;
375
- }
376
-
377
- div.field-table-row-combined-selection {
378
- left: -181px;
379
- line-height: 26px;
380
- margin: 5px;
381
- position: relative;
382
- width: 680px;
383
- }
384
-
385
- div.combined-wrapper {
386
- line-height: 26px;
387
- width: 100%;
388
- }
389
-
390
- div.or-selector {
391
- line-height: 26px;
392
- margin-top: 30px;
393
- width: 120%;
394
- }
395
-
396
- div.dotted-top-line {
397
- border-top-style: dashed;
398
- border-top-color: #ccc;
399
- border-top-width: 1px;
400
- margin-top: 20px;
401
- }
402
-
403
- span.combined-field-row {
404
- clear: left;
405
- float: left;
406
- }
407
-
408
- input.free-category-text-input {
409
- width: 90%;
410
- }
411
-
412
- div.button-wrapper {
413
- clear: both;
414
- }
415
-
416
- .button-primary {
417
- margin-top: 15px !important;
418
- margin-right: 5px !important;
419
- }
420
-
421
- a.channel-button {
422
- margin-right: 5px !important;
423
- }
424
-
425
- a.tvc-btn-small {
426
- font-size: 13px;
427
- }
428
-
429
- a.tvc-rating-request {
430
- color: #FFB900;
431
- }
432
-
433
- input.feed-list-lower-button {
434
- position: relative;
435
- margin-bottom: 10px!important;
436
- }
437
-
438
- div.select-control {
439
- float: left;
440
- margin: 0;
441
- vertical-align: top;
442
- }
443
-
444
- div.static-value-control {
445
- float: left;
446
- }
447
- #wpcontent{
448
- height: 100%;
449
- /*padding-left: 0 !important;*/
450
- }
451
-
452
- /*prgress info*/
453
- .tvc-progressbar-wapper{
454
- width: 97%;
455
- margin: 10px auto;
456
- text-align: center;
457
- position: relative;
458
- background-color: #fff;
459
- padding: 11px;
460
- }
461
- .tvc-progressbar {
462
-
463
- overflow: hidden;
464
- counter-reset: step;
465
- }
466
- .tvc-progressbar .tvc-steps {
467
- list-style-type: none;
468
- color: #D2D2D2;
469
- text-transform: capitalize;
470
- font-size: 16px;
471
- width: 33.33%;
472
- float: left;
473
- position: relative;
474
- display: block;
475
- }
476
- .tvc-progressbar .tvc-steps .tvc-steps-icon{
477
- display: inline-block;
478
- float: left;
479
- }
480
- .tvc-progressbar .tvc-steps .tvc-steps-text{
481
- display: inline-block;
482
-
483
- float: left;
484
- }
485
- .tvc-progressbar .tvc-steps:before {
486
- border: 2px solid #007bff;
487
- color: #007bff;
488
- content: '';
489
- position: absolute;
490
- counter-increment: step;
491
- width: 43px;
492
- line-height: 40px;
493
- display: block;
494
- font-size: 18px;
495
- float: left;
496
- background: transparent;
497
- border-radius: 100%;
498
- margin: 0 auto 5px auto;
499
- border: 2px solid #ECECEC;
500
- }
501
- .tvc-progressbar .tvc-steps:nth-child(1):before {
502
- content: "\f129";
503
- font-family: 'FontAwesome';
504
- }
505
- .tvc-progressbar .tvc-steps:nth-child(2):before {
506
- content: "\f013";
507
- font-family: 'FontAwesome';
508
- }
509
- .tvc-progressbar .tvc-steps:nth-child(3):before {
510
- content: "\f00c";
511
- font-family: 'FontAwesome';
512
- }
513
- /*.tvc-progressbar .tvc-steps:after {
514
- content: '';
515
- width: 73%;
516
- height: 2px;
517
- background: #ECECEC;
518
- position: absolute;
519
- left: -35%;
520
- top: 25px;
521
- z-index: 1;
522
- }
523
- .tvc-progressbar .tvc-steps:first-child:after {
524
- content: none;
525
- }*/
526
- .tvc-progressbar .tvc-steps lable{display: block; font-size: 22px;
527
- color: #007bff; height: 54px; text-align: left;
528
- margin: 6px 0 0 50px;}
529
- .tvc-progressbar .tvc-steps span{display: block; text-align: left; font-size: 16px;
530
- line-height: 24px;}
531
- .tvc-progressbar .tvc-steps span img{margin-left: 5px; margin-right: 8px;
532
- height: 10px;}
533
- @media only screen and (min-width: 1200px){
534
- .container{
535
- margin-left: 8% !important;
536
- width:auto;
537
- }
538
- .banner{
539
- width:100%;
540
- }
541
- }
542
- @media only screen and (min-width: 1920px){
543
- .container{
544
- margin-left: 6% !important;
545
- width:auto;
546
- }
547
-
548
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/tvc_admin-page.min.css DELETED
@@ -1,496 +0,0 @@
1
- .wp-core-ui select {
2
- margin-bottom: 10px;
3
- }
4
-
5
- #tvc-attribute-map {
6
- background: #fff;
7
- padding: 20px;
8
- border: 1px solid rgba(0, 0, 0, .125);
9
- }
10
-
11
- .bg-wrap {
12
- background: #fff;
13
- padding: 20px;
14
- border: 1px solid rgba(0, 0, 0, .125);
15
- overflow: auto;
16
- }
17
-
18
- .container {
19
- margin-left: 8% !important;
20
- width: auto;
21
- }
22
-
23
- #feed-spinner {
24
- /*height: 50px;*/
25
- left: 50%;
26
- margin-left: -25px;
27
- margin-top: -25px;
28
- overflow: auto;
29
- position: fixed;
30
- text-align: center;
31
- top: 35%;
32
- /*width: 50px;*/
33
- z-index: 1234
34
- }
35
-
36
- div.field-table-row-wrapper:nth-child(2n) {
37
- background-color: #f5f5f5
38
- }
39
-
40
- div.field-table-row-wrapper {
41
- display: block;
42
- padding-bottom: 5px
43
- }
44
-
45
- div.filter-wrapper {
46
- margin-top: 5px
47
- }
48
-
49
- aside.action-btn {
50
- margin-left: 8px
51
- }
52
-
53
- .small-text {
54
- width: 15px
55
- }
56
-
57
- .field-level {
58
- clear: both;
59
- font-size: 15px;
60
- line-height: 30px;
61
- padding-left: 5px
62
- }
63
-
64
- .value-options-condition-selector {
65
- margin-left: 400px
66
- }
67
-
68
- .value-options-query-selector {
69
- margin-bottom: 15px;
70
- margin-left: 37%;
71
- width: 65%
72
- }
73
-
74
- select.tvc-main-input-selector {
75
- height: 33px;
76
- max-width: 35rem
77
- }
78
-
79
- select.select-value-options {
80
- height: 27px;
81
- vertical-align: initial
82
- }
83
-
84
- select.align-left {
85
- float: left
86
- }
87
-
88
- .condition-and-value-selector {
89
- margin-left: 5px
90
- }
91
-
92
- div.condition-wrapper {
93
- float: left;
94
- line-height: 26px;
95
- margin-bottom: 15px;
96
- width: 100%
97
- }
98
-
99
- div.change-source-value-wrapper {
100
- background-color: #e2e2e2;
101
- float: left;
102
- margin-left: 16%;
103
- padding: 15px;
104
- width: 81%
105
- }
106
-
107
- th#tvc-main-feed-input-label {
108
- text-align: left;
109
- width: 25%
110
- }
111
-
112
- th#tvc-main-feed-input-label label {
113
- display: inline-block
114
- }
115
-
116
- div.edit-value-control {
117
- float: right;
118
- margin: -50px 10px
119
- }
120
-
121
- div.add-to-feed-column {
122
- margin-top: 4px
123
- }
124
-
125
- div.tvc-header-wrapper {
126
- padding-bottom: 10px
127
- }
128
-
129
- div.tvc-field-header-wrapper {
130
- background-color: #e5e5e5;
131
- height: 30px;
132
- }
133
-
134
- div#required-field-table {
135
- border: 1px solid #e5e5e5;
136
- border-top: none;
137
- }
138
-
139
- div#optional-field-table {
140
- border: 1px solid #e5e5e5;
141
- border-top: none;
142
- }
143
-
144
- div#new-optional-row {
145
- border: 1px solid #e5e5e5;
146
- border-top: none;
147
- }
148
-
149
- div.field-header {
150
- float: left;
151
- margin-bottom: 8px;
152
- padding: 5px;
153
- font-weight: 700;
154
- }
155
-
156
- .col10w {
157
- width: 10%
158
- }
159
-
160
- .col30w {
161
- width: 30%
162
- }
163
-
164
- .col20w {
165
- width: 16%
166
- }
167
-
168
- .col40w {
169
- width: 40%
170
- }
171
-
172
- .col55w {
173
- width: 55%
174
- }
175
-
176
- .col80w {
177
- width: 82%
178
- }
179
-
180
- .condition-selector {
181
- width: 55%
182
- }
183
-
184
- div#category-mapping-header {
185
- left: 15px;
186
- position: relative
187
- }
188
-
189
- div.source-selector {
190
- margin-right: 6%
191
- }
192
-
193
- div.tvc-feedback {
194
- background-color: #fff;
195
- border: 1px solid #e5e5e5;
196
- border-radius: 6px;
197
- float: right;
198
- padding: 6px 10px
199
- }
200
-
201
- div.tvc-feedback a:link {
202
- color: #4d8c0f;
203
- text-decoration: none
204
- }
205
-
206
- div.tvc-feedback a:visited {
207
- color: #555;
208
- text-decoration: none
209
- }
210
-
211
- div.tvc-feedback a:hover {
212
- color: #3C3;
213
- text-decoration: none
214
- }
215
-
216
- table.fm-category-mapping-table th {
217
- font-weight: 700;
218
- padding: 9px
219
- }
220
-
221
- table.fm-category-mapping-table {
222
- clear: none;
223
- display: table;
224
- float: right;
225
- height: 280px;
226
- overflow-y: scroll;
227
- width: 50%
228
- }
229
-
230
- table.tvc-feed-main-input-table {
231
- width: 100%
232
- }
233
-
234
- table.fm-category-mapping-table td#shop-category {
235
- color: #0073aa;
236
- cursor: auto;
237
- font-size: 14px !important;
238
- font-weight: 600;
239
- padding-left: 2px
240
- }
241
-
242
- table.fm-category-mapping-table th#shop-category-selector {
243
- vertical-align: top;
244
- width: 2.2em
245
- }
246
-
247
- td.channel-tile {
248
- border: 1px solid #ccc;
249
- box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
250
- -moz-box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
251
- -webkit-box-shadow: 0 0 5px rgba(0, 0, 0, 0.25);
252
- max-width: 340px;
253
- min-width: 250px;
254
- vertical-align: top
255
- }
256
-
257
- img.channel-thumbnail {
258
- border: 0;
259
- max-width: 300px;
260
- width: 100%
261
- }
262
-
263
- div.channel-inner {
264
- margin: 20px
265
- }
266
-
267
- div.channel-version {
268
- background-color: #eee;
269
- border: 1px solid #dadada;
270
- border-radius: 3px;
271
- -webkit-border-radius: 3px;
272
- -moz-border-radius: 3px;
273
- color: #424242;
274
- display: block;
275
- font-weight: bold;
276
- margin-bottom: 12px;
277
- padding: 6px
278
- }
279
-
280
- div#outdated {
281
- color: red
282
- }
283
-
284
- div.product-filter-condition-wrapper {
285
- float: right;
286
- font-size: 16px;
287
- margin-top: 20px;
288
- width: 59%
289
- }
290
-
291
- section.tvc-main-input-wrapper {
292
- float: left;
293
- margin-top: 20px;
294
- width: 50%
295
- }
296
-
297
- tr.tvc-main-feed-input-row {
298
- height: 47px
299
- }
300
-
301
- table.fm-category-mapping-table thead {
302
- background: #e5e5e5;
303
- }
304
-
305
- table.fm-category-mapping-table thead, table.fm-category-mapping-table tbody {
306
- float: left;
307
- width: 100%
308
- }
309
-
310
- table.fm-category-mapping-table tbody {
311
- height: 280px;
312
- overflow-y: scroll
313
- }
314
-
315
- table.fm-category-mapping-table tr:nth-child(2n) td, table.fm-category-mapping-table tr:nth-child(2n) th {
316
- background-color: #fcfcfc
317
- }
318
-
319
- thead.fm-category-mapping-titles th {
320
- font-weight: 400
321
- }
322
-
323
- thead.fm-category-mapping-titles tr {
324
- width: 98% !important
325
- }
326
-
327
- table.fm-category-mapping-table td:first-child {
328
- width: 16%
329
- }
330
-
331
- table.fm-category-mapping-table tr {
332
- display: table;
333
- text-align: left;
334
- width: 100%
335
- }
336
-
337
- table.tvc-feed-main-input-table th {
338
- padding-right: 0;
339
- width: 40%
340
- }
341
-
342
- table.tvc-feed-main-input-table input {
343
- width: 90%
344
- }
345
-
346
- table.tvc-feed-main-input-table input#aggregator, table.tvc-feed-main-input-table input#variations {
347
- width: 10px
348
- }
349
-
350
- table.tvc-feed-main-input-table select {
351
- width: 90%;
352
- margin-bottom: 10px;
353
- }
354
-
355
- .message-field {
356
- font-size: 16px;
357
- margin: 20px 0 3px 0
358
- }
359
-
360
- #disposable-warning-message {
361
- margin: 20px 0 3px 0
362
- }
363
-
364
- button#disposable-notice-button {
365
- position: relative
366
- }
367
-
368
- .full-screen-message-field p {
369
- color: red;
370
- font-size: 17px;
371
- margin: 20px 0 3px 0
372
- }
373
-
374
- span.output-field-label {
375
- border-radius: 3px;
376
- color: #000;
377
- margin-top: 4px;
378
- padding: 4px 10px
379
- }
380
-
381
- div.colw {
382
- float: left;
383
- padding: 5px
384
- }
385
-
386
- div.edit-values-row {
387
- float: left;
388
- margin: 20px 10px 10px 30px;
389
- width: 80%
390
- }
391
-
392
- div.end-row {
393
- clear: both
394
- }
395
-
396
- div.field-table-row {
397
- height: 20px
398
- }
399
-
400
- div.field-table-row-edit-source {
401
- clear: both;
402
- float: left
403
- }
404
-
405
- div.field-table-row-combined-selection {
406
- left: -181px;
407
- line-height: 26px;
408
- margin: 5px;
409
- position: relative;
410
- width: 680px
411
- }
412
-
413
- div.combined-wrapper {
414
- line-height: 26px;
415
- width: 100%
416
- }
417
-
418
- div.or-selector {
419
- line-height: 26px;
420
- margin-top: 30px;
421
- width: 120%
422
- }
423
-
424
- div.dotted-top-line {
425
- border-top-style: dashed;
426
- border-top-color: #ccc;
427
- border-top-width: 1px;
428
- margin-top: 20px
429
- }
430
-
431
- span.combined-field-row {
432
- clear: left;
433
- float: left
434
- }
435
-
436
- input.free-category-text-input {
437
- width: 90%
438
- }
439
-
440
- div.button-wrapper {
441
- clear: both
442
- }
443
-
444
- .button-primary {
445
- margin-top: 25px !important;
446
- margin-right: 5px !important
447
- }
448
-
449
- a.channel-button {
450
- margin-right: 5px !important
451
- }
452
-
453
- a.tvc-btn-small {
454
- font-size: 13px
455
- }
456
-
457
- a.tvc-rating-request {
458
- color: #ffb900
459
- }
460
-
461
- input.feed-list-lower-button {
462
- position: relative;
463
- margin-bottom: 10px !important
464
- }
465
-
466
- div.select-control {
467
- float: left;
468
- margin: 0;
469
- vertical-align: top
470
- }
471
-
472
- div.static-value-control {
473
- float: left
474
- }
475
-
476
- #wpcontent{
477
- height: 100%;
478
- /*padding-left: 0 !important;*/
479
- }
480
-
481
- @media only screen and (min-width: 1200px){
482
- .container{
483
- margin-left: 8% !important;
484
- width:auto;
485
- }
486
- .banner{
487
- width:100%;
488
- }
489
- }
490
- @media only screen and (min-width: 1920px){
491
- .container{
492
- margin-left: 6% !important;
493
- width:auto;
494
- }
495
-
496
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/tvc_setting-page.css DELETED
@@ -1,58 +0,0 @@
1
- .container{
2
- margin-left: 8% !important;
3
- width:auto;
4
- }
5
- .banner{
6
- width:100%;
7
- }
8
-
9
- @media only screen and (min-width: 1920px){
10
- .container{
11
- margin-left: 6% !important;
12
- width:auto;
13
- }
14
- }
15
- #feed-spinner {
16
- /*height: 200px;*/ /*height of the spinner gif +2px to fix IE8 issue */
17
- left: 50%;
18
- margin-left: -25px; /* half width of the spinner gif */
19
- margin-top: -25px; /* half height of the spinner gif */
20
- overflow: auto;
21
- position: fixed;
22
- text-align: center;
23
- top: 40%;
24
- /*width: 200px;*/ /* width of the spinner gif */
25
- z-index: 1234;
26
- }
27
- #footer-left{
28
- display: none;
29
- }
30
-
31
- #tvc-backups th {
32
- padding: 15px 10px;
33
- }
34
-
35
- #tvc-backups .tvc-backup-filename {
36
- width: 180px;
37
- }
38
-
39
- #tvc-backups .tvc-backup-file_date {
40
- width: 100px;
41
- }
42
-
43
- table.smallfat {
44
- background: #fff;
45
- border: 1px solid #e5e5e5;
46
- box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
47
- border-spacing: 0;
48
- clear: both;
49
- margin: 0;
50
- }
51
-
52
- #tvc_third_party_attr_keys {
53
- width: 800px;
54
- }
55
-
56
- #tvc_notice_mailaddress {
57
- width: 300px;
58
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
css/tvc_setting-page.min.css DELETED
@@ -1,41 +0,0 @@
1
- #feed-spinner {
2
- /*height: 50px;*/
3
- left: 50%;
4
- margin-left: -25px;
5
- margin-top: -25px;
6
- overflow: auto;
7
- position: fixed;
8
- text-align: center;
9
- top: 35%;
10
- /*width: 50px;*/
11
- z-index: 1234
12
- }
13
-
14
- #tvc-backups th {
15
- padding: 15px 10px
16
- }
17
-
18
- #tvc-backups .tvc-backup-filename {
19
- width: 180px
20
- }
21
-
22
- #tvc-backups .tvc-backup-file_date {
23
- width: 100px
24
- }
25
-
26
- table.smallfat {
27
- background: #fff;
28
- border: 1px solid #e5e5e5;
29
- box-shadow: 0 1px 1px rgba(0, 0, 0, .04);
30
- border-spacing: 0;
31
- clear: both;
32
- margin: 0
33
- }
34
-
35
- #tvc_third_party_attr_keys {
36
- width: 800px
37
- }
38
-
39
- #tvc_notice_mailaddress {
40
- width: 300px
41
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
enhanced-ecommerce-google-analytics.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
19
- * Version: 3.0.2
20
  * Author: Tatvic
21
  * Author URI: www.tatvic.com
22
  * License: GPL-2.0+
@@ -38,7 +38,7 @@ if ( ! defined( 'WPINC' ) ) {
38
  * Start at version 1.0.0 and use SemVer - https://semver.org
39
  * Rename this for your plugin and update it as you release new versions.
40
  */
41
- define( 'PLUGIN_NAME_VERSION', '3.0.2' );
42
  $fullName = plugin_basename( __FILE__ );
43
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
44
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
@@ -102,9 +102,9 @@ if ( ! defined( 'TVC_MIN_REQUIRED_WC_VERSION' ) ) {
102
  define( 'TVC_MIN_REQUIRED_WC_VERSION', '3.0.0' );
103
  }
104
  if ( ! defined( 'TVC_API_CALL_URL' ) ) {
105
- define( 'TVC_API_CALL_URL', 'https://connect.tatvic.com/laravelapi/public/api' );
106
  }
107
- if ( ! defined( 'TVC_AUTH_CONNECT_URL' ) ) {
108
  define( 'TVC_AUTH_CONNECT_URL', 'estorenew.tatvic.com' );
109
  }
110
  if(!defined('TVC_Admin_Helper')){
@@ -153,4 +153,4 @@ function run_enhanced_ecommerce_google_analytics() {
153
  $plugin->run();
154
 
155
  }
156
- run_enhanced_ecommerce_google_analytics();
16
  * Plugin Name: Enhanced E-commerce for Woocommerce store
17
  * Plugin URI: https://www.tatvic.com/tatvic-labs/woocommerce-extension/
18
  * Description: Automates eCommerce tracking in Google Analytics, dynamic remarkting in Google Ads, and provides complete Google Shopping features.
19
+ * Version: 3.0.3
20
  * Author: Tatvic
21
  * Author URI: www.tatvic.com
22
  * License: GPL-2.0+
38
  * Start at version 1.0.0 and use SemVer - https://semver.org
39
  * Rename this for your plugin and update it as you release new versions.
40
  */
41
+ define( 'PLUGIN_NAME_VERSION', '3.0.3' );
42
  $fullName = plugin_basename( __FILE__ );
43
  $dir = str_replace('/enhanced-ecommerce-google-analytics.php','',$fullName);
44
  if ( ! defined( 'ENHANCAD_PLUGIN_NAME' ) ) {
102
  define( 'TVC_MIN_REQUIRED_WC_VERSION', '3.0.0' );
103
  }
104
  if ( ! defined( 'TVC_API_CALL_URL' ) ) {
105
+ define( 'TVC_API_CALL_URL', 'https://connect.tatvic.com/laravelapi/public/api' );
106
  }
107
+ if ( ! defined( 'TVC_AUTH_CONNECT_URL' ) ) {
108
  define( 'TVC_AUTH_CONNECT_URL', 'estorenew.tatvic.com' );
109
  }
110
  if(!defined('TVC_Admin_Helper')){
153
  $plugin->run();
154
 
155
  }
156
+ run_enhanced_ecommerce_google_analytics();
includes/application/tvc-support-fields.php DELETED
@@ -1,118 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @package TVC Product Review Feed Manager/Functions
5
- * @version 1.0.0
6
- * @since 2.10.0
7
- */
8
-
9
- if ( ! defined( 'ABSPATH' ) ) {
10
- exit;
11
- }
12
-
13
- /**
14
- * Adds custom fields to the products inventory card that can be used in the feeds.
15
- */
16
- function tvc_create_gtin_wc_support_field() {
17
-
18
- // Add the Brand field.
19
- woocommerce_wp_text_input(
20
- array(
21
- 'id' => 'tvc_product_brand',
22
- 'label' => 'Product brand',
23
- 'class' => 'tvc_product_brand',
24
- 'desc_tip' => true,
25
- 'description' => esc_html__('Brand name of the product. If the product has no brand name you can use the manufacturer or supplier name.', 'tvc-product-feed-manager' ),
26
- )
27
- );
28
-
29
- // Add the GTIN field.
30
- woocommerce_wp_text_input(
31
- array(
32
- 'id' => 'tvc_product_gtin',
33
- 'label' => 'Product GTIN',
34
- 'class' => 'tvc_product_gtin',
35
- 'desc_tip' => true,
36
- 'description' => esc_html__('GTIN refers to a products Global Trade Item Number. You can also use a UPC, EAN, JAN, ISBN or ITF-14 number here.', 'tvc-product-feed-manager' ),
37
- )
38
- );
39
-
40
- // Add the MPN field.
41
- woocommerce_wp_text_input(
42
- array(
43
- 'id' => 'tvc_product_mpn',
44
- 'label' => 'Product MPN',
45
- 'class' => 'tvc_product_mpn',
46
- 'desc_tip' => true,
47
- 'description' => esc_html__('Add your products Manufacturer Part Number (MPN).', 'tvc-product-feed-manager' ),
48
- )
49
- );
50
- }
51
-
52
- add_action( 'woocommerce_product_options_inventory_product_data', 'tvc_create_gtin_wc_support_field' );
53
-
54
- /**
55
- * Saves the custom fields data.
56
- *
57
- * @param mixed $post_id Post ID of the product.
58
- */
59
- function tvc_save_custom_fields( $post_id ) {
60
- $product = wc_get_product( $post_id );
61
-
62
- // Get the custom fields data.
63
- $brand = isset( $_POST['tvc_product_brand'] ) ? $_POST['tvc_product_brand'] : '';
64
- $gtin = isset( $_POST['tvc_product_gtin'] ) ? $_POST['tvc_product_gtin'] : '';
65
- $mpn = isset( $_POST['tvc_product_mpn'] ) ? $_POST['tvc_product_mpn'] : '';
66
-
67
- // Save the custom fields data.
68
- $product->update_meta_data( 'tvc_product_brand', sanitize_text_field( $brand ) );
69
- $product->update_meta_data( 'tvc_product_gtin', sanitize_text_field( $gtin ) );
70
- $product->update_meta_data( 'tvc_product_mpn', sanitize_text_field( $mpn ) );
71
-
72
- $product->save();
73
- }
74
-
75
- add_action( 'woocommerce_process_product_meta', 'tvc_save_custom_fields' );
76
-
77
- /**
78
- * Adds custom fields to the products inventory card of the product variations.
79
- *
80
- * @param array $loop
81
- * @param object $variation_data
82
- * @param object $variation
83
- */
84
- function tvc_create_mpn_wc_variation_support_field( $loop, $variation_data, $variation ) {
85
-
86
- echo '<div class="options_group form-row form-row-full">';
87
-
88
- // Add the MPN text field to the variation cards.
89
- woocommerce_wp_text_input(
90
- array(
91
- 'id' => 'tvc_product_mpn[' . $variation->ID . ']',
92
- 'label' => esc_html__('Product MPN', 'tvc-product-feed-manager'),
93
- 'desc_tip' => true,
94
- 'description' => esc_html__('Add your products Manufacturer Part Number (MPN).', 'tvc-product-feed-manager'),
95
- 'value' => get_post_meta( $variation->ID, 'tvc_product_mpn', true ),
96
- )
97
- );
98
-
99
- echo '</div>';
100
- }
101
-
102
- add_action( 'woocommerce_variation_options', 'tvc_create_mpn_wc_variation_support_field', 10, 3 );
103
-
104
- /**
105
- * Saves the custom fields data of the product variations.
106
- *
107
- * @param int $post_id
108
- */
109
- function tvc_save_variation_custom_fields( $post_id ) {
110
-
111
- // Get the variations mpn.
112
- $woocommerce_text_field = $_POST['tvc_product_mpn'][ $post_id ];
113
-
114
- // Update.
115
- update_post_meta( $post_id, 'tvc_product_mpn', sanitize_text_field( $woocommerce_text_field ) );
116
- }
117
-
118
- add_action( 'woocommerce_save_product_variation', 'tvc_save_variation_custom_fields', 10, 2 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
includes/class-enhanced-ecommerce-google-analytics-activator.php CHANGED
@@ -30,7 +30,9 @@ class Enhanced_Ecommerce_Google_Analytics_Activator {
30
  *
31
  * @since 1.0.0
32
  */
33
- public static function activate() {
34
-
 
 
35
  }
36
  }
30
  *
31
  * @since 1.0.0
32
  */
33
+ public static function activate() {
34
+ if (!is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
35
+ wp_die('Hey, It seems WooCommerce plugin is not active on your wp-admin. Enhanced ecommerce plugin can only be activated if you have active WooCommerce plugin in your wp-admin. <br><a href="' . admin_url( 'plugins.php' ) . '">&laquo; Return to Plugins</a>');
36
+ }
37
  }
38
  }
includes/class-enhanced-ecommerce-google-analytics.php CHANGED
@@ -122,8 +122,6 @@ class Enhanced_Ecommerce_Google_Analytics {
122
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/data/class-tvc-feed-crud-handler.php';
123
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/data/class-tvc-taxonomies.php';
124
 
125
- require_once plugin_dir_path(dirname(__FILE__)) . 'includes/application/tvc-support-fields.php';
126
-
127
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-tvc-register-scripts.php';
128
  /**
129
  * The class responsible for defining all actions that occur in the admin area.
@@ -170,6 +168,8 @@ class Enhanced_Ecommerce_Google_Analytics {
170
  // $this->loader->add_action("admin_menu", $plugin_admin, "add_new_menu");
171
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
172
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
 
 
173
  }
174
 
175
  /**
@@ -182,6 +182,8 @@ class Enhanced_Ecommerce_Google_Analytics {
182
  private function define_public_hooks() {
183
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
184
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
 
 
185
  $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
186
  $this->loader->add_action("woocommerce_after_shop_loop_item", $plugin_public, "bind_product_metadata");
187
  $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
@@ -217,6 +219,8 @@ class Enhanced_Ecommerce_Google_Analytics {
217
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
218
  if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
219
  $this->loader->run();
 
 
220
  }
221
  }
222
  }
122
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/data/class-tvc-feed-crud-handler.php';
123
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/data/class-tvc-taxonomies.php';
124
 
 
 
125
  require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-tvc-register-scripts.php';
126
  /**
127
  * The class responsible for defining all actions that occur in the admin area.
168
  // $this->loader->add_action("admin_menu", $plugin_admin, "add_new_menu");
169
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' );
170
  $this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' );
171
+ $this->loader->add_action( 'admin_notices', $plugin_admin, 'tvc_admin_notice' );
172
+
173
  }
174
 
175
  /**
182
  private function define_public_hooks() {
183
  $plugin_public = new Enhanced_Ecommerce_Google_Analytics_Public( $this->get_plugin_name(), $this->get_version() );
184
  $this->loader->add_action("wp_head", $plugin_public, "ee_settings");
185
+ $this->loader->add_action("wp_head", $plugin_public, "add_google_site_verification_tag",1);
186
+
187
  $this->loader->add_action("wp_footer", $plugin_public, "t_products_impre_clicks");
188
  $this->loader->add_action("woocommerce_after_shop_loop_item", $plugin_public, "bind_product_metadata");
189
  $this->loader->add_action("woocommerce_thankyou", $plugin_public, "ecommerce_tracking_code");
219
  include_once( ABSPATH . 'wp-admin/includes/plugin.php' );
220
  if ( is_plugin_active( 'woocommerce/woocommerce.php' ) ) {
221
  $this->loader->run();
222
+ }else if( is_plugin_active( 'enhanced-e-commerce-for-woocommerce-store/enhanced-ecommerce-google-analytics.php' ) ){
223
+ printf('<div class="notice notice-error"><p>Hey, It seems WooCommerce plugin is not active on your wp-admin. Enhanced ecommerce plugin can only be activated if you have active WooCommerce plugin in your wp-admin.</p></div>');
224
  }
225
  }
226
  }
includes/data/class-tvc-ajax-file.php CHANGED
@@ -44,6 +44,7 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
44
  add_action('wp_ajax_tvcajax-store-time-taken', array($this, 'tvcajax_store_time_taken'));
45
  add_action('wp_ajax_tvc_call_api_sync', array($this, 'tvc_call_api_sync'));
46
  add_action('wp_ajax_tvc_call_domain_claim', array($this, 'tvc_call_domain_claim'));
 
47
  }
48
  public function tvc_call_api_sync(){
49
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiSyncupNonce'), 'tvc_call_api_sync-nonce')){
@@ -54,11 +55,25 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
54
  }
55
  exit;
56
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  public function tvc_call_domain_claim(){
58
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiDomainClaimNonce'), 'tvc_call_domain_claim-nonce')){
59
  $TVC_Admin_Helper = new TVC_Admin_Helper();
60
  $tvc_rs = $TVC_Admin_Helper->call_domain_claim();
61
- if($tvc_rs['error'] == 1){
62
  echo json_encode(array('status' => 'error', 'message' => $tvc_rs['msg']));
63
  }else{
64
  echo json_encode(array('status' => 'success', 'message' => $tvc_rs['msg']));
@@ -709,16 +724,16 @@ class TVC_Ajax_File extends TVC_Ajax_Calls {
709
  $fixed_att_select_list = array("gender", "age_group", "shipping", "tax", "content_language", "target_country", "condition");
710
  foreach ($fixed_att_select_list as $fixed_key) {
711
  if(isset($formArray[$fixed_key]) && $formArray[$fixed_key] != "" ){
712
- if($fixed_key == "shipping" && $formArray[$fixed_key] != 0){
713
  $temp_product[$fixed_key]['price']['value'] = $formArray[$fixed_key];
714
  $temp_product[$fixed_key]['price']['currency'] = $tvc_currency;
715
  $temp_product[$fixed_key]['country'] = $formArray['target_country'];
716
  //$temp_product[$fixed_key] =$formArray['target_country'].'::'.$formArray[$fixed_key].' '.$tvc_currency;
717
- }else if($fixed_key == "tax" && $formArray[$fixed_key] != 0){
718
  //$temp_product[$fixed_key] =$formArray['target_country'].'::'.$formArray[$fixed_key];
719
  $temp_product['taxes']['rate'] = $formArray[$fixed_key];
720
  $temp_product['taxes']['country'] = $formArray['target_country'];
721
- }else if( $formArray[$fixed_key] != 0 || $formArray[$fixed_key] != ""){
722
  $temp_product[$fixed_key] = $formArray[$fixed_key];
723
  }
724
  }
44
  add_action('wp_ajax_tvcajax-store-time-taken', array($this, 'tvcajax_store_time_taken'));
45
  add_action('wp_ajax_tvc_call_api_sync', array($this, 'tvc_call_api_sync'));
46
  add_action('wp_ajax_tvc_call_domain_claim', array($this, 'tvc_call_domain_claim'));
47
+ add_action('wp_ajax_tvc_call_site_verified', array($this, 'tvc_call_site_verified'));
48
  }
49
  public function tvc_call_api_sync(){
50
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiSyncupNonce'), 'tvc_call_api_sync-nonce')){
55
  }
56
  exit;
57
  }
58
+ public function tvc_call_site_verified(){
59
+ if($this->safe_ajax_call(filter_input(INPUT_POST, 'SiteVerifiedNonce'), 'tvc_call_site_verified-nonce')){
60
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
61
+ $tvc_rs =[];
62
+ $tvc_rs = $TVC_Admin_Helper->call_site_verified();
63
+ if(isset($tvc_rs['error']) && $tvc_rs['error'] == 1){
64
+ echo json_encode(array('status' => 'error', 'message' => $tvc_rs['msg']));
65
+ }else{
66
+ echo json_encode(array('status' => 'success', 'message' => $tvc_rs['msg']));
67
+ }
68
+ exit;
69
+ }
70
+ exit;
71
+ }
72
  public function tvc_call_domain_claim(){
73
  if($this->safe_ajax_call(filter_input(INPUT_POST, 'apiDomainClaimNonce'), 'tvc_call_domain_claim-nonce')){
74
  $TVC_Admin_Helper = new TVC_Admin_Helper();
75
  $tvc_rs = $TVC_Admin_Helper->call_domain_claim();
76
+ if(isset($tvc_rs['error']) && $tvc_rs['error'] == 1){
77
  echo json_encode(array('status' => 'error', 'message' => $tvc_rs['msg']));
78
  }else{
79
  echo json_encode(array('status' => 'success', 'message' => $tvc_rs['msg']));
724
  $fixed_att_select_list = array("gender", "age_group", "shipping", "tax", "content_language", "target_country", "condition");
725
  foreach ($fixed_att_select_list as $fixed_key) {
726
  if(isset($formArray[$fixed_key]) && $formArray[$fixed_key] != "" ){
727
+ if($fixed_key == "shipping" && $formArray[$fixed_key] != ""){
728
  $temp_product[$fixed_key]['price']['value'] = $formArray[$fixed_key];
729
  $temp_product[$fixed_key]['price']['currency'] = $tvc_currency;
730
  $temp_product[$fixed_key]['country'] = $formArray['target_country'];
731
  //$temp_product[$fixed_key] =$formArray['target_country'].'::'.$formArray[$fixed_key].' '.$tvc_currency;
732
+ }else if($fixed_key == "tax" && $formArray[$fixed_key] != ""){
733
  //$temp_product[$fixed_key] =$formArray['target_country'].'::'.$formArray[$fixed_key];
734
  $temp_product['taxes']['rate'] = $formArray[$fixed_key];
735
  $temp_product['taxes']['country'] = $formArray['target_country'];
736
+ }else if( $formArray[$fixed_key] != ""){
737
  $temp_product[$fixed_key] = $formArray[$fixed_key];
738
  }
739
  }
includes/setup/CustomApi.php CHANGED
@@ -76,10 +76,8 @@ class CustomApi{
76
  ),
77
  'body' => wp_json_encode($data)
78
  );
79
-
80
  // Send remote request
81
  $request = wp_remote_post($url, $args);
82
-
83
  // Retrieve information
84
  $response_code = wp_remote_retrieve_response_code($request);
85
  $response_message = wp_remote_retrieve_response_message($request);
@@ -103,8 +101,6 @@ class CustomApi{
103
  }
104
 
105
  public function getGoogleAnalyticDetail() {
106
- $TVC_Admin_Helper = new TVC_Admin_Helper();
107
- $TVC_Admin_Helper->add_tvc_log("==> getGoogleAnalyticDetail");
108
  try {
109
  $url = $this->apiDomain . '/customer-subscriptions/subscription-detail';
110
  $ee_options_data = unserialize(get_option('ee_options'));
@@ -113,7 +109,7 @@ class CustomApi{
113
  } else {
114
  $ee_subscription_id = null;
115
  }
116
- $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
117
  $data = [
118
  'subscription_id' => $ee_subscription_id,
119
  'domain' => $actual_link
@@ -125,15 +121,14 @@ class CustomApi{
125
  ),
126
  'body' => wp_json_encode($data)
127
  );
128
- //echo "<pre>";
129
- //print_r($args);
130
- // Send remote request
131
  $request = wp_remote_post($url, $args);
132
 
133
  // Retrieve information
134
  $response_code = wp_remote_retrieve_response_code($request);
135
  $response_message = wp_remote_retrieve_response_message($request);
136
  $response_body = json_decode(wp_remote_retrieve_body($request));
 
137
  if ((isset($response_body->error) && $response_body->error == '')) {
138
  if ($response_body->data) {
139
  $store_raw_country = get_option('woocommerce_default_country');
@@ -336,7 +331,6 @@ class CustomApi{
336
  );
337
  $curl_url = $this->apiDomain . "/products/list";
338
  $postData = json_encode($postData);
339
- // print_r($postData);
340
  $ch = curl_init();
341
  curl_setopt_array($ch, array(
342
  CURLOPT_URL => esc_url($curl_url),
@@ -347,8 +341,6 @@ class CustomApi{
347
  ));
348
  $response = curl_exec($ch);
349
  $response = json_decode($response);
350
- //print_r($response);
351
- //exit;
352
  $return = new \stdClass();
353
  if (isset($response->error) && $response->error == '') {
354
  $return->status = 200;
@@ -411,7 +403,7 @@ class CustomApi{
411
  );
412
  // Send remote request
413
  $request = wp_remote_post($url, $args);
414
- // print_r($request);
415
  // Retrieve information
416
  $response_code = wp_remote_retrieve_response_code($request);
417
  $response_message = wp_remote_retrieve_response_message($request);
@@ -448,10 +440,8 @@ class CustomApi{
448
  );
449
 
450
  // Send remote request
451
- /* echo "<pre>";
452
- print_r($args); */
453
  $request = wp_remote_post($url, $args);
454
- // print_r($request);
455
  // Retrieve information
456
  $response_code = wp_remote_retrieve_response_code($request);
457
  $response_message = wp_remote_retrieve_response_message($request);
@@ -477,7 +467,7 @@ class CustomApi{
477
  public function getSubscriptionDetail($id) {
478
  try {
479
  $url = $this->apiDomain . '/customer-subscriptions/subscription-detail';
480
- $actual_link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http") . "://$_SERVER[HTTP_HOST]";
481
  $data = [
482
  'subscription_id' => $id,
483
  'domain' => $actual_link
@@ -590,11 +580,8 @@ class CustomApi{
590
  $response = curl_exec($ch);
591
 
592
  $response = json_decode($response);
593
- //print_r($response);
594
- //return $response->access_token;
595
  if(isset($response->access_token)){
596
- //echo $response->access_token;
597
-
598
  return $response->access_token;
599
  }else{
600
  return $access_token;
@@ -655,7 +642,8 @@ class CustomApi{
655
  $data = [
656
  'merchant_id' => $postData['merchant_id'],
657
  'website' => $postData['website_url'],
658
- 'account_id' => $postData['account_id']
 
659
  ];
660
 
661
  $this->curl_url = $url;
@@ -689,7 +677,8 @@ class CustomApi{
689
  'merchant_id' => $postData['merchant_id'],
690
  'website' => $postData['website_url'],
691
  'subscription_id' => $postData['subscription_id'],
692
- 'account_id' => $postData['account_id']
 
693
  ];
694
 
695
  $this->curl_url = $url;
76
  ),
77
  'body' => wp_json_encode($data)
78
  );
 
79
  // Send remote request
80
  $request = wp_remote_post($url, $args);
 
81
  // Retrieve information
82
  $response_code = wp_remote_retrieve_response_code($request);
83
  $response_message = wp_remote_retrieve_response_message($request);
101
  }
102
 
103
  public function getGoogleAnalyticDetail() {
 
 
104
  try {
105
  $url = $this->apiDomain . '/customer-subscriptions/subscription-detail';
106
  $ee_options_data = unserialize(get_option('ee_options'));
109
  } else {
110
  $ee_subscription_id = null;
111
  }
112
+ $actual_link = get_site_url();
113
  $data = [
114
  'subscription_id' => $ee_subscription_id,
115
  'domain' => $actual_link
121
  ),
122
  'body' => wp_json_encode($data)
123
  );
124
+
 
 
125
  $request = wp_remote_post($url, $args);
126
 
127
  // Retrieve information
128
  $response_code = wp_remote_retrieve_response_code($request);
129
  $response_message = wp_remote_retrieve_response_message($request);
130
  $response_body = json_decode(wp_remote_retrieve_body($request));
131
+
132
  if ((isset($response_body->error) && $response_body->error == '')) {
133
  if ($response_body->data) {
134
  $store_raw_country = get_option('woocommerce_default_country');
331
  );
332
  $curl_url = $this->apiDomain . "/products/list";
333
  $postData = json_encode($postData);
 
334
  $ch = curl_init();
335
  curl_setopt_array($ch, array(
336
  CURLOPT_URL => esc_url($curl_url),
341
  ));
342
  $response = curl_exec($ch);
343
  $response = json_decode($response);
 
 
344
  $return = new \stdClass();
345
  if (isset($response->error) && $response->error == '') {
346
  $return->status = 200;
403
  );
404
  // Send remote request
405
  $request = wp_remote_post($url, $args);
406
+
407
  // Retrieve information
408
  $response_code = wp_remote_retrieve_response_code($request);
409
  $response_message = wp_remote_retrieve_response_message($request);
440
  );
441
 
442
  // Send remote request
443
+
 
444
  $request = wp_remote_post($url, $args);
 
445
  // Retrieve information
446
  $response_code = wp_remote_retrieve_response_code($request);
447
  $response_message = wp_remote_retrieve_response_message($request);
467
  public function getSubscriptionDetail($id) {
468
  try {
469
  $url = $this->apiDomain . '/customer-subscriptions/subscription-detail';
470
+ $actual_link = get_site_url();
471
  $data = [
472
  'subscription_id' => $id,
473
  'domain' => $actual_link
580
  $response = curl_exec($ch);
581
 
582
  $response = json_decode($response);
583
+
 
584
  if(isset($response->access_token)){
 
 
585
  return $response->access_token;
586
  }else{
587
  return $access_token;
642
  $data = [
643
  'merchant_id' => $postData['merchant_id'],
644
  'website' => $postData['website_url'],
645
+ 'account_id' => $postData['account_id'],
646
+ 'method' => $postData['method']
647
  ];
648
 
649
  $this->curl_url = $url;
677
  'merchant_id' => $postData['merchant_id'],
678
  'website' => $postData['website_url'],
679
  'subscription_id' => $postData['subscription_id'],
680
+ 'account_id' => $postData['account_id'],
681
+ 'method' => $postData['method']
682
  ];
683
 
684
  $this->curl_url = $url;
includes/setup/add-campaign.php CHANGED
@@ -4,7 +4,7 @@ class AddCampaign {
4
 
5
  public $response;
6
  public $post_data;
7
- public $access_token;
8
  public $gmail;
9
  public $merchantId;
10
  public $new_campaign;
@@ -18,7 +18,7 @@ class AddCampaign {
18
  $this->customApiObj->getGoogleAnalyticDetail();
19
 
20
  $this->post_data = $_POST;
21
- $this->access_token = $_SESSION['access_token'];
22
  $this->gmail = isset($_COOKIE['g_mail']) ? $_COOKIE['g_mail'] : '';
23
 
24
  $this->merchantId = (isset($GLOBALS['tatvicData']['tvc_merchant'])) ? $GLOBALS['tatvicData']['tvc_merchant'] : "";
4
 
5
  public $response;
6
  public $post_data;
7
+ //public $access_token;
8
  public $gmail;
9
  public $merchantId;
10
  public $new_campaign;
18
  $this->customApiObj->getGoogleAnalyticDetail();
19
 
20
  $this->post_data = $_POST;
21
+ //$this->access_token = $_SESSION['access_token'];
22
  $this->gmail = isset($_COOKIE['g_mail']) ? $_COOKIE['g_mail'] : '';
23
 
24
  $this->merchantId = (isset($GLOBALS['tatvicData']['tvc_merchant'])) ? $GLOBALS['tatvicData']['tvc_merchant'] : "";
includes/setup/google-shopping-feed-gaa-config.php CHANGED
@@ -44,6 +44,14 @@ class GAAConfiguration {
44
  $class = 'notice notice-success';
45
  $message = esc_html__('Get your WooCommerce products in front of the millions of shoppers across Google by setting up your Google Merchant Center account from below.');
46
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
 
 
 
 
 
 
 
 
47
  }
48
  $category_wrapper_obj = new Tatvic_Category_Wrapper();
49
  $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
@@ -110,7 +118,7 @@ class GAAConfiguration {
110
  <h2 class="ga-title">Sync Products:</h2>
111
  </div>
112
  <div class="col-6 col-md-6">
113
- <button type="button" class="btn btn-primary btn-success" data-toggle="modal" data-target="#syncProduct">Sync New Products</button>
114
  </div>
115
  </div>
116
  <div class="row mb-3">
@@ -205,15 +213,15 @@ class GAAConfiguration {
205
  <div class="form-group">';
206
  $tvc_select_option = $wooCommerceAttributes;
207
  $require = (isset($attribute['required']) && $attribute['required'])?true:false;
208
- $sel_val = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
209
  if($attribute["field"]=='link'){
210
  echo "product link";
211
  }else if($attribute["field"]=='shipping'){
212
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
213
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
214
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
215
  }else if($attribute["field"]=='tax'){
216
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
217
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
218
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
219
  }else if($attribute["field"]=='content_language'){
@@ -227,11 +235,11 @@ class GAAConfiguration {
227
  $tvc_select_option=[];
228
  foreach( $tvc_select_option_t as $o_val ){
229
  $tvc_select_option[]['field'] = $o_val;
230
- }
 
231
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
232
- }else{
233
- //print_r($ee_mapped_attrs);
234
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
235
  //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
236
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
237
  }
@@ -250,10 +258,27 @@ class GAAConfiguration {
250
  </div>
251
  </div>
252
  <?php echo get_connect_google_popup_html()?>
253
- <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list(); ?>
 
 
 
 
254
  <script type="text/javascript">
255
  $(document).ready(function() {
256
  $(".select2").select2();
 
 
 
 
 
 
 
 
 
 
 
 
 
257
  });
258
  $(".tab-wizard").steps({
259
  headerTag: "h5",
@@ -277,7 +302,7 @@ $(".tab-wizard").steps({
277
  if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
278
  return true;
279
  }else{
280
- alert("Select at least one Google Merchant Center Category.");
281
  return false;
282
  }
283
  },
@@ -289,10 +314,11 @@ $(".tab-wizard").steps({
289
  jQuery(".field-required").each(function() {
290
  if($(this).val()==0 && valid){
291
  valid=false;
 
292
  }
293
  });
294
  if(!valid){
295
- alert("Please select all required fields");
296
  }else{
297
  submitProductSyncUp();
298
  }//check for required fields end
@@ -322,20 +348,20 @@ function submitProductSyncUp() {
322
  },
323
  function( response ) {
324
  jQuery("#feed-spinner").css("display", "none");
325
- console.log(response);
326
  var rsp = JSON.parse(response)
327
  if (rsp.status == "success") {
328
  $('#syncProduct').modal('hide');
329
- var message = "Your product are now being synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
330
  if (rsp.skipProducts > 0) {
331
  message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
332
  }
333
- alert(message);
334
- window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
 
 
335
  } else {
336
- //var message = "Products sync face some unprocessable entity";
337
- var message = rsp.message;
338
- alert(message);
339
  }
340
  }
341
  );
44
  $class = 'notice notice-success';
45
  $message = esc_html__('Get your WooCommerce products in front of the millions of shoppers across Google by setting up your Google Merchant Center account from below.');
46
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
47
+ ?>
48
+ <script>
49
+ $(document).ready(function() {
50
+ var msg="<?php echo $message;?>"
51
+ tvc_helper.tvc_alert("success","Hey!",msg,true);
52
+ });
53
+ </script>
54
+ <?php
55
  }
56
  $category_wrapper_obj = new Tatvic_Category_Wrapper();
57
  $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
118
  <h2 class="ga-title">Sync Products:</h2>
119
  </div>
120
  <div class="col-6 col-md-6">
121
+ <button id="tvc_btn_product_sync" type="button" class="btn btn-primary btn-success" data-toggle="modal" data-target="#syncProduct">Sync New Products</button>
122
  </div>
123
  </div>
124
  <div class="row mb-3">
213
  <div class="form-group">';
214
  $tvc_select_option = $wooCommerceAttributes;
215
  $require = (isset($attribute['required']) && $attribute['required'])?true:false;
216
+ $sel_val_def = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
217
  if($attribute["field"]=='link'){
218
  echo "product link";
219
  }else if($attribute["field"]=='shipping'){
220
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
221
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
222
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
223
  }else if($attribute["field"]=='tax'){
224
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
225
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
226
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
227
  }else if($attribute["field"]=='content_language'){
235
  $tvc_select_option=[];
236
  foreach( $tvc_select_option_t as $o_val ){
237
  $tvc_select_option[]['field'] = $o_val;
238
+ }
239
+ $sel_val = $sel_val_def;
240
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
241
+ }else{
242
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
 
243
  //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
244
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
245
  }
258
  </div>
259
  </div>
260
  <?php echo get_connect_google_popup_html()?>
261
+ <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
262
+ $is_need_to_domain_claim = false;
263
+ if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
264
+ $is_need_to_domain_claim = true;
265
+ }?>
266
  <script type="text/javascript">
267
  $(document).ready(function() {
268
  $(".select2").select2();
269
+
270
+ $(document).on("click", "#tvc_btn_product_sync", function(event){
271
+ var is_need_to_domain_claim = "<?php echo $is_need_to_domain_claim; ?>";
272
+ if(is_need_to_domain_claim == 1 || is_need_to_domain_claim == true){
273
+ event.preventDefault();
274
+ jQuery.post(myAjaxNonces.ajaxurl,{
275
+ action: "tvc_call_domain_claim",
276
+ apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
277
+ },function( response ){
278
+
279
+ });
280
+ }
281
+ });
282
  });
283
  $(".tab-wizard").steps({
284
  headerTag: "h5",
302
  if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
303
  return true;
304
  }else{
305
+ tvc_helper.tvc_alert("error","","Select at least one Google Merchant Center Category.",true);
306
  return false;
307
  }
308
  },
314
  jQuery(".field-required").each(function() {
315
  if($(this).val()==0 && valid){
316
  valid=false;
317
+ $(this).select2('focus');
318
  }
319
  });
320
  if(!valid){
321
+ tvc_helper.tvc_alert("error","","Please select all required fields");
322
  }else{
323
  submitProductSyncUp();
324
  }//check for required fields end
348
  },
349
  function( response ) {
350
  jQuery("#feed-spinner").css("display", "none");
351
+ //console.log(response);
352
  var rsp = JSON.parse(response)
353
  if (rsp.status == "success") {
354
  $('#syncProduct').modal('hide');
355
+ var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
356
  if (rsp.skipProducts > 0) {
357
  message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
358
  }
359
+ tvc_helper.tvc_alert("success","",message);
360
+ setTimeout(function(){
361
+ window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
362
+ }, 7000);
363
  } else {
364
+ vc_helper.tvc_alert("error","",rsp.message);
 
 
365
  }
366
  }
367
  );
includes/setup/google-shopping-feed-shopping-campaigns.php CHANGED
@@ -168,7 +168,7 @@ class CampaignsConfiguration
168
  }
169
 
170
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
171
- if ($google_detail->data['status'] == 200) {
172
  if (isset($google_detail->data['data'])) {
173
  $googleDetail = $google_detail->data['data'];
174
  }
@@ -188,7 +188,7 @@ class CampaignsConfiguration
188
  <div class="row">
189
  <div class="col-md-6 col-lg-8 border-right">
190
  <div class="configuration-section" id="config-pt1">
191
- '.get_google_shopping_tabs_html($this->site_url,$googleDetail->google_merchant_center_id).'
192
  </div>
193
  <div class="mt-3" id="config-pt2">
194
  <form method="post" id="date_range_form">
168
  }
169
 
170
  $google_detail = $this->customApiObj->getGoogleAnalyticDetail();
171
+ if (isset($google_detail->data['status']) && $google_detail->data['status'] == 200) {
172
  if (isset($google_detail->data['data'])) {
173
  $googleDetail = $google_detail->data['data'];
174
  }
188
  <div class="row">
189
  <div class="col-md-6 col-lg-8 border-right">
190
  <div class="configuration-section" id="config-pt1">
191
+ '.get_google_shopping_tabs_html($this->site_url,(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:"").'
192
  </div>
193
  <div class="mt-3" id="config-pt2">
194
  <form method="post" id="date_range_form">
includes/setup/google-shopping-feed-sync-product.php CHANGED
@@ -40,15 +40,24 @@ public function wooCommerceAttributes() {
40
 
41
  public function create_form(){
42
  if(isset($_GET['welcome_msg']) && $_GET['welcome_msg'] == true){
 
43
  $class = 'notice notice-success';
44
- $message = esc_html__('Congratulation..! Everthing is now set up. One more step - Sync your WooCommerce products into your Merchant Center and reach out to millions of shopper across Google.');
45
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
 
 
 
 
 
 
 
 
46
  }
47
  $category_wrapper_obj = new Tatvic_Category_Wrapper();
48
  $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
49
  $syncProductStat = [];
50
  $syncProductList = [];
51
- $last_api_sync_up ="";
52
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
53
  if(isset($google_detail['prod_sync_status'])){
54
  if ($google_detail['prod_sync_status']) {
@@ -65,11 +74,15 @@ public function create_form(){
65
  $googleDetail = $google_detail['setting'];
66
  }
67
  }
68
- if(isset($google_detail['sync_time'])){
69
- if ($google_detail['sync_time']) {
70
- $last_api_sync_up = date( 'Y-m-d H:i',$google_detail['sync_time']);
 
 
71
  }
 
72
  }
 
73
  ?>
74
  <div class="container-fluid">
75
  <div class="row">
@@ -90,7 +103,7 @@ public function create_form(){
90
  }?></span><img id="refresh_api" onclick="call_tvc_api_sync_up();" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png'; ?>">
91
  </div>
92
  <?php } ?>
93
- <?php echo get_google_shopping_tabs_html($this->site_url,$googleDetail->google_merchant_center_id); ?>
94
  </div>
95
  <div class="mt-3" id="config-pt2">
96
  <div class="sync-new-product" id="sync-product">
@@ -98,7 +111,7 @@ public function create_form(){
98
  <div class="col-12">
99
  <div class="d-flex justify-content-between ">
100
  <p class="mb-0 align-self-center">Products in your Merchant Center account</p>
101
- <button class="btn btn-primary btn-success align-self-center" data-toggle="modal" data-target="#syncProduct">Sync New Products</button>
102
  <a href="admin.php?page=enhanced-ecommerce-google-analytics-admin-display&amp;tab=add_campaign_page" class="btn btn-primary btn-success">Create Smart Shopping Campaign</a>
103
  </div>
104
  </div>
@@ -247,16 +260,16 @@ public function create_form(){
247
  <div class="form-group">';
248
  $tvc_select_option = $wooCommerceAttributes;
249
  $require = (isset($attribute['required']) && $attribute['required'])?true:false;
250
- $sel_val = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
251
  if($attribute["field"]=='link'){
252
  echo "product link";
253
  }else if($attribute["field"]=='shipping'){
254
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
255
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
256
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
257
  }else if($attribute["field"]=='tax'){
258
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
259
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
260
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
261
  }else if($attribute["field"]=='content_language'){
262
  echo $this->TVC_Admin_Helper->tvc_language_select($attribute["field"], '', 'Please Select Attribute', 'en',$require);
@@ -270,11 +283,10 @@ public function create_form(){
270
  foreach( $tvc_select_option_t as $o_val ){
271
  $tvc_select_option[]['field'] = $o_val;
272
  }
 
273
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
274
  }else{
275
-
276
- //print_r($ee_mapped_attrs);
277
- $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:"";
278
  //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
279
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
280
  }
@@ -293,10 +305,34 @@ public function create_form(){
293
  </div>
294
  </div>
295
  </div>
296
- <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list(); ?>
 
 
 
 
297
  <script type="text/javascript">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
298
  function call_tvc_api_sync_up(){
299
- var tvs_this = event.target;
300
  $("#tvc_msg").remove();
301
  $("#refresh_api").css("visibility","hidden");
302
  $(tvs_this).after('<div class="tvc-nb-spinner" id="tvc-nb-spinner"></div>');
@@ -307,8 +343,8 @@ function call_tvc_api_sync_up(){
307
  var rsp = JSON.parse(response);
308
  if(rsp.status == "success"){
309
  $("#tvc-nb-spinner").remove();
310
- $(tvs_this).after('<span id="tvc_msg">'+rsp.message+"</span>");
311
- setTimeout(function(){ $("#tvc_msg").remove(); location.reload();}, 4000);
312
  }
313
  });
314
  }
@@ -338,7 +374,7 @@ $(".tab-wizard").steps({
338
  if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
339
  return true;
340
  }else{
341
- alert("Select at least one Google Merchant Center Category.");
342
  return false;
343
  }
344
  },
@@ -350,10 +386,11 @@ $(".tab-wizard").steps({
350
  jQuery(".field-required").each(function() {
351
  if($(this).val()==0 && valid){
352
  valid=false;
 
353
  }
354
  });
355
  if(!valid){
356
- alert("Please select all required fields");
357
  }else{
358
  submitProductSyncUp();
359
  }//check for required fields end
@@ -387,16 +424,16 @@ function submitProductSyncUp() {
387
  var rsp = JSON.parse(response);
388
  if (rsp.status == "success") {
389
  $('#syncProduct').modal('hide');
390
- var message = "Your product are now being synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
391
  if (rsp.skipProducts > 0) {
392
  message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
393
  }
394
- alert(message);
395
- window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
 
 
396
  } else {
397
- //var message = "Products sync face some unprocessable entity";
398
- var message = rsp.message;
399
- alert(message);
400
  }
401
  }
402
  );
40
 
41
  public function create_form(){
42
  if(isset($_GET['welcome_msg']) && $_GET['welcome_msg'] == true){
43
+ $this->TVC_Admin_Helper->call_domain_claim();
44
  $class = 'notice notice-success';
45
+ $message = esc_html__('Everthing is now set up. One more step - Sync your WooCommerce products into your Merchant Center and reach out to millions of shopper across Google.');
46
  printf('<div class="%1$s"><p>%2$s</p></div>', esc_attr($class), esc_html($message));
47
+ ?>
48
+ <script>
49
+ $(document).ready(function() {
50
+ var msg="<?php echo $message;?>"
51
+ tvc_helper.tvc_alert("success","Congratulation..!",msg,true);
52
+ });
53
+ </script>
54
+ <?php
55
  }
56
  $category_wrapper_obj = new Tatvic_Category_Wrapper();
57
  $category_wrapper = $category_wrapper_obj->category_table_content('mapping');
58
  $syncProductStat = [];
59
  $syncProductList = [];
60
+ $last_api_sync_up ="";
61
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
62
  if(isset($google_detail['prod_sync_status'])){
63
  if ($google_detail['prod_sync_status']) {
74
  $googleDetail = $google_detail['setting'];
75
  }
76
  }
77
+ $last_api_sync_up = "";
78
+ if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
79
+ $date_formate=get_option('date_format')." ".get_option('time_format');
80
+ if($date_formate ==""){
81
+ $date_formate = 'M-d-Y H:i';
82
  }
83
+ $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
84
  }
85
+ $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
86
  ?>
87
  <div class="container-fluid">
88
  <div class="row">
103
  }?></span><img id="refresh_api" onclick="call_tvc_api_sync_up();" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png'; ?>">
104
  </div>
105
  <?php } ?>
106
+ <?php echo get_google_shopping_tabs_html($this->site_url,(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:""); ?>
107
  </div>
108
  <div class="mt-3" id="config-pt2">
109
  <div class="sync-new-product" id="sync-product">
111
  <div class="col-12">
112
  <div class="d-flex justify-content-between ">
113
  <p class="mb-0 align-self-center">Products in your Merchant Center account</p>
114
+ <button id="tvc_btn_product_sync" class="btn btn-primary btn-success align-self-center" data-toggle="modal" data-target="#syncProduct">Sync New Products</button>
115
  <a href="admin.php?page=enhanced-ecommerce-google-analytics-admin-display&amp;tab=add_campaign_page" class="btn btn-primary btn-success">Create Smart Shopping Campaign</a>
116
  </div>
117
  </div>
260
  <div class="form-group">';
261
  $tvc_select_option = $wooCommerceAttributes;
262
  $require = (isset($attribute['required']) && $attribute['required'])?true:false;
263
+ $sel_val_def = (isset($attribute['wAttribute']))?$attribute['wAttribute']:"";
264
  if($attribute["field"]=='link'){
265
  echo "product link";
266
  }else if($attribute["field"]=='shipping'){
267
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
268
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
269
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add shipping flat rate', $sel_val, $require);
270
  }else if($attribute["field"]=='tax'){
271
  //$name, $class_id, string $label=null, $sel_val = null, bool $require = false
272
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
273
  echo $this->TVC_Admin_Helper->tvc_text($attribute["field"], 'number', '', 'Add TAX flat (%)', $sel_val, $require);
274
  }else if($attribute["field"]=='content_language'){
275
  echo $this->TVC_Admin_Helper->tvc_language_select($attribute["field"], '', 'Please Select Attribute', 'en',$require);
283
  foreach( $tvc_select_option_t as $o_val ){
284
  $tvc_select_option[]['field'] = $o_val;
285
  }
286
+ $sel_val = $sel_val_def;
287
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
288
  }else{
289
+ $sel_val = (isset($ee_mapped_attrs[$attribute["field"]]))?$ee_mapped_attrs[$attribute["field"]]:$sel_val_def;
 
 
290
  //$name, $class_id, $label="Please Select", $sel_val, $require, $option_list
291
  $this->TVC_Admin_Helper->tvc_select($attribute["field"],'','Please Select Attribute', $sel_val, $require, $tvc_select_option);
292
  }
305
  </div>
306
  </div>
307
  </div>
308
+ <?php $shop_categories_list = $this->TVC_Admin_Helper->get_tvc_product_cat_list();
309
+ $is_need_to_domain_claim = false;
310
+ if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" && isset($googleDetail->is_domain_claim) && $googleDetail->is_domain_claim == '0'){
311
+ $is_need_to_domain_claim = true;
312
+ }?>
313
  <script type="text/javascript">
314
+ $(document).ready(function() {
315
+ var is_need_to_update = "<?php echo $is_need_to_update; ?>";
316
+ if(is_need_to_update == 1 || is_need_to_update == true){
317
+ tvc_helper.tvc_alert("error","Attention !","Auto-sync up is in the process do not refresh the page.");
318
+ call_tvc_api_sync_up();
319
+ }
320
+
321
+ $(document).on("click", "#tvc_btn_product_sync", function(event){
322
+ var is_need_to_domain_claim = "<?php echo $is_need_to_domain_claim; ?>";
323
+ if(is_need_to_domain_claim == 1 || is_need_to_domain_claim == true){
324
+ event.preventDefault();
325
+ jQuery.post(myAjaxNonces.ajaxurl,{
326
+ action: "tvc_call_domain_claim",
327
+ apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
328
+ },function( response ){
329
+
330
+ });
331
+ }
332
+ });
333
+ });
334
  function call_tvc_api_sync_up(){
335
+ var tvs_this = $("#refresh_api");
336
  $("#tvc_msg").remove();
337
  $("#refresh_api").css("visibility","hidden");
338
  $(tvs_this).after('<div class="tvc-nb-spinner" id="tvc-nb-spinner"></div>');
343
  var rsp = JSON.parse(response);
344
  if(rsp.status == "success"){
345
  $("#tvc-nb-spinner").remove();
346
+ tvc_helper.tvc_alert("success","",rsp.message,true);
347
+ setTimeout(function(){ location.reload();}, 5000);
348
  }
349
  });
350
  }
374
  if(is_tvc_cat_selecte == 1 || is_tvc_cat_selecte == true){
375
  return true;
376
  }else{
377
+ tvc_helper.tvc_alert("error","","Select at least one Google Merchant Center Category.",true);
378
  return false;
379
  }
380
  },
386
  jQuery(".field-required").each(function() {
387
  if($(this).val()==0 && valid){
388
  valid=false;
389
+ $(this).select2('focus');
390
  }
391
  });
392
  if(!valid){
393
+ tvc_helper.tvc_alert("error","","Please select all required fields");
394
  }else{
395
  submitProductSyncUp();
396
  }//check for required fields end
424
  var rsp = JSON.parse(response);
425
  if (rsp.status == "success") {
426
  $('#syncProduct').modal('hide');
427
+ var message = "Your products have been synced in your merchant center account. It takes up to 30 minutes to reflect the product data in merchant center. As soon as they are updated, they will be shown in the \"Product Sync\" dashboard.";
428
  if (rsp.skipProducts > 0) {
429
  message = message + "\n Because of pricing issues, " + rsp.skipProducts + " products did not sync.";
430
  }
431
+ tvc_helper.tvc_alert("success","",message);
432
+ setTimeout(function(){
433
+ window.location.replace("<?php echo $this->site_url.'sync_product_page'; ?>");
434
+ }, 7000);
435
  } else {
436
+ vc_helper.tvc_alert("error","",rsp.message);
 
 
437
  }
438
  }
439
  );
includes/setup/google-shopping-feed.php CHANGED
@@ -1,7 +1,8 @@
1
  <?php
2
  class GoogleShoppingFeed {
3
- public $site_url="";
4
  protected $TVC_Admin_Helper="";
 
5
  public function __construct() {
6
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
7
  $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
@@ -33,15 +34,15 @@ class GoogleShoppingFeed {
33
  </div>
34
  </li>';
35
  }
36
- public function configuration_error_list_html($title, $val){
37
- if($this->subscriptionId != ""){
38
  return '<li>
39
  <div class="row">
40
  <div class="col-7 col-md-7 col-lg-7 align-self-center pr-0">
41
  <span class="text">'.$title.'</span>
42
  </div>
43
  <div class="col-5 col-md-5 col-lg-5 align-self-center text-right">
44
- <div class="list-image"><img id="refresh_domain_claim" onclick="call_domain_claim();" src="'. ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png"><img src="' . ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png" alt="no-config-success"/></div>
45
  </div>
46
  </div>
47
  </li>';
@@ -59,13 +60,13 @@ class GoogleShoppingFeed {
59
  }
60
  }
61
  public function create_form() {
62
- $googleDetail = [];
63
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
64
  if(isset($google_detail['setting'])){
65
  if ($google_detail['setting']) {
66
  $googleDetail = $google_detail['setting'];
67
  }
68
- }
69
 
70
  $syncProductStat = [];
71
  $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
@@ -108,12 +109,15 @@ class GoogleShoppingFeed {
108
  $campaignConversions = (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != "" ? $campaignConversions . "%" : '0');
109
  $campaignSales = (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != "" ? $currency . $campaignSales : '0');
110
  }
111
- $last_api_sync_up = "";
112
- if(isset($google_detail['sync_time'])){
113
- if ($google_detail['sync_time']) {
114
- $last_api_sync_up = date( 'Y-m-d H:i',$google_detail['sync_time']);
115
- }
116
  }
 
 
 
117
  ?>
118
  <div class="container-fluid">
119
  <div class="row">
@@ -124,13 +128,13 @@ class GoogleShoppingFeed {
124
  <div class="row">
125
  <div class="col-md-6 col-lg-8 border-right">
126
  <?php if($this->subscriptionId != ""){?>
127
- <div class="tvc-api-sunc">
128
  <span>
129
  <?php if($last_api_sync_up){
130
  echo "Details last synced at ".$last_api_sync_up;
131
  }else{
132
  echo "Refresh sync up";
133
- }?></span><img id="refresh_api" onclick="call_tvc_api_sync_up();" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png'; ?>">
134
  </div>
135
  <?php } ?>
136
  <div class="configuration-section" id="config-pt1">
@@ -141,14 +145,19 @@ class GoogleShoppingFeed {
141
  <h4 class="confg-title">Configuration</h4>
142
  </div>
143
  <div class="card-body">
144
- <ul class="list-unstyled"><?php
145
  $is_domain_claim = (isset($googleDetail->is_domain_claim))?$googleDetail->is_domain_claim:"";
 
146
  echo $this->configuration_list_html("Google merchant center",(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:"");
147
- echo $this->configuration_list_html("Site Verified",(isset($googleDetail->is_site_verified))?$googleDetail->is_site_verified:"");
 
 
 
 
148
  if($is_domain_claim ==1){
149
  echo $this->configuration_list_html("Domain claim",$is_domain_claim);
150
  }else{
151
- echo $this->configuration_error_list_html("Domain claim",$is_domain_claim);
152
  }
153
  echo $this->configuration_list_html("Google Ads linking",((isset($googleDetail->google_ads_id)))?$googleDetail->google_ads_id:"");
154
  ?>
@@ -220,28 +229,52 @@ class GoogleShoppingFeed {
220
  </div>
221
  </div>
222
  <script type="text/javascript">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
223
  function call_domain_claim(){
224
  var tvs_this = event.target;
225
- $("#refresh_domain_claim").css("visibility","hidden");
226
  $(tvs_this).after('<div class="domain-claim-spinner tvc-nb-spinner" id="domain-claim-spinner"></div>');
227
  jQuery.post(myAjaxNonces.ajaxurl,{
228
  action: "tvc_call_domain_claim",
229
  apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
230
  },function( response ){
231
  var rsp = JSON.parse(response);
232
- if(rsp.status == "success"){
233
- alert(rsp.message);
 
234
  location.reload();
235
- //$(tvs_this).after('<span id="tvc_msg">'+rsp.message+"</span>");
236
- //setTimeout(function(){ $("#tvc_msg").remove(); location.reload();}, 4000);
237
  }else{
238
- alert(rsp.message);
239
  }
240
  $("#domain-claim-spinner").remove();
241
  });
242
  }
 
 
 
 
 
 
 
243
  function call_tvc_api_sync_up(){
244
- var tvs_this = event.target;
245
  $("#tvc_msg").remove();
246
  $("#refresh_api").css("visibility","hidden");
247
  $(tvs_this).after('<div class="tvc-nb-spinner" id="tvc-nb-spinner"></div>');
@@ -252,8 +285,8 @@ class GoogleShoppingFeed {
252
  var rsp = JSON.parse(response);
253
  if(rsp.status == "success"){
254
  $("#tvc-nb-spinner").remove();
255
- $(tvs_this).after('<span id="tvc_msg">'+rsp.message+"</span>");
256
- setTimeout(function(){ $("#tvc_msg").remove(); location.reload();}, 4000);
257
  }
258
  });
259
  }
1
  <?php
2
  class GoogleShoppingFeed {
3
+ protected $site_url="";
4
  protected $TVC_Admin_Helper="";
5
+ protected $subscriptionId = "";
6
  public function __construct() {
7
  $this->TVC_Admin_Helper = new TVC_Admin_Helper();
8
  $this->subscriptionId = $this->TVC_Admin_Helper->get_subscriptionId();
34
  </div>
35
  </li>';
36
  }
37
+ public function configuration_error_list_html($title, $val, $call_domain_claim, $googleDetail){
38
+ if(isset($googleDetail->google_merchant_center_id) && $googleDetail->google_merchant_center_id && $this->subscriptionId != "" ){
39
  return '<li>
40
  <div class="row">
41
  <div class="col-7 col-md-7 col-lg-7 align-self-center pr-0">
42
  <span class="text">'.$title.'</span>
43
  </div>
44
  <div class="col-5 col-md-5 col-lg-5 align-self-center text-right">
45
+ <div class="list-image"><img id="refresh_'.$call_domain_claim.'" onclick="'.$call_domain_claim.'();" src="'. ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png"><img src="' . ENHANCAD_PLUGIN_URL.'/admin/images/exclaimation.png" alt="no-config-success"/></div>
46
  </div>
47
  </div>
48
  </li>';
60
  }
61
  }
62
  public function create_form() {
63
+ $googleDetail = [];
64
  $google_detail = $this->TVC_Admin_Helper->get_ee_options_data();
65
  if(isset($google_detail['setting'])){
66
  if ($google_detail['setting']) {
67
  $googleDetail = $google_detail['setting'];
68
  }
69
+ }
70
 
71
  $syncProductStat = [];
72
  $args = array('post_type' => 'product', 'post_status' => 'publish', 'posts_per_page' => -1);
109
  $campaignConversions = (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != "" ? $campaignConversions . "%" : '0');
110
  $campaignSales = (isset($googleDetail->google_ads_id) && $googleDetail->google_ads_id != "" ? $currency . $campaignSales : '0');
111
  }
112
+ $last_api_sync_up = "";
113
+ if(isset($google_detail['sync_time']) && $google_detail['sync_time']){
114
+ $date_formate=get_option('date_format')." ".get_option('time_format');
115
+ if($date_formate ==""){
116
+ $date_formate = 'M-d-Y H:i';
117
  }
118
+ $last_api_sync_up = date( $date_formate, $google_detail['sync_time']);
119
+ }
120
+ $is_need_to_update = $this->TVC_Admin_Helper->is_need_to_update_api_to_db();
121
  ?>
122
  <div class="container-fluid">
123
  <div class="row">
128
  <div class="row">
129
  <div class="col-md-6 col-lg-8 border-right">
130
  <?php if($this->subscriptionId != ""){?>
131
+ <div class="tvc-api-sunc">
132
  <span>
133
  <?php if($last_api_sync_up){
134
  echo "Details last synced at ".$last_api_sync_up;
135
  }else{
136
  echo "Refresh sync up";
137
+ }?></span><img id="refresh_api" onclick="call_tvc_api_sync_up();" src="<?php echo ENHANCAD_PLUGIN_URL.'/admin/images/refresh.png'; ?>">
138
  </div>
139
  <?php } ?>
140
  <div class="configuration-section" id="config-pt1">
145
  <h4 class="confg-title">Configuration</h4>
146
  </div>
147
  <div class="card-body">
148
+ <ul class="list-unstyled"><?php
149
  $is_domain_claim = (isset($googleDetail->is_domain_claim))?$googleDetail->is_domain_claim:"";
150
+ $is_site_verified = (isset($googleDetail->is_site_verified))?$googleDetail->is_site_verified:"";
151
  echo $this->configuration_list_html("Google merchant center",(isset($googleDetail->google_merchant_center_id))?$googleDetail->google_merchant_center_id:"");
152
+ if($is_site_verified ==1){
153
+ echo $this->configuration_list_html("Site Verified",$is_site_verified);
154
+ }else{
155
+ echo $this->configuration_error_list_html("Site Verified",$is_site_verified,"call_site_verified", $googleDetail);
156
+ }
157
  if($is_domain_claim ==1){
158
  echo $this->configuration_list_html("Domain claim",$is_domain_claim);
159
  }else{
160
+ echo $this->configuration_error_list_html("Domain claim",$is_domain_claim, 'call_domain_claim', $googleDetail);
161
  }
162
  echo $this->configuration_list_html("Google Ads linking",((isset($googleDetail->google_ads_id)))?$googleDetail->google_ads_id:"");
163
  ?>
229
  </div>
230
  </div>
231
  <script type="text/javascript">
232
+ function call_site_verified(){
233
+ var tvs_this = event.target;
234
+ $("#refresh_call_site_verified").css("visibility","hidden");
235
+ $(tvs_this).after('<div class="domain-claim-spinner tvc-nb-spinner" id="site-verified-spinner"></div>');
236
+ jQuery.post(myAjaxNonces.ajaxurl,{
237
+ action: "tvc_call_site_verified",
238
+ apiDomainClaimNonce: myAjaxNonces.SiteVerifiedNonce
239
+ },function( response ){
240
+ var rsp = JSON.parse(response);
241
+ if(rsp.status == "success"){
242
+ tvc_helper.tvc_alert("success","",rsp.message,true);
243
+ location.reload();
244
+ }else{
245
+ tvc_helper.tvc_alert("error","",rsp.message,true);
246
+ }
247
+ $("#site-verified-spinner").remove();
248
+ });
249
+ }
250
  function call_domain_claim(){
251
  var tvs_this = event.target;
252
+ $("#refresh_call_domain_claim").css("visibility","hidden");
253
  $(tvs_this).after('<div class="domain-claim-spinner tvc-nb-spinner" id="domain-claim-spinner"></div>');
254
  jQuery.post(myAjaxNonces.ajaxurl,{
255
  action: "tvc_call_domain_claim",
256
  apiDomainClaimNonce: myAjaxNonces.apiDomainClaimNonce
257
  },function( response ){
258
  var rsp = JSON.parse(response);
259
+ if(rsp.status == "success"){
260
+ tvc_helper.tvc_alert("success","",rsp.message,true);
261
+ //alert(rsp.message);
262
  location.reload();
 
 
263
  }else{
264
+ tvc_helper.tvc_alert("error","",rsp.message,true)
265
  }
266
  $("#domain-claim-spinner").remove();
267
  });
268
  }
269
+ $(document).ready(function() {
270
+ var is_need_to_update = "<?php echo $is_need_to_update; ?>";
271
+ if(is_need_to_update == 1 || is_need_to_update == true){
272
+ tvc_helper.tvc_alert("error","Attention !","Auto-sync up is in the process do not refresh the page.");
273
+ call_tvc_api_sync_up();
274
+ }
275
+ });
276
  function call_tvc_api_sync_up(){
277
+ var tvs_this = $("#refresh_api");
278
  $("#tvc_msg").remove();
279
  $("#refresh_api").css("visibility","hidden");
280
  $(tvs_this).after('<div class="tvc-nb-spinner" id="tvc-nb-spinner"></div>');
285
  var rsp = JSON.parse(response);
286
  if(rsp.status == "success"){
287
  $("#tvc-nb-spinner").remove();
288
+ tvc_helper.tvc_alert("success","",rsp.message,true);
289
+ setTimeout(function(){ location.reload();}, 5000);
290
  }
291
  });
292
  }
includes/setup/json/gmc_attrbutes.json CHANGED
@@ -30,18 +30,15 @@
30
  },
31
  {
32
  "field": "brand",
33
- "desc": "Your product’s brand name",
34
- "wAttribute": "tvc_product_brand"
35
  },
36
  {
37
  "field": "gtin",
38
- "desc": "Your product’s Global Trade Item Number (GTIN). Required for all new products with an assigned GTIN.",
39
- "wAttribute": "tvc_product_gtin"
40
  },
41
  {
42
  "field": "mpn",
43
- "desc": "Your product’s Global Trade Item Number (GTIN). Required for all new products with an assigned GTIN.",
44
- "wAttribute": "tvc_product_mpn"
45
  },
46
  {
47
  "field": "age_group",
30
  },
31
  {
32
  "field": "brand",
33
+ "desc": "Your product’s brand name"
 
34
  },
35
  {
36
  "field": "gtin",
37
+ "desc": "Your product’s Global Trade Item Number (GTIN). Required for all new products with an assigned GTIN."
 
38
  },
39
  {
40
  "field": "mpn",
41
+ "desc": "Your product’s Global Trade Item Number (GTIN). Required for all new products with an assigned GTIN."
 
42
  },
43
  {
44
  "field": "age_group",
public/class-enhanced-ecommerce-google-analytics-public.php CHANGED
@@ -149,6 +149,15 @@ class Enhanced_Ecommerce_Google_Analytics_Public {
149
  });
150
  }
151
  }
 
 
 
 
 
 
 
 
 
152
  public function get_option($key){
153
  $ee_options = array();
154
  $my_option = get_option( 'ee_options' );
149
  });
150
  }
151
  }
152
+ public function add_google_site_verification_tag(){
153
+ $TVC_Admin_Helper = new TVC_Admin_Helper();
154
+ $ee_additional_data = $TVC_Admin_Helper->get_ee_additional_data();
155
+ if(isset($ee_additional_data['add_site_varification_tag']) && isset($ee_additional_data['site_varification_tag_val']) && $ee_additional_data['add_site_varification_tag'] == 1 && $ee_additional_data['site_varification_tag_val'] !="" ){
156
+ echo base64_decode($ee_additional_data['site_varification_tag_val']);
157
+ }
158
+
159
+
160
+ }
161
  public function get_option($key){
162
  $ee_options = array();
163
  $my_option = get_option( 'ee_options' );
readme.txt CHANGED
@@ -8,8 +8,8 @@ Author: Tatvic
8
  Requires at least: 1.4.1
9
  Tested up to: 5.7
10
  Requires PHP: 5.6 or Higher
11
- Stable tag: 3.0.2
12
- Version: 3.0.2
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
@@ -356,6 +356,14 @@ You can resolve the duplication of data by removing the manually implemented GA
356
 
357
  == Changelog ==
358
 
 
 
 
 
 
 
 
 
359
  = 3.0.2 - 17/03/2021 =
360
  * Product sync feature enhancement - Users can now map upto 25 product attributes which will help them opt for enhanced listing in Google search/Shopping
361
  * Auto check on the attributes like id, product title, product description, product link, image link, offer id, price, target country, content language, google merchant center category, sale price, availability, color, size, item_group_id. User does not need to worry about these attributes, the plugin will manage it in the back end when you opt for product syncing
8
  Requires at least: 1.4.1
9
  Tested up to: 5.7
10
  Requires PHP: 5.6 or Higher
11
+ Stable tag: 3.0.3
12
+ Version: 3.0.3
13
  License: GPLv3
14
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
15
 
356
 
357
  == Changelog ==
358
 
359
+ = 3.0.3 - 30/03/2021 =
360
+ * Added double check for auto site verification for merchant center accounts
361
+ * Added double check for auto domain claim for merchant center accounts
362
+ * Bug fix for HTTP_HOST php warning raised by some clients
363
+ * User friendly feature notifications
364
+ * Removal of Brand, GTIN and MPN custom product meta fields addition from the plugin
365
+
366
+
367
  = 3.0.2 - 17/03/2021 =
368
  * Product sync feature enhancement - Users can now map upto 25 product attributes which will help them opt for enhanced listing in Google search/Shopping
369
  * Auto check on the attributes like id, product title, product description, product link, image link, offer id, price, target country, content language, google merchant center category, sale price, availability, color, size, item_group_id. User does not need to worry about these attributes, the plugin will manage it in the back end when you opt for product syncing