CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.3.56

Version Description

(2021-03-29) = * Added: Compatibility for Discount Plugin by Orion has been added.

Download this release

Release Info

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

Code changes from version 4.3.55 to 4.3.56

Files changed (3) hide show
  1. README.txt +4 -1
  2. includes/helper.php +41 -0
  3. woo-feed.php +2 -2
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.55
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.55 (2021-03-28) =
502
  * Added: Addtocart in cart & product page added and removed ajax addtocart event.
503
 
5
  Requires at least: 3.6
6
  Tested Up To: 5.7
7
  Requires PHP: 5.6
8
+ Stable tag: 4.3.56
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.56 (2021-03-29) =
502
+ * Added: Compatibility for Discount Plugin by Orion has been added.
503
+
504
  = 4.3.55 (2021-03-28) =
505
  * Added: Addtocart in cart & product page added and removed ajax addtocart event.
506
 
includes/helper.php CHANGED
@@ -4384,6 +4384,47 @@ if( ! function_exists('woo_feed_get_dynamic_discounted_product_price') ) {
4384
  }
4385
  }
4386
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4387
  return $price;
4388
  }
4389
  }
4384
  }
4385
  }
4386
 
4387
+
4388
+ // When discount plugin by Orion is activated, bring the discounted price
4389
+ if( is_plugin_active('woo-advanced-discounts/wad.php') ) {
4390
+ $discount_amount = 0;
4391
+ global $wad_discounts;
4392
+ if( isset($wad_discounts["product"]) ) {
4393
+ foreach ($wad_discounts["product"] as $discount_id => $discount_obj) {
4394
+ if ( $discount_obj->is_applicable( $product->get_id() ) ) {
4395
+ $wad_obj = new WAD_Discount($discount_id);
4396
+ if( isset($wad_obj->settings) ) {
4397
+ $settings = $wad_obj->settings;
4398
+ $discount_type = $wad_obj->settings['action'];
4399
+ if( false !== strpos($discount_type, 'fixed') ) {
4400
+ $discount_amount = $wad_obj->get_discount_amount(floatval($price));
4401
+ } elseif ( false !== strpos($discount_type, 'percentage') ) {
4402
+ $percentage = $settings['percentage-or-fixed-amount'];
4403
+ $discount_amount = floatval($product->get_price()) * ($percentage/100);
4404
+ }
4405
+ }
4406
+
4407
+ }
4408
+ }
4409
+
4410
+ $price = floatval($product->get_price()) - floatval($discount_amount);
4411
+
4412
+ //when tax is enable
4413
+ if( $tax ) {
4414
+ if ($product->is_taxable()) {
4415
+ if (!wc_prices_include_tax()) {
4416
+ $tax_rates = WC_Tax::get_rates($product->get_tax_class());
4417
+ $tax_rates = reset($tax_rates);
4418
+ if( isset($tax_rates['rate']) ) {
4419
+ $tax_amount = $tax_rates['rate'];
4420
+ return $price + ( $price * $tax_amount ) / 100;
4421
+ }
4422
+ }
4423
+ }
4424
+ }
4425
+ }
4426
+ }
4427
+
4428
  return $price;
4429
  }
4430
  }
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.55
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
@@ -39,7 +39,7 @@ if ( ! defined( 'WOO_FEED_FREE_VERSION' ) ) {
39
  * @var string
40
  * @since 3.1.6
41
  */
42
- define( 'WOO_FEED_FREE_VERSION', '4.3.55' );
43
  }
44
 
45
  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.56
14
  * Author: WebAppick
15
  * Author URI: https://webappick.com/
16
  * License: GPL v2
39
  * @var string
40
  * @since 3.1.6
41
  */
42
+ define( 'WOO_FEED_FREE_VERSION', '4.3.56' );
43
  }
44
 
45
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {