CTX Feed – WooCommerce Product Feed Manager Plugin - Version 3.1.40

Version Description

(2019-10-21) = * Fix error on fetching invalid child product of group product. * Fix google taxonomy not being selected on edit page * Remove unnecessary admin notices.

Download this release

Release Info

Developer wahid0003
Plugin Icon 128x128 CTX Feed – WooCommerce Product Feed Manager Plugin
Version 3.1.40
Comparing to
See all releases

Code changes from version 3.1.39 to 3.1.40

README.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://webappick.com
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.2
7
- Stable tag: 3.1.39
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -304,6 +304,11 @@ Using pro version:
304
 
305
  == Changelog ==
306
 
 
 
 
 
 
307
  = 3.1.39 (2019-10-20) =
308
  * Adds plugin assets (was missing), sorry :)
309
  * UI Fix.
4
  Tags:woocommerce,google product feed,facebook product feed,woocommerce product feed,woocommerce,
5
  Requires at least: 3.6
6
  Tested Up To: 5.2
7
+ Stable tag: 3.1.40
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
304
 
305
  == Changelog ==
306
 
307
+ = 3.1.40 (2019-10-21) =
308
+ * Fix error on fetching invalid child product of group product.
309
+ * Fix google taxonomy not being selected on edit page
310
+ * Remove unnecessary admin notices.
311
+
312
  = 3.1.39 (2019-10-20) =
313
  * Adds plugin assets (was missing), sorry :)
314
  * UI Fix.
includes/classes/class-woo-feed-dropdown.php CHANGED
@@ -41,13 +41,13 @@ class Woo_Feed_Dropdown
41
  }
42
  return $str;
43
  }
44
-
45
  /**
46
  * Read txt file which contains google taxonomy list
47
  * @param string $selected
48
  * @return string
49
  */
50
- public function googleTaxonomy( $selected = "" ){
51
  # Get All Google Taxonomies
52
  $fileName = WOO_FEED_Admin_Path . "/partials/templates/google_taxonomy.txt";
53
  $customTaxonomyFile = fopen($fileName, "r");
@@ -64,8 +64,13 @@ class Woo_Feed_Dropdown
64
  list( $catId, $cat ) = explode("-", $line );
65
  $catId = (int) trim( $catId );
66
  $cat = trim( $cat );
67
- $selected = ( version_compare( '3.1.28', WOO_FEED_VERSION ) <= 0 ) ? selected( $selected, $cat, false ): selected( $selected, $catId, false );
68
- $str .= sprintf( '<option value="%s"%s>%s</option>', $catId, $selected, $cat );
 
 
 
 
 
69
  }
70
  }
71
  if( ! empty( $str ) ) {
41
  }
42
  return $str;
43
  }
44
+
45
  /**
46
  * Read txt file which contains google taxonomy list
47
  * @param string $selected
48
  * @return string
49
  */
50
+ public function googleTaxonomy( $selected = "" ) {
51
  # Get All Google Taxonomies
52
  $fileName = WOO_FEED_Admin_Path . "/partials/templates/google_taxonomy.txt";
53
  $customTaxonomyFile = fopen($fileName, "r");
64
  list( $catId, $cat ) = explode("-", $line );
65
  $catId = (int) trim( $catId );
66
  $cat = trim( $cat );
67
+ /** @noinspection HtmlUnknownAttribute */
68
+ $str .= sprintf(
69
+ '<option value="%s"%s>%s</option>',
70
+ $catId,
71
+ selected( $selected, is_numeric( $selected ) ? $catId : $cat, false ),
72
+ $cat
73
+ );
74
  }
75
  }
