CTX Feed – WooCommerce Product Feed Manager Plugin - Version 4.3.15

Version Description

(2020-12-29) = * Fixed: Facebook pixel event issue solved.

Download this release

Release Info

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

Code changes from version 4.3.14 to 4.3.15

Files changed (3) hide show
  1. README.txt +4 -1
  2. includes/helper.php +30 -29
  3. woo-feed.php +2 -2
README.txt CHANGED
@@ -8,7 +8,7 @@ Google Product Review feed, product variations, rakuteen, shopping, skroutz, TSV
8
  Requires at least: 3.6
9
  Tested Up To: 5.6
10
  Requires PHP: 5.6
11
- Stable tag: 4.3.14
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
@@ -308,6 +308,9 @@ Using pro version:
308
 
309
  == Changelog ==
310
 
 
 
 
311
  = 4.3.14 (2020-12-28) =
312
  * Fixed: Edit page file type issue.
313
  * Fixed: Facebook pixel price fatal error.
8
  Requires at least: 3.6
9
  Tested Up To: 5.6
10
  Requires PHP: 5.6
11
+ Stable tag: 4.3.15
12
  License: GPLv2 or later
13
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
14
 
308
 
309
  == Changelog ==
310
 
311
+ = 4.3.15 (2020-12-29) =
312
+ * Fixed: Facebook pixel event issue solved.
313
+
314
  = 4.3.14 (2020-12-28) =
315
  * Fixed: Edit page file type issue.
316
  * Fixed: Facebook pixel price fatal error.
includes/helper.php CHANGED
@@ -3372,7 +3372,7 @@ if ( ! function_exists( 'woo_feed_pixel_script' ) ) {
3372
  */
3373
  function woo_feed_pixel_script(){
3374
 
3375
- global $woocommerce, $post, $product, $product;
3376
 
3377
  // Pixel Config.
3378
  $settings = woo_feed_get_options( 'all' );
@@ -3385,15 +3385,16 @@ if ( ! function_exists( 'woo_feed_pixel_script' ) ) {
3385
  // Product Tracking
3386
  if ( is_product() ) {
3387
  $product = wc_get_product( $post->ID );
3388
- $product_price = $product->get_price();
3389
-
3390
- $view_type .= "fbq('track', 'ViewContent', {
3391
  content_name: '$post->post_title',
3392
  content_id: $post->ID,
3393
  content_type: 'product',
3394
  value: $product_price,
3395
- currency: '".get_option('woocommerce_currency')."'
3396
- });";
 
3397
  }
3398
 
3399
  // Purchase Tracking
@@ -3402,22 +3403,20 @@ if ( ! function_exists( 'woo_feed_pixel_script' ) ) {
3402
  $product_skus = '';
3403
  global $wp_query;
3404
  if ( ! empty( $wp_query->query_vars['order-received'] ) ) {
3405
- $order = wc_get_order( $wp_query->query_vars['order-received'] );
3406
- $items = $order->get_items();
3407
- foreach ( $order->get_items() as $item_id => $item ) {
3408
- $order_id = $item->get_order_id();
3409
- }
3410
- $order = new WC_Order($order_id);
3411
- $price = $order->get_total();
 
 
 
 
 
 
3412
  }
3413
- $view_type .= "fbq('track', 'Purchase', {
3414
- value: $price,
3415
- currency: '".get_option('woocommerce_currency')."'
3416
- });";
3417
- $view_type .= "fbq('track', 'CompleteRegistration', {
3418
- value: $price,
3419
- currency: '".get_option('woocommerce_currency')."'
3420
- })";
3421
  }
3422
 
3423
  if ( $disable_pixel == 'enable' ) {
@@ -3456,13 +3455,14 @@ if ( ! function_exists('woo_feed_addtocart' ) ) {
3456
  if ( $disable_pixel == 'enable' ) {
3457
  if ( isset( $_REQUEST['add-to-cart'] ) ) {
3458
  $product_id = ! empty( $_REQUEST['add-to-cart'] ) ? $_REQUEST['add-to-cart'] : "";
3459
- $product = wc_get_product( $product_id );
3460
- $product_name = $product->get_title();
3461
- $product_id = $product->get_id();
3462
- $product_price = $product->get_price();
3463
- $currency = get_option( 'woocommerce_currency' );
3464
-
3465
- $view_type = "<script>
 
3466
  fbq('track', 'AddToCart', {
3467
  content_name: '$product_name',
3468
  content_ids: $product_id,
@@ -3471,7 +3471,8 @@ if ( ! function_exists('woo_feed_addtocart' ) ) {
3471
  currency: '$currency',});
3472
  </script>";
3473
 
3474
- echo $view_type;
 
3475
  }
3476
  }
3477
  }
3372
  */
3373
  function woo_feed_pixel_script(){
3374
 
3375
+ global $woocommerce, $post;
3376
 
3377
  // Pixel Config.
3378
  $settings = woo_feed_get_options( 'all' );
3385
  // Product Tracking
3386
  if ( is_product() ) {
3387
  $product = wc_get_product( $post->ID );
3388
+ if($product instanceof WC_Product) {
3389
+ $product_price = $product->get_price();
3390
+ $view_type .= "fbq('track', 'ViewContent', {
3391
  content_name: '$post->post_title',
3392
  content_id: $post->ID,
3393
  content_type: 'product',
3394
  value: $product_price,
3395
+ currency: '" . get_option('woocommerce_currency') . "'
3396
+ });";
3397
+ }
3398
  }
3399
 
3400
  // Purchase Tracking
3403
  $product_skus = '';
3404
  global $wp_query;
3405
  if ( ! empty( $wp_query->query_vars['order-received'] ) ) {
3406
+ $order = wc_get_order($wp_query->query_vars['order-received'] );
3407
+ if($order instanceof WC_Order){
3408
+ $price = $order->get_total();
3409
+ $currency=$order->get_currency();
3410
+ $view_type .= "fbq('track', 'Purchase', {
3411
+ value: '$price',
3412
+ currency: '$currency'
3413
+ });";
3414
+ $view_type .= "fbq('track', 'CompleteRegistration', {
3415
+ value: '$price',
3416
+ currency: '$currency'
3417
+ })";
3418
+ }
3419
  }
 
 
 
 
 
 
 
 
3420
  }
3421
 
3422
  if ( $disable_pixel == 'enable' ) {
3455
  if ( $disable_pixel == 'enable' ) {
3456
  if ( isset( $_REQUEST['add-to-cart'] ) ) {
3457
  $product_id = ! empty( $_REQUEST['add-to-cart'] ) ? $_REQUEST['add-to-cart'] : "";
3458
+ $product = wc_get_product( (int)$product_id );
3459
+ if($product instanceof WC_Product){
3460
+ $product_name = $product->get_title();
3461
+ $product_id = $product->get_id();
3462
+ $product_price = $product->get_price();
3463
+ $currency = get_option( 'woocommerce_currency' );
3464
+
3465
+ $view_type = "<script>
3466
  fbq('track', 'AddToCart', {
3467
  content_name: '$product_name',
3468
  content_ids: $product_id,
3471
  currency: '$currency',});
3472
  </script>";
3473
 
3474
+ echo $view_type;
3475
+ }
3476
  }
3477
  }
3478
  }
woo-feed.php CHANGED
@@ -10,7 +10,7 @@
10
  * Plugin Name: WooCommerce Product 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.14
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.14' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {
10
  * Plugin Name: WooCommerce Product 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.15
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.15' );
42
  }
43
 
44
  if ( ! defined( 'WOO_FEED_FREE_FILE' ) ) {