Product Feed PRO for WooCommerce - Version 8.2.0

Version Description

Improved check if the WooCommerce Table Rate plugin is active Fixed PHP warnings that showed during creation of feeds for products that had no attributes at all Set autoloading on no for the product batch option

Download this release

Release Info

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

Code changes from version 8.1.8 to 8.2.0

Files changed (3) hide show
  1. classes/class-get-products.php +22 -24
  2. readme.txt +17 -1
  3. woocommerce-sea.php +94 -36
classes/class-get-products.php CHANGED
@@ -746,9 +746,8 @@ class WooSEA_Get_Products {
746
  }
747
 
748
  // WooCommerce Table Rate Bolder Elements
749
- if(class_exists('BE_Table_Rate_WC')){
750
  // Set shipping cost
751
-
752
  $shipping_cost = 0;
753
  if(!empty($product_id)){
754
  // Add product to cart
@@ -756,24 +755,21 @@ class WooSEA_Get_Products {
756
  $quantity = 1;
757
 
758
  if(!empty($code_from_config)){
759
-
760
- if($code_from_config == null){
761
- $set_country = WC()->customer->set_shipping_country(wc_clean( $code_from_config ));
762
- if(isset($zone_details['region'])){
763
- WC()->customer->set_shipping_state(wc_clean( $zone_details['region'] ));
764
- }
765
- //$cart = new WC_Cart();
766
- WC()->cart->add_to_cart( $product_id, $quantity );
767
-
768
- // Read cart and get schipping costs
769
- foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
770
- $total_cost = WC()->cart->get_total();
771
- $shipping_cost = WC()->cart->get_shipping_total();
772
- $shipping_cost = wc_format_localized_price($shipping_cost);
773
- }
774
- // Make sure to empty the cart again
775
- WC()->cart->empty_cart();
776
  }
 
 
 
 
 
 
 
 
 
 
 
777
  }
778
  }
779
  }
@@ -2985,10 +2981,12 @@ class WooSEA_Get_Products {
2985
  $value_display = str_replace("_", " ",$value->name);
2986
  if (preg_match("/_product_attributes/i",$value->name)){
2987
  $product_attr = unserialize($value->type);
2988
- foreach ($product_attr as $key => $arr_value) {
2989
- $new_key ="custom_attributes_" . $key;
2990
- $product_data[$new_key] = $arr_value['value'];
2991
- }
 
 
2992
  }
2993
  }
2994
  }
@@ -3634,7 +3632,7 @@ class WooSEA_Get_Products {
3634
  if (! wp_next_scheduled ( 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) ) ) {
3635
  wp_schedule_single_event( time() + 2, 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) );
3636
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
3637
- update_option( $batch_project, $val);
3638
  }
3639
  } else {
3640
  // No batch is needed, already done processing all products
746
  }
747
 
748
  // WooCommerce Table Rate Bolder Elements
749
+ if(is_plugin_active( 'woocommerce-table-rate-shipping/woocommerce-table-rate-shipping.php' )) {
750
  // Set shipping cost
 
751
  $shipping_cost = 0;
752
  if(!empty($product_id)){
753
  // Add product to cart
755
  $quantity = 1;
756
 
757
  if(!empty($code_from_config)){
758
+ WC()->customer->set_shipping_country(wc_clean( $code_from_config ));
759
+ if(isset($zone_details['region'])){
760
+ WC()->customer->set_shipping_state(wc_clean( $zone_details['region'] ));
 
 
 
 
 
 
 
 
 
 
 
 
 
 
761
  }
762
+
763
+ WC()->cart->add_to_cart( $product_id, $quantity );
764
+
765
+ // Read cart and get schipping costs
766
+ foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) {
767
+ $total_cost = WC()->cart->get_total();
768
+ $shipping_cost = WC()->cart->get_shipping_total();
769
+ $shipping_cost = wc_format_localized_price($shipping_cost);
770
+ }
771
+ // Make sure to empty the cart again
772
+ WC()->cart->empty_cart();
773
  }
774
  }
775
  }
2981
  $value_display = str_replace("_", " ",$value->name);
2982
  if (preg_match("/_product_attributes/i",$value->name)){
2983
  $product_attr = unserialize($value->type);
2984
+ if(!empty($product_attr)){
2985
+ foreach ($product_attr as $key => $arr_value) {
2986
+ $new_key ="custom_attributes_" . $key;
2987
+ $product_data[$new_key] = $arr_value['value'];
2988
+ }
2989
+ }
2990
  }
2991
  }
2992
  }
3632
  if (! wp_next_scheduled ( 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) ) ) {
3633
  wp_schedule_single_event( time() + 2, 'woosea_create_batch_event', array($feed_config[$key]['project_hash']) );
3634
  $batch_project = "batch_project_".$feed_config[$key]['project_hash'];
3635
+ update_option( $batch_project, $val, 'no');
3636
  }
3637
  } else {
3638
  // No batch is needed, already done processing all products
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: 8.1.8
9
 
10
  == Description ==
11
 
@@ -313,6 +313,14 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
313
 
314
  === Changelog ===
315
 
 
 
 
 
 
 
 
 
316
  = 8.1.8 (2020-05-07) =
317
  * Fixed a shipping table rate bug
318
 
@@ -2604,6 +2612,14 @@ Questions left or unanswered? Please do not hesitate to contact us at support@ad
2604
 
2605
  == Upgrade Notice ==
2606
 
 
 
 
 
 
 
 
 
2607
  = 8.1.8 =
2608
  Fixed a shipping table rate bug
2609
 
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: 8.2.0
9
 
10
  == Description ==
11
 
313
 
314
  === Changelog ===
315
 
316
+ = 8.2.0 (2020-05-10) =
317
+ * Improved check if the WooCommerce Table Rate plugin is active
318
+ * Fixed PHP warnings that showed during creation of feeds for products that had no attributes at all
319
+ * Set autoloading on no for the product batch option
320
+
321
+ = 8.1.9 (2020-05-08) =
322
+ * Solved PHP warnings that showed on variants product edit pages for the extra fields that had an undefined index
323
+
324
  = 8.1.8 (2020-05-07) =
325
  * Fixed a shipping table rate bug
326
 
2612
 
2613
  == Upgrade Notice ==
2614
 
2615
+ = 8.2.0 =
2616
+ Improved check if the WooCommerce Table Rate plugin is active
2617
+ Fixed PHP warnings that showed during creation of feeds for products that had no attributes at all
2618
+ Set autoloading on no for the product batch option
2619
+
2620
+ = 8.1.9 =
2621
+ Solved PHP warnings that showed on variants product edit pages for the extra fields that had an undefined index
2622
+
2623
  = 8.1.8 =
2624
  Fixed a shipping table rate bug
2625
 
woocommerce-sea.php CHANGED
@@ -1,7 +1,7 @@
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
- * Version: 8.1.8
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', '8.1.8' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
@@ -3485,208 +3485,266 @@ function woosea_save_custom_variable_fields( $post_id ) {
3485
  }
3486
 
3487
  // Brand Field
3488
- $_brand = $_POST['_woosea_variable_brand'];
3489
- $variation_id = (int) $variable_post_id[$i];
3490
- if ( isset( $_brand[$i] ) ) {
3491
- update_post_meta( $variation_id, '_woosea_brand', stripslashes( sanitize_text_field( $_brand[$i] )));
3492
- }
 
 
3493
 
3494
  // MPN Field
3495
- $_mpn = $_POST['_woosea_variable_mpn'];
 
3496
  $variation_id = (int) $variable_post_id[$i];
3497
  if ( isset( $_mpn[$i] ) ) {
3498
  update_post_meta( $variation_id, '_woosea_mpn', stripslashes( sanitize_text_field( $_mpn[$i] )));
3499
  }
 
3500
 
3501
  // UPC Field
3502
- $_upc = $_POST['_woosea_variable_upc'];
 
3503
  $variation_id = (int) $variable_post_id[$i];
3504
  if ( isset( $_upc[$i] ) ) {
3505
  update_post_meta( $variation_id, '_woosea_upc', stripslashes( sanitize_text_field( $_upc[$i] )));
3506
  }
 
3507
 
3508
  // EAN Field
3509
- $_ean = $_POST['_woosea_variable_ean'];
 
3510
  $variation_id = (int) $variable_post_id[$i];
3511
  if ( isset( $_ean[$i] ) ) {
3512
  update_post_meta( $variation_id, '_woosea_ean', stripslashes( sanitize_text_field( $_ean[$i] )));
3513
  }
 
3514
 
3515
  // GTIN Field
3516
- $_gtin = $_POST['_woosea_variable_gtin'];
 
3517
  $variation_id = (int) $variable_post_id[$i];
3518
  if ( isset( $_gtin[$i] ) ) {
3519
  update_post_meta( $variation_id, '_woosea_gtin', stripslashes( sanitize_text_field( $_gtin[$i] )));
3520
  }
 
3521
 
3522
  // Color Field
3523
- $_color = $_POST['_woosea_variable_color'];
 
3524
  $variation_id = (int) $variable_post_id[$i];
3525
  if ( isset( $_color[$i] ) ) {
3526
  update_post_meta( $variation_id, '_woosea_color', stripslashes( sanitize_text_field( $_color[$i] )));
3527
  }
 
3528
 
3529
  // Size Field
3530
- $_size = $_POST['_woosea_variable_size'];
 
3531
  $variation_id = (int) $variable_post_id[$i];
3532
  if ( isset( $_size[$i] ) ) {
3533
  update_post_meta( $variation_id, '_woosea_size', stripslashes( sanitize_text_field( $_size[$i] )));
3534
  }
 
3535
 
3536
  // Gender Field
3537
- $_gender = $_POST['_woosea_gender'];
 
3538
  $variation_id = (int) $variable_post_id[$i];
3539
  if ( isset( $_gender[$i] ) ) {
3540
  update_post_meta( $variation_id, '_woosea_gender', stripslashes( sanitize_text_field( $_gender[$i] )));
3541
  }
 
3542
 
3543
  // Material Field
3544
- $_material = $_POST['_woosea_variable_material'];
 
3545
  $variation_id = (int) $variable_post_id[$i];
3546
  if ( isset( $_material[$i] ) ) {
3547
  update_post_meta( $variation_id, '_woosea_material', stripslashes( sanitize_text_field( $_material[$i] )));
3548
  }
 
3549
 
3550
  // Pattern Field
3551
- $_pattern = $_POST['_woosea_variable_pattern'];
 
3552
  $variation_id = (int) $variable_post_id[$i];
3553
  if ( isset( $_pattern[$i] ) ) {
3554
  update_post_meta( $variation_id, '_woosea_pattern', stripslashes( sanitize_text_field( $_pattern[$i] )));
3555
  }
 
3556
 
3557
  // Unit pricing measure Field
3558
- $_pricing_measure = $_POST['_woosea_variable_unit_pricing_measure'];
 
3559
  $variation_id = (int) $variable_post_id[$i];
3560
  if ( isset( $_pricing_measure[$i] ) ) {
3561
  update_post_meta( $variation_id, '_woosea_unit_pricing_measure', stripslashes( sanitize_text_field( $_pricing_measure[$i] )));
3562
  }
 
3563
 
3564
  // Unit pricing base measure Field
3565
- $_pricing_base = $_POST['_woosea_variable_unit_pricing_base_measure'];
 
3566
  $variation_id = (int) $variable_post_id[$i];
3567
  if ( isset( $_pricing_base[$i] ) ) {
3568
  update_post_meta( $variation_id, '_woosea_unit_pricing_base_measure', stripslashes( sanitize_text_field( $_pricing_base[$i] )));
3569
  }
 
3570
 
3571
  // Optimized title Field
3572
- $_opttitle = $_POST['_woosea_optimized_title'];
 
3573
  $variation_id = (int) $variable_post_id[$i];
3574
  if ( isset( $_opttitle[$i] ) ) {
3575
  update_post_meta( $variation_id, '_woosea_optimized_title', stripslashes( sanitize_text_field( $_opttitle[$i] )));
3576
  }
 
3577
 
3578
  // Installment months Field
3579
- $_installment_months = $_POST['_woosea_installment_months'];
 
3580
  $variation_id = (int) $variable_post_id[$i];
3581
  if ( isset( $_installment_months[$i] ) ) {
3582
  update_post_meta( $variation_id, '_woosea_installment_months', stripslashes( sanitize_text_field( $_installment_months[$i] )));
3583
  }
 
3584
 
3585
  // Installment amount Field
3586
- $_installment_amount = $_POST['_woosea_installment_amount'];
 
3587
  $variation_id = (int) $variable_post_id[$i];
3588
  if ( isset( $_installment_amount[$i] ) ) {
3589
  update_post_meta( $variation_id, '_woosea_installment_amount', stripslashes( sanitize_text_field( $_installment_amount[$i] )));
3590
  }
 
3591
 
3592
  // Product condition Field
3593
- $_condition = $_POST['_woosea_condition'];
 
3594
  $variation_id = (int) $variable_post_id[$i];
3595
  if ( isset( $_condition[$i] ) ) {
3596
  update_post_meta( $variation_id, '_woosea_condition', stripslashes( sanitize_text_field( $_condition[$i] )));
3597
  }
 
3598
 
3599
  // Product age group
3600
- $_age_group = $_POST['_woosea_age_group'];
 
3601
  $variation_id = (int) $variable_post_id[$i];
3602
  if ( isset( $_age_group[$i] ) ) {
3603
  update_post_meta( $variation_id, '_woosea_age_group', stripslashes( sanitize_text_field( $_age_group[$i] )));
3604
  }
 
3605
 
3606
 
3607
  // Cost of good sold
3608
- $_cost_of_good_sold = $_POST['_woosea_cost_of_good_sold'];
 
3609
  $variation_id = (int) $variable_post_id[$i];
3610
  if ( isset( $_cost_of_good_sold[$i] ) ) {
3611
  update_post_meta( $variation_id, '_woosea_cost_of_good_sold', stripslashes( sanitize_text_field( $_cost_of_good_sold[$i] )));
3612
  }
 
3613
 
3614
  // Multipack
3615
- $_multipack = $_POST['_woosea_multipack'];
 
3616
  $variation_id = (int) $variable_post_id[$i];
3617
  if ( isset( $_multipack[$i] ) ) {
3618
  update_post_meta( $variation_id, '_woosea_multipack', stripslashes( sanitize_text_field( $_multipack[$i] )));
3619
  }
3620
-
 
3621
  // Is promotion
3622
- $_is_promotion = $_POST['_woosea_is_promotion'];
 
3623
  $variation_id = (int) $variable_post_id[$i];
3624
  if ( isset( $_is_promotion[$i] ) ) {
3625
  update_post_meta( $variation_id, '_woosea_is_promotion', stripslashes( sanitize_text_field( $_is_promotion[$i] )));
3626
  }
 
3627
 
3628
  // Is bundle
3629
- $_is_bundle = $_POST['_woosea_is_bundle'];
 
3630
  $variation_id = (int) $variable_post_id[$i];
3631
  if ( isset( $_is_bundle[$i] ) ) {
3632
  update_post_meta( $variation_id, '_woosea_is_bundle', stripslashes( sanitize_text_field( $_is_bundle[$i] )));
3633
  }
 
3634
 
3635
  // Energy efficiency class
3636
- $_energy_efficiency_class = $_POST['_woosea_energy_efficiency_class'];
 
3637
  $variation_id = (int) $variable_post_id[$i];
3638
  if ( isset( $_energy_efficiency_class[$i] ) ) {
3639
  update_post_meta( $variation_id, '_woosea_energy_efficiency_class', stripslashes( sanitize_text_field( $_energy_efficiency_class[$i] )));
3640
  }
 
3641
 
3642
  // Minimum energy efficiency class
3643
- $_min_energy_efficiency_class = $_POST['_woosea_min_energy_efficiency_class'];
 
3644
  $variation_id = (int) $variable_post_id[$i];
3645
  if ( isset( $_min_energy_efficiency_class[$i] ) ) {
3646
  update_post_meta( $variation_id, '_woosea_min_energy_efficiency_class', stripslashes( sanitize_text_field( $_min_energy_efficiency_class[$i] )));
3647
  }
 
3648
 
3649
  // Maximum energy efficiency class
3650
- $_max_energy_efficiency_class = $_POST['_woosea_max_energy_efficiency_class'];
 
3651
  $variation_id = (int) $variable_post_id[$i];
3652
  if ( isset( $_max_energy_efficiency_class[$i] ) ) {
3653
  update_post_meta( $variation_id, '_woosea_max_energy_efficiency_class', stripslashes( sanitize_text_field( $_max_energy_efficiency_class[$i] )));
3654
  }
 
3655
 
3656
  // Custom field 0
3657
- $_custom_field_0 = $_POST['_woosea_custom_field_0'];
 
3658
  $variation_id = (int) $variable_post_id[$i];
3659
  if ( isset( $_custom_field_0[$i] ) ) {
3660
  update_post_meta( $variation_id, '_woosea_custom_field_0', stripslashes( sanitize_text_field( $_custom_field_0[$i] )));
3661
  }
 
3662
 
3663
  // Custom field 1
3664
- $_custom_field_1 = $_POST['_woosea_custom_field_1'];
 
3665
  $variation_id = (int) $variable_post_id[$i];
3666
  if ( isset( $_custom_field_1[$i] ) ) {
3667
  update_post_meta( $variation_id, '_woosea_custom_field_1', stripslashes( sanitize_text_field( $_custom_field_1[$i] )));
3668
  }
 
3669
 
3670
  // Custom field 2
3671
- $_custom_field_2 = $_POST['_woosea_custom_field_2'];
 
3672
  $variation_id = (int) $variable_post_id[$i];
3673
  if ( isset( $_custom_field_2[$i] ) ) {
3674
  update_post_meta( $variation_id, '_woosea_custom_field_2', stripslashes( sanitize_text_field( $_custom_field_2[$i] )));
3675
  }
 
3676
 
3677
  // Custom field 3
3678
- $_custom_field_3 = $_POST['_woosea_custom_field_3'];
 
3679
  $variation_id = (int) $variable_post_id[$i];
3680
  if ( isset( $_custom_field_3[$i] ) ) {
3681
  update_post_meta( $variation_id, '_woosea_custom_field_3', stripslashes( sanitize_text_field( $_custom_field_3[$i] )));
3682
  }
 
3683
 
3684
  // Custom field 4
3685
- $_custom_field_4 = $_POST['_woosea_custom_field_4'];
 
3686
  $variation_id = (int) $variable_post_id[$i];
3687
  if ( isset( $_custom_field_4[$i] ) ) {
3688
  update_post_meta( $variation_id, '_woosea_custom_field_4', stripslashes( sanitize_text_field( $_custom_field_4[$i] )));
3689
  }
 
3690
 
3691
  // Exclude product from feed
3692
  if(empty($_POST['_woosea_exclude_product'])){
1
  <?php
2
  /**
3
  * Plugin Name: Product Feed PRO for WooCommerce
4
+ * Version: 8.2.0
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', '8.2.0' );
52
  define( 'WOOCOMMERCESEA_PLUGIN_NAME', 'woocommerce-product-feed-pro' );
53
  define( 'WOOCOMMERCESEA_PLUGIN_NAME_SHORT', 'woo-product-feed-pro' );
54
 
3485
  }
3486
 
3487
  // Brand Field
3488
+ if(isset($_POST['_woosea_variable_brand'])){
3489
+ $_brand = $_POST['_woosea_variable_brand'];
3490
+ $variation_id = (int) $variable_post_id[$i];
3491
+ if ( isset( $_brand[$i] ) ) {
3492
+ update_post_meta( $variation_id, '_woosea_brand', stripslashes( sanitize_text_field( $_brand[$i] )));
3493
+ }
3494
+ }
3495
 
3496
  // MPN Field
3497
+ if(isset($_POST['_woosea_variable_mpn'])){
3498
+ $_mpn = $_POST['_woosea_variable_mpn'];
3499
  $variation_id = (int) $variable_post_id[$i];
3500
  if ( isset( $_mpn[$i] ) ) {
3501
  update_post_meta( $variation_id, '_woosea_mpn', stripslashes( sanitize_text_field( $_mpn[$i] )));
3502
  }
3503
+ }
3504
 
3505
  // UPC Field
3506
+ if(isset($_POST['_woosea_variable_upc'])){
3507
+ $_upc = $_POST['_woosea_variable_upc'];
3508
  $variation_id = (int) $variable_post_id[$i];
3509
  if ( isset( $_upc[$i] ) ) {
3510
  update_post_meta( $variation_id, '_woosea_upc', stripslashes( sanitize_text_field( $_upc[$i] )));
3511
  }
3512
+ }
3513
 
3514
  // EAN Field
3515
+ if(isset($_POST['_woosea_variable_ean'])){
3516
+ $_ean = $_POST['_woosea_variable_ean'];
3517
  $variation_id = (int) $variable_post_id[$i];
3518
  if ( isset( $_ean[$i] ) ) {
3519
  update_post_meta( $variation_id, '_woosea_ean', stripslashes( sanitize_text_field( $_ean[$i] )));
3520
  }
3521
+ }
3522
 
3523
  // GTIN Field
3524
+ if(isset($_POST['_woosea_variable_gtin'])){
3525
+ $_gtin = $_POST['_woosea_variable_gtin'];
3526
  $variation_id = (int) $variable_post_id[$i];
3527
  if ( isset( $_gtin[$i] ) ) {
3528
  update_post_meta( $variation_id, '_woosea_gtin', stripslashes( sanitize_text_field( $_gtin[$i] )));
3529
  }
3530
+ }
3531
 
3532
  // Color Field
3533
+ if(isset($_POST['_woosea_variable_color'])){
3534
+ $_color = $_POST['_woosea_variable_color'];
3535
  $variation_id = (int) $variable_post_id[$i];
3536
  if ( isset( $_color[$i] ) ) {
3537
  update_post_meta( $variation_id, '_woosea_color', stripslashes( sanitize_text_field( $_color[$i] )));
3538
  }
3539
+ }
3540
 
3541
  // Size Field
3542
+ if(isset($_POST['_woosea_variable_size'])){
3543
+ $_size = $_POST['_woosea_variable_size'];
3544
  $variation_id = (int) $variable_post_id[$i];
3545
  if ( isset( $_size[$i] ) ) {
3546
  update_post_meta( $variation_id, '_woosea_size', stripslashes( sanitize_text_field( $_size[$i] )));
3547
  }
3548
+ }
3549
 
3550
  // Gender Field
3551
+ if(isset($_POST['_woosea_variable_gender'])){
3552
+ $_gender = $_POST['_woosea_gender'];
3553
  $variation_id = (int) $variable_post_id[$i];
3554
  if ( isset( $_gender[$i] ) ) {
3555
  update_post_meta( $variation_id, '_woosea_gender', stripslashes( sanitize_text_field( $_gender[$i] )));
3556
  }
3557
+ }
3558
 
3559
  // Material Field
3560
+ if(isset($_POST['_woosea_variable_material'])){
3561
+ $_material = $_POST['_woosea_variable_material'];
3562
  $variation_id = (int) $variable_post_id[$i];
3563
  if ( isset( $_material[$i] ) ) {
3564
  update_post_meta( $variation_id, '_woosea_material', stripslashes( sanitize_text_field( $_material[$i] )));
3565
  }
3566
+ }
3567
 
3568
  // Pattern Field
3569
+ if(isset($_POST['_woosea_variable_pattern'])){
3570
+ $_pattern = $_POST['_woosea_variable_pattern'];
3571
  $variation_id = (int) $variable_post_id[$i];
3572
  if ( isset( $_pattern[$i] ) ) {
3573
  update_post_meta( $variation_id, '_woosea_pattern', stripslashes( sanitize_text_field( $_pattern[$i] )));
3574
  }
3575
+ }
3576
 
3577
  // Unit pricing measure Field
3578
+ if(isset($_POST['_woosea_variable_unit_pricing_measure'])){
3579
+ $_pricing_measure = $_POST['_woosea_variable_unit_pricing_measure'];
3580
  $variation_id = (int) $variable_post_id[$i];
3581
  if ( isset( $_pricing_measure[$i] ) ) {
3582
  update_post_meta( $variation_id, '_woosea_unit_pricing_measure', stripslashes( sanitize_text_field( $_pricing_measure[$i] )));
3583
  }
3584
+ }
3585
 
3586
  // Unit pricing base measure Field
3587
+ if(isset($_POST['_woosea_variable_unit_pricing_base_measure'])){
3588
+ $_pricing_base = $_POST['_woosea_variable_unit_pricing_base_measure'];
3589
  $variation_id = (int) $variable_post_id[$i];
3590
  if ( isset( $_pricing_base[$i] ) ) {
3591
  update_post_meta( $variation_id, '_woosea_unit_pricing_base_measure', stripslashes( sanitize_text_field( $_pricing_base[$i] )));
3592
  }
3593
+ }
3594
 
3595
  // Optimized title Field
3596
+ if(isset($_POST['_woosea_optimized_title'])){
3597
+ $_opttitle = $_POST['_woosea_optimized_title'];
3598
  $variation_id = (int) $variable_post_id[$i];
3599
  if ( isset( $_opttitle[$i] ) ) {
3600
  update_post_meta( $variation_id, '_woosea_optimized_title', stripslashes( sanitize_text_field( $_opttitle[$i] )));
3601
  }
3602
+ }
3603
 
3604
  // Installment months Field
3605
+ if(isset($_POST['_woosea_installment_months'])){
3606
+ $_installment_months = $_POST['_woosea_installment_months'];
3607
  $variation_id = (int) $variable_post_id[$i];
3608
  if ( isset( $_installment_months[$i] ) ) {
3609
  update_post_meta( $variation_id, '_woosea_installment_months', stripslashes( sanitize_text_field( $_installment_months[$i] )));
3610
  }
3611
+ }
3612
 
3613
  // Installment amount Field
3614
+ if(isset($_POST['_woosea_installment_amount'])){
3615
+ $_installment_amount = $_POST['_woosea_installment_amount'];
3616
  $variation_id = (int) $variable_post_id[$i];
3617
  if ( isset( $_installment_amount[$i] ) ) {
3618
  update_post_meta( $variation_id, '_woosea_installment_amount', stripslashes( sanitize_text_field( $_installment_amount[$i] )));
3619
  }
3620
+ }
3621
 
3622
  // Product condition Field
3623
+ if(isset($_POST['_woosea_condition'])){
3624
+ $_condition = $_POST['_woosea_condition'];
3625
  $variation_id = (int) $variable_post_id[$i];
3626
  if ( isset( $_condition[$i] ) ) {
3627
  update_post_meta( $variation_id, '_woosea_condition', stripslashes( sanitize_text_field( $_condition[$i] )));
3628
  }
3629
+ }
3630
 
3631
  // Product age group
3632
+ if(isset($_POST['_woosea_age_group'])){
3633
+ $_age_group = $_POST['_woosea_age_group'];
3634
  $variation_id = (int) $variable_post_id[$i];
3635
  if ( isset( $_age_group[$i] ) ) {
3636
  update_post_meta( $variation_id, '_woosea_age_group', stripslashes( sanitize_text_field( $_age_group[$i] )));
3637
  }
3638
+ }
3639
 
3640
 
3641
  // Cost of good sold
3642
+ if(isset($_POST['_woosea_cost_of_good_sold'])){
3643
+ $_cost_of_good_sold = $_POST['_woosea_cost_of_good_sold'];
3644
  $variation_id = (int) $variable_post_id[$i];
3645
  if ( isset( $_cost_of_good_sold[$i] ) ) {
3646
  update_post_meta( $variation_id, '_woosea_cost_of_good_sold', stripslashes( sanitize_text_field( $_cost_of_good_sold[$i] )));
3647
  }
3648
+ }
3649
 
3650
  // Multipack
3651
+ if(isset($_POST['_woosea_multipack'])){
3652
+ $_multipack = $_POST['_woosea_multipack'];
3653
  $variation_id = (int) $variable_post_id[$i];
3654
  if ( isset( $_multipack[$i] ) ) {
3655
  update_post_meta( $variation_id, '_woosea_multipack', stripslashes( sanitize_text_field( $_multipack[$i] )));
3656
  }
3657
+ }
3658
+
3659
  // Is promotion
3660
+ if(isset($_POST['_woosea_is_promotion'])){
3661
+ $_is_promotion = $_POST['_woosea_is_promotion'];
3662
  $variation_id = (int) $variable_post_id[$i];
3663
  if ( isset( $_is_promotion[$i] ) ) {
3664
  update_post_meta( $variation_id, '_woosea_is_promotion', stripslashes( sanitize_text_field( $_is_promotion[$i] )));
3665
  }
3666
+ }
3667
 
3668
  // Is bundle
3669
+ if(isset($_POST['_woosea_is_bundle'])){
3670
+ $_is_bundle = $_POST['_woosea_is_bundle'];
3671
  $variation_id = (int) $variable_post_id[$i];
3672
  if ( isset( $_is_bundle[$i] ) ) {
3673
  update_post_meta( $variation_id, '_woosea_is_bundle', stripslashes( sanitize_text_field( $_is_bundle[$i] )));
3674
  }
3675
+ }
3676
 
3677
  // Energy efficiency class
3678
+ if(isset($_POST['_woosea_energy_efficiency_class'])){
3679
+ $_energy_efficiency_class = $_POST['_woosea_energy_efficiency_class'];
3680
  $variation_id = (int) $variable_post_id[$i];
3681
  if ( isset( $_energy_efficiency_class[$i] ) ) {
3682
  update_post_meta( $variation_id, '_woosea_energy_efficiency_class', stripslashes( sanitize_text_field( $_energy_efficiency_class[$i] )));
3683
  }
3684
+ }
3685
 
3686
  // Minimum energy efficiency class
3687
+ if(isset($_POST['_woosea_min_energy_efficiency_class'])){
3688
+ $_min_energy_efficiency_class = $_POST['_woosea_min_energy_efficiency_class'];
3689
  $variation_id = (int) $variable_post_id[$i];
3690
  if ( isset( $_min_energy_efficiency_class[$i] ) ) {
3691
  update_post_meta( $variation_id, '_woosea_min_energy_efficiency_class', stripslashes( sanitize_text_field( $_min_energy_efficiency_class[$i] )));
3692
  }
3693
+ }
3694
 
3695
  // Maximum energy efficiency class
3696
+ if(isset($_POST['_woosea_max_energy_efficiency_class'])){
3697
+ $_max_energy_efficiency_class = $_POST['_woosea_max_energy_efficiency_class'];
3698
  $variation_id = (int) $variable_post_id[$i];
3699
  if ( isset( $_max_energy_efficiency_class[$i] ) ) {
3700
  update_post_meta( $variation_id, '_woosea_max_energy_efficiency_class', stripslashes( sanitize_text_field( $_max_energy_efficiency_class[$i] )));
3701
  }
3702
+ }
3703
 
3704
  // Custom field 0
3705
+ if(isset($_POST['_woosea_custom_field_0'])){
3706
+ $_custom_field_0 = $_POST['_woosea_custom_field_0'];
3707
  $variation_id = (int) $variable_post_id[$i];
3708
  if ( isset( $_custom_field_0[$i] ) ) {
3709
  update_post_meta( $variation_id, '_woosea_custom_field_0', stripslashes( sanitize_text_field( $_custom_field_0[$i] )));
3710
  }
3711
+ }
3712
 
3713
  // Custom field 1
3714
+ if(isset($_POST['_woosea_custom_field_1'])){
3715
+ $_custom_field_1 = $_POST['_woosea_custom_field_1'];
3716
  $variation_id = (int) $variable_post_id[$i];
3717
  if ( isset( $_custom_field_1[$i] ) ) {
3718
  update_post_meta( $variation_id, '_woosea_custom_field_1', stripslashes( sanitize_text_field( $_custom_field_1[$i] )));
3719
  }
3720
+ }
3721
 
3722
  // Custom field 2
3723
+ if(isset($_POST['_woosea_custom_field_2'])){
3724
+ $_custom_field_2 = $_POST['_woosea_custom_field_2'];
3725
  $variation_id = (int) $variable_post_id[$i];
3726
  if ( isset( $_custom_field_2[$i] ) ) {
3727
  update_post_meta( $variation_id, '_woosea_custom_field_2', stripslashes( sanitize_text_field( $_custom_field_2[$i] )));
3728
  }
3729
+ }
3730
 
3731
  // Custom field 3
3732
+ if(isset($_POST['_woosea_custom_field_3'])){
3733
+ $_custom_field_3 = $_POST['_woosea_custom_field_3'];
3734
  $variation_id = (int) $variable_post_id[$i];
3735
  if ( isset( $_custom_field_3[$i] ) ) {
3736
  update_post_meta( $variation_id, '_woosea_custom_field_3', stripslashes( sanitize_text_field( $_custom_field_3[$i] )));
3737
  }
3738
+ }
3739
 
3740
  // Custom field 4
3741
+ if(isset($_POST['_woosea_custom_field_4'])){
3742
+ $_custom_field_4 = $_POST['_woosea_custom_field_4'];
3743
  $variation_id = (int) $variable_post_id[$i];
3744
  if ( isset( $_custom_field_4[$i] ) ) {
3745
  update_post_meta( $variation_id, '_woosea_custom_field_4', stripslashes( sanitize_text_field( $_custom_field_4[$i] )));
3746
  }
3747
+ }
3748
 
3749
  // Exclude product from feed
3750
  if(empty($_POST['_woosea_exclude_product'])){