CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.3.52

Version Description

(2021-03-22) = * Added: Compatibility for Discount Rules for WooCommerce by Flycart.

Download this release

Release Info

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

Code changes from version 4.3.51 to 4.3.52

README.txt CHANGED
@@ -5,7 +5,7 @@ Tags: Product Feed, WooCommerce, Google Shopping, Google Merchant, Facebook Cata
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
- Stable tag: 4.3.51
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
@@ -498,6 +498,9 @@ Using pro version:
498
 
499
  == Changelog ==
500
 
 
 
 
501
  = 4.3.51 (2021-03-18) =
502
  * Fixed: Onchange feedType to csv and txt, delimiter and enclosure doesn't show is solved.
503
 
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 4.3.52
9
  License: GPLv2 or later
10
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
11
 
498
 
499
  == Changelog ==
500
 
501
+ = 4.3.52 (2021-03-22) =
502
+ * Added: Compatibility for Discount Rules for WooCommerce by Flycart.
503
+
504
  = 4.3.51 (2021-03-18) =
505
  * Fixed: Onchange feedType to csv and txt, delimiter and enclosure doesn't show is solved.
506
 
includes/classes/class-woo-feed-products-v3.php CHANGED
@@ -2593,6 +2593,9 @@ class Woo_Feed_Products_v3
2593
  $current_price = $product->get_price();
2594
  }
2595
 
 
 
 
2596
  return apply_filters('woo_feed_filter_product_regular_price', $current_price, $product, $this->config);
2597
  }
2598
 
@@ -2622,6 +2625,9 @@ class Woo_Feed_Products_v3
2622
  $sale_price = $price > 0 ? $price : '';
2623
  }
2624
 
 
 
 
2625
  return apply_filters('woo_feed_filter_product_sale_price', $sale_price, $product, $this->config);
2626
  }
2627
 
@@ -2676,6 +2682,9 @@ class Woo_Feed_Products_v3
2676
  $price) : $price;
2677
  }
2678
 
 
 
 
2679
  return apply_filters('woo_feed_filter_product_regular_price_with_tax', $current_price_with_tax, $product, $this->config);
2680
  }
2681
 
@@ -2704,6 +2713,9 @@ class Woo_Feed_Products_v3
2704
  $sale_price_with_tax = $price > 0 ? $price : '';
2705
  }
2706
 
 
 
 
2707
  return apply_filters('woo_feed_filter_product_sale_price_with_tax', $sale_price_with_tax, $product, $this->config);
2708
  }
2709
 
@@ -2823,6 +2835,52 @@ class Woo_Feed_Products_v3
2823
  }
2824
  }
2825
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2826
  /**
2827
  * Get price for Iconic woocommerce-bundled-products
2828
  *
2593
  $current_price = $product->get_price();
2594
  }
2595
 
2596
+ //get dynamic discounted prices
2597
+ $current_price = $this->get_dynamic_discounted_product_price($product, $current_price);
2598
+
2599
  return apply_filters('woo_feed_filter_product_regular_price', $current_price, $product, $this->config);
2600
  }
2601
 
2625
  $sale_price = $price > 0 ? $price : '';
2626
  }
2627
 
2628
+ //get dynamic discounted prices
2629
+ $sale_price = $this->get_dynamic_discounted_product_price($product, $sale_price);
2630
+
2631
  return apply_filters('woo_feed_filter_product_sale_price', $sale_price, $product, $this->config);
2632
  }
2633
 
2682
  $price) : $price;
2683
  }
2684
 
2685
+ //get dynamic discounted prices
2686
+ $current_price_with_tax = $this->get_dynamic_discounted_product_price($product, $current_price_with_tax, true);
2687
+
2688
  return apply_filters('woo_feed_filter_product_regular_price_with_tax', $current_price_with_tax, $product, $this->config);
2689
  }
2690
 
2713
  $sale_price_with_tax = $price > 0 ? $price : '';
2714
  }
2715
 
2716
+ //get dynamic discounted prices
2717
+ $sale_price_with_tax = $this->get_dynamic_discounted_product_price($product, $sale_price_with_tax, true);
2718
+
2719
  return apply_filters('woo_feed_filter_product_sale_price_with_tax', $sale_price_with_tax, $product, $this->config);
2720
  }
2721
 
2835
  }
2836
  }
2837
 
2838
+ /**
2839
+ * Get price with dynamic discount
2840
+ *
2841
+ * @param WC_Product $product product object
2842
+ * @param $price
2843
+ * @param bool $tax product taxable or not
2844
+ *
2845
+ * @author Nazrul Islam Nayan
2846
+ * @since 4.3.52
2847
+ * @return mixed $price
2848
+ */
2849
+ private function get_dynamic_discounted_product_price($product, $price, $tax = false) {
2850
+ // When discount rules plugin by flycart is activated, bring the discounted price
2851
+ if ( is_plugin_active('woo-discount-rules/woo-discount-rules.php') ) {
2852
+
2853
+ if( class_exists('Wdr\App\Controllers\Configuration') ) {
2854
+ $config = Wdr\App\Controllers\Configuration::getInstance()->getConfig('calculate_discount_from', 'sale_price');
2855
+
2856
+ if( isset($config) && !empty($config) ) {
2857
+ if( 'regular_price' === $config ) {
2858
+ $price = $product->get_regular_price();
2859
+ }else {
2860
+ $price = $product->get_sale_price();
2861
+ }
2862
+ } else {
2863
+ $price = $product->get_regular_price();
2864
+ }
2865
+
2866
+ //when tax is enabled
2867
+ if( $tax ) {
2868
+ $price = ( $product->is_taxable() && ! empty( $price ) ) ? $this->get_price_with_tax(
2869
+ $product,
2870
+ $price
2871
+ ) : $price;
2872
+ }
2873
+
2874
+ $discounted_price = apply_filters('advanced_woo_discount_rules_get_product_discount_price_from_custom_price', false, $product, 1, $price, 'discounted_price', true, true);
2875
+ if(false !== $discounted_price) {
2876
+ return $discounted_price;
2877
+ }
2878
+ }
2879
+ }
2880
+
2881
+ return $price;
2882
+ }
2883
+
2884
  /**
2885
  * Get price for Iconic woocommerce-bundled-products
2886
  *
woo-feed.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: CTX Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
- * Version: 4.3.51
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
@@ -38,7 +38,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
38
  * @var string
39
  * @since 3.1.6
40
  */
41
- define( 'WOO_FEED_FREE_VERSION', '4.3.51' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
10
  * Plugin Name: CTX Feed
11
  * Plugin URI: https://webappick.com/
12
  * Description: Easily generate woocommerce product feed for any marketing channel like Google Shopping(Merchant), Facebook Remarketing, Bing, eBay & more. Support 100+ Merchants.
13
+ * Version: 4.3.52
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
38
  * @var string
39
  * @since 3.1.6
40
  */
41
+ define( 'WOO_FEED_FREE_VERSION', '4.3.52' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {