Product Feed PRO for WooCommerce - Version 7.9.4

Version Description

Added a feature where user can indicate if the plugin needs to respect free shipping criteria or not when adding shipping classes and methods to Google and Facebook feeds.

Download this release

Release Info

Developer jorisverwater
Plugin Icon 128x128 Product Feed PRO for WooCommerce
Version 7.9.4
Comparing to
See all releases

Code changes from version 7.9.3 to 7.9.4

classes/class-get-products.php CHANGED
@@ -704,10 +704,7 @@ class WooSEA_Get_Products {
704
  $shipping_methods = $zone['shipping_methods'];
705
 
706
  foreach ($shipping_methods as $k => $v){
707
- // $v->title = str_replace("&", "&", $v->title);
708
-
709
  if($v->enabled == "yes"){
710
-
711
  if(empty($zone_details['country'])){
712
  $zone_details['service'] = $zone['zone_name'] ." ". $v->title;
713
  } else {
@@ -857,7 +854,6 @@ class WooSEA_Get_Products {
857
  }
858
  }
859
 
860
-
861
  // FREE SHIPPING COSTS IF MINIMUM FEE REACHED
862
  if($v->id == "free_shipping"){
863
  $minimum_fee = $v->min_amount;
@@ -952,24 +948,17 @@ class WooSEA_Get_Products {
952
  }
953
  }
954
 
955
- // When Free shipping is allowed remove all other shipping costs
956
- // if(isset($currency)){
957
- // error_log("leeg maken!!");
958
- // $free_check = $currency ." 0";
959
- // } else {
960
- // $free_check = "0";
961
- // }
962
- //
963
- //
964
- // //if(in_array($free_check, array_column($shipping_arr, 'price'))) { // search value in the array
965
- // $free_check = "yes";
966
- // if(in_array($free_check, array_column($shipping_arr, 'free'))) { // search value in the array
967
- // foreach($shipping_arr as $k => $v) {
968
- // if(!in_array($free_check, $v)){
969
- // unset($shipping_arr[$k]);
970
- // }
971
- // }
972
- // }
973
 
974
  // Remove empty countries
975
  foreach($shipping_arr as $k => $v){
704
  $shipping_methods = $zone['shipping_methods'];
705
 
706
  foreach ($shipping_methods as $k => $v){
 
 
707
  if($v->enabled == "yes"){
 
708
  if(empty($zone_details['country'])){
709
  $zone_details['service'] = $zone['zone_name'] ." ". $v->title;
710
  } else {
854
  }
855
  }
856
 
 
857
  // FREE SHIPPING COSTS IF MINIMUM FEE REACHED
858
  if($v->id == "free_shipping"){
859
  $minimum_fee = $v->min_amount;
948
  }
949
  }
950
 
951
+ // Remove other shipping classes when free shipping is relevant
952
+ $free_check = "no";
953
+ $free_check = get_option ('free_shipping');
954
+
955
+ if(in_array($free_check, array_column($shipping_arr, 'free'))) { // search value in the array
956
+ foreach($shipping_arr as $k => $v) {
957
+ if(!in_array($free_check, $v)){
958
+ unset($shipping_arr[$k]);
959
+ }
960
+ }
961
+ }
 
 
 
 
 
 
 
962
 
963
  // Remove empty countries
964
  foreach($shipping_arr as $k => $v){
js/woosea_key.js CHANGED
@@ -27,7 +27,7 @@ jQuery(document).ready(function($) {
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
- url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=7.9.3',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
27
  var license_key = $('#license-key').val();
28
 
29
  jQuery.ajax({
30
+ url: 'https://www.adtribes.io/check/license.php?key=' + license_key + '&email=' + license_email + '&domain=' + root_domain + '&version=7.9.4',
31
  jsonp: 'callback',
32
  dataType: 'jsonp',
33
  type: 'GET',
js/woosea_manage.js CHANGED
@@ -221,6 +221,26 @@ jQuery(document).ready(function($) {
221
  }
222
  })
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  // Check if user would like to enable debug logging
225
  $('#add_woosea_logging').on('change', function(){ // on change of state
226
  if(this.checked){
221
  }
222
  })
223
 
224
+ // Check if user would like the plugin to respect free shipping class
225
+ $('#free_shipping').on('change', function(){ // on change of state
226
+ if(this.checked){
227
+
228
+ // Checkbox is on
229
+ jQuery.ajax({
230
+ method: "POST",
231
+ url: ajaxurl,
232
+ data: { 'action': 'woosea_free_shipping', 'status': "on" }
233
+ })
234
+ } else {
235
+ // Checkbox is off
236
+ jQuery.ajax({
237
+ method: "POST",
238
+ url: ajaxurl,
239
+ data: { 'action': 'woosea_free_shipping', 'status': "off" }
240
+ })
241
+ }
242
+ })
243
+
244
  // Check if user would like to enable debug logging
245
  $('#add_woosea_logging').on('change', function(){ // on change of state
246
  if(this.checked){
pages/admin/woosea-manage-settings.php CHANGED
@@ -275,7 +275,7 @@ if(isset($_GET["tab"])) {
275
  </tr>
276
  <tr>
277
  <td>
278
- <span><?php _e( 'Add shipping costs for all countries (Google Shopping / Facebook)', 'woo-product-feed-pro');?></span>
279
  </td>
280
  <td>
281
  <label class="woo-product-feed-pro-switch">
@@ -291,6 +291,27 @@ if(isset($_GET["tab"])) {
291
  </label>
292
  </td>
293
  </tr>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
294
  <tr>
295
  <td>
296
  <span><?php _e( 'Enable logging (Enable only on advice of our support-team):', 'woo-product-feed-pro');?></span>
275
  </tr>
276
  <tr>
277
  <td>
278
+ <span><?php _e( 'Add shipping costs for all countries to feed (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
279
  </td>
280
  <td>
281
  <label class="woo-product-feed-pro-switch">
291
  </label>
292
  </td>
293
  </tr>
294
+ <tr>
295
+ <td>
296
+ <span><?php _e( 'Remove all other shipping classes when free shipping criteria are met (Google Shopping / Facebook only)', 'woo-product-feed-pro');?></span>
297
+ </td>
298
+ <td>
299
+ <label class="woo-product-feed-pro-switch">
300
+ <?php
301
+ $free_shipping = get_option ('free_shipping');
302
+ if($free_shipping == "yes"){
303
+ print "<input type=\"checkbox\" id=\"free_shipping\" name=\"free_shipping\" class=\"checkbox-field\" checked>";
304
+ } else {
305
+ print "<input type=\"checkbox\" id=\"free_shipping\" name=\"free_shipping\" class=\"checkbox-field\">";
306
+ }
307
+ ?>
308
+ <div class="woo-product-feed-pro-slider round"></div>
309
+ </label>
310
+ </td>
311
+ </tr>
312
+
313
+
314
+
315
  <tr>
316
  <td>
317
  <span><?php _e( 'Enable logging (Enable only on advice of our support-team):', 'woo-product-feed-pro');?></span>
readme.txt CHANGED
@@ -5,7 +5,7 @@ License URI: http://www.gnu.org/licenses/gpl.html
5
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
6
  Requires at least: 4.5
7
  Tested up to: 5.4
8
- Stable tag: 7.9.3
9
 
10
  == Description ==
11
 
@@ -312,6 +312,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
312
 
313
  === Changelog ===
314
 
 
 
 
315
  = 7.9.3 (2020-04-15) =
316
  * Changed the XML header for the Fruugo.nl template
317
 
@@ -2523,6 +2526,9 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
2523
 
2524
  == Upgrade Notice ==
2525
 
 
 
 
2526
  = 7.9.3 =
2527
  Changed the XML header for the Fruugo.nl template
2528
 
5
  Tags: Product Feed, Google Shopping, Google Shopping Feed, WooCommerce Product Feed, WooCommerce Product Feed PRO, Bing Shopping, Bing product feed, Bing remarking, Google Merchant Feed, Google DRM Feed, Google Dynamic Remarketing Feed, Facebook feed, Google feed, Bing feed, Facebook Product Feed, Facebook Dynamic remarketing, Data Feed, WooCommerce Feed, XML product feed, CSV product feed, TSV, TXT product feed, comparison shopping engines, comparison shopping websites, vergelijk.nl, vergelijk.be, vertaa.fi, beslist.nl, kieskeurig.nl, bol.com, raketten, pricerunner, pricegrabber, Buy, leGuide, Kelkoo, Twenga, Yandex, Etsy, Dealtime, Shopzilla, Billiger, Google Product Review feed
6
  Requires at least: 4.5
7
  Tested up to: 5.4
8
+ Stable tag: 7.9.4
9
 
10
  == Description ==
11
 
312
 
313
  === Changelog ===
314
 
315
+ = 7.9.4 (2020-04-16) =
316
+ * Added a feature where user can indicate if the plugin needs to respect free shipping criteria or not when adding shipping classes and methods to Google and Facebook feeds.
317
+
318
  = 7.9.3 (2020-04-15) =
319
  * Changed the XML header for the Fruugo.nl template
320
 
2526
 
2527
  == Upgrade Notice ==
2528
 
2529
+ = 7.9.4 =
2530
+ Added a feature where user can indicate if the plugin needs to respect free shipping criteria or not when adding shipping classes and methods to Google and Facebook feeds.
2531
+
2532
  = 7.9.3 =
2533
  Changed the XML header for the Fruugo.nl template
2534
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
- * Version: 7.9.3
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
@@ -48,7 +48,7 @@ if (!defined('ABSPATH')) {
48
  * Plugin versionnumber, please do not override.
49
  * Define some constants
50
  */
51
- define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '7.9.3' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
@@ -2361,10 +2361,20 @@ function woosea_add_all_shipping (){
2361
  }
2362
  add_action( 'wp_ajax_woosea_add_all_shipping', 'woosea_add_all_shipping' );
2363
 
 
 
 
 
 
 
2364
 
2365
-
2366
-
2367
-
 
 
 
 
2368
 
2369
  /**
2370
  * This function enables the setting to use
@@ -4248,7 +4258,7 @@ function woosea_license_valid(){
4248
 
4249
  if(!empty($license_information['license_key'])){
4250
  $curl = curl_init();
4251
- $url = "https://www.adtribes.io/check/license.php?key=$license_information[license_key]&email=$license_information[license_email]&domain=$domain&version=7.9.3";
4252
 
4253
  curl_setopt_array($curl, array(
4254
  CURLOPT_RETURNTRANSFER => 1,
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 7.9.4
5
  * Plugin URI: https://www.adtribes.io/support/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=woosea_product_feed_pro
6
  * Description: Configure and maintain your WooCommerce product feeds for Google Shopping, Facebook, Remarketing, Bing, Yandex, Comparison shopping websites and over a 100 channels more.
7
  * Author: AdTribes.io
48
  * Plugin versionnumber, please do not override.
49
  * Define some constants
50
  */
51
+ define( 'WOOCOMMERCESEA_PLUGIN_VERSION', '7.9.4' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
2361
  }
2362
  add_action( 'wp_ajax_woosea_add_all_shipping', 'woosea_add_all_shipping' );
2363
 
2364
+ /**
2365
+ * This function enables the setting to respect
2366
+ * the free shipping class
2367
+ */
2368
+ function woosea_free_shipping (){
2369
+ $status = sanitize_text_field($_POST['status']);
2370
 
2371
+ if ($status == "off"){
2372
+ update_option( 'free_shipping', 'no', 'yes');
2373
+ } else {
2374
+ update_option( 'free_shipping', 'yes', 'yes');
2375
+ }
2376
+ }
2377
+ add_action( 'wp_ajax_woosea_free_shipping', 'woosea_free_shipping' );
2378
 
2379
  /**
2380
  * This function enables the setting to use
4258
 
4259
  if(!empty($license_information['license_key'])){
4260
  $curl = curl_init();
4261
+ $url = "https://www.adtribes.io/check/license.php?key=$license_information[license_key]&email=$license_information[license_email]&domain=$domain&version=7.9.4";
4262
 
4263
  curl_setopt_array($curl, array(
4264
  CURLOPT_RETURNTRANSFER => 1,