76
  if( ! empty( $str ) ) {
includes/classes/class-woo-feed-products.php CHANGED
@@ -644,40 +644,41 @@ class Woo_Feed_Products {
644
 
645
  return $this->productsList;
646
  }
647
-
648
  /**
649
  * Get total price of grouped product
650
  *
651
  * @since 2.2.14
652
- * @param $grouped
653
- * @param $type
654
- * @param $taxable
655
  * @return int|string
656
  */
657
- public function getGroupProductPrice($grouped,$type,$taxable=false){
658
  $groupProductIds = $grouped->get_children();
659
  $sum = 0;
660
- if(!empty($groupProductIds)){
661
-
662
- foreach($groupProductIds as $id){
663
- $product = wc_get_product($id);
664
- $regularPrice=$product->get_regular_price();
665
- $currentPrice=$product->get_price();
666
- if($type == "regular"){
667
- if($taxable){
 
 
668
  $regularPrice=$this->getPriceWithTax($product);
669
-
670
  }
671
  $sum += $regularPrice;
672
  }else{
673
- if($taxable){
674
  $currentPrice=$this->getPriceWithTax($product);
675
  }
676
  $sum += $currentPrice;
677
  }
678
  }
679
  }
680
-
681
  return $sum;
682
  }
683
 
@@ -688,7 +689,7 @@ class Woo_Feed_Products {
688
  * @param $variations
689
  * @param $parent
690
  */
691
- public function getWC3Variations($variations,$parent) {
692
  try{
693
  if(is_array($variations) && (sizeof($variations) > 0 )){
694
  foreach ($variations as $vKey=>$variationProd){
644
 
645
  return $this->productsList;
646
  }
647
+
648
  /**
649
  * Get total price of grouped product
650
  *
651
  * @since 2.2.14
652
+ * @param WC_Product_Grouped $grouped
653
+ * @param string $type
654
+ * @param bool $taxable
655
  * @return int|string
656
  */
657
+ public function getGroupProductPrice( $grouped, $type, $taxable = false ) {
658
  $groupProductIds = $grouped->get_children();
659
  $sum = 0;
660
+ if( ! empty( $groupProductIds ) ) {
661
+ foreach( $groupProductIds as $id ) {
662
+ $product = wc_get_product( $id );
663
+ if( ! $product ) {
664
+ continue; // make sure that the product exists..
665
+ }
666
+ $regularPrice = $product->get_regular_price();
667
+ $currentPrice = $product->get_price();
668
+ if( $type == "regular" ) {
669
+ if( $taxable ) {
670
  $regularPrice=$this->getPriceWithTax($product);
 
671
  }
672
  $sum += $regularPrice;
673
  }else{
674
+ if( $taxable ) {
675
  $currentPrice=$this->getPriceWithTax($product);
676
  }
677
  $sum += $currentPrice;
678
  }
679
  }
680
  }
681
+
682
  return $sum;
683
  }
684
 
689
  * @param $variations
690
  * @param $parent
691
  */
692
+ public function getWC3Variations($variations, $parent ) {
693
  try{
694
  if(is_array($variations) && (sizeof($variations) > 0 )){
695
  foreach ($variations as $vKey=>$variationProd){
woo-feed.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WooCommerce Product Feed
16
  * Plugin URI: https://webappick.com/
17
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
18
- * Version: 3.1.39
19
  * Author: WebAppick
20
  * Author URI: https://webappick.com/
21
  * License: GPL v2
@@ -34,7 +34,7 @@ if (!defined('ABSPATH')) die();
34
  * Plugin Version
35
  * @var string
36
  */
37
- define( 'WOO_FEED_VERSION', '3.1.39' );
38
 
39
  /**
40
  * Plugin Path with trailing slash
@@ -909,6 +909,21 @@ if( ! function_exists( 'woo_feed_manage_feed' ) ) {
909
  }
910
  }
911
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
912
  if( ! function_exists( 'woo_feed_pro_vs_free' ) ) {
913
  /**
914
  * Difference between free and premium plugin
15
  * Plugin Name: WooCommerce Product Feed
16
  * Plugin URI: https://webappick.com/
17
  * Description: This plugin generate WooCommerce product feed for Shopping Engines like Google Shopping,Facebook Product Feed,eBay,Amazon,Idealo and many more..
18
+ * Version: 3.1.40
19
  * Author: WebAppick
20
  * Author URI: https://webappick.com/
21
  * License: GPL v2
34
  * Plugin Version
35
  * @var string
36
  */
37
+ define( 'WOO_FEED_VERSION', '3.1.40' );
38
 
39
  /**
40
  * Plugin Path with trailing slash
909
  }
910
  }
911
  }
912
+ if( ! function_exists( 'woo_feed_pro_features_page_remove_admin_notices' ) ) {
913
+ add_action( 'admin_head', 'woo_feed_pro_features_page_remove_admin_notices', 9999 );
914
+ /**
915
+ * Remove Admin Notice in pro features page.
916
+ * @global string $pagenow
917
+ * @global string $plugin_page
918
+ * @return void
919
+ */
920
+ function woo_feed_pro_features_page_remove_admin_notices() {
921
+ global $pagenow, $plugin_page;
922
+ if( 'admin.php' == $pagenow && 'webappick-feed-pro-vs-free' == $plugin_page ) {
923
+ remove_all_actions( 'admin_notices' );
924
+ }
925
+ }
926
+ }
927
  if( ! function_exists( 'woo_feed_pro_vs_free' ) ) {
928
  /**
929
  * Difference between free and premium plugin