PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads) - Version 7.1.7

Version Description

Download this release

Release Info

Developer PixelYourSite
Plugin Icon 128x128 PixelYourSite – Facebook Pixel (Events, WooCommerce & Easy Digital Downloads)
Version 7.1.7
Comparing to
See all releases

Code changes from version 7.1.6 to 7.1.7

facebook-pixel-master.php CHANGED
@@ -4,13 +4,13 @@
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
- * Version: 7.1.6
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
11
  *
12
  * Requires at least: 4.4
13
- * Tested up to: 5.3
14
  *
15
  * WC requires at least: 2.6.0
16
  * WC tested up to: 4.0
4
  * Plugin Name: PixelYourSite
5
  * Plugin URI: http://www.pixelyoursite.com/
6
  * Description: No codding <strong>Facebook Pixel</strong> and <strong>Google Analytics</strong> install. Track key actions with our Global Events, or configure your own events. WooCommerce and EDD fully supported, with Facebook Dynamic Ads Pixel set-up and Google Analytics Enhanced Ecommerce. Insert any custom script with our Head & Footer option. Add the <strong>Pinterest Tag</strong> with our free add-on. The PRO version adds support for the Google Ads tag plus a lot of extra stuff.
7
+ * Version: 7.1.7
8
  * Author: PixelYourSite
9
  * Author URI: http://www.pixelyoursite.com
10
  * License: GPLv3
11
  *
12
  * Requires at least: 4.4
13
+ * Tested up to: 5.4
14
  *
15
  * WC requires at least: 2.6.0
16
  * WC tested up to: 4.0
includes/functions-common.php CHANGED
@@ -201,9 +201,12 @@ function getAvailableUserRoles() {
201
 
202
  function getAvailableProductCog($product_id) {
203
 
 
204
  $cog_product_val = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
205
  $cog_term_val = get_product_cost_by_cat( $product_id );
206
-
 
 
207
  if ($cog_product_val) {
208
  $cog = array(
209
  'type' => get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true ),
@@ -235,9 +238,16 @@ function getAvailableProductCogOrder($order_id) {
235
  $custom_total = 0;
236
  $cat_isset = 0;
237
  foreach ( $order->get_items() as $item_id => $item ) {
 
 
 
 
238
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
239
  $cost_type = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true );
240
  $product_cost = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
 
 
 
241
  $price = get_post_meta($product_id, '_regular_price', true);
242
  $qlt = $item['quantity'];
243
  if ($product_cost) {
@@ -292,9 +302,16 @@ function getAvailableProductCogCart($amount) {
292
  $custom_total = 0;
293
  $cat_isset = 0;
294
  foreach ( WC()->cart->cart_contents as $cart_item_key => $item ) {
 
 
 
 
295
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
296
  $cost_type = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true );
297
  $product_cost = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
 
 
 
298
  $price = get_post_meta($product_id, '_regular_price', true);
299
  $qlt = $item['quantity'];
300
  if ($product_cost) {
201
 
202
  function getAvailableProductCog($product_id) {
203
 
204
+ $parent_id = wp_get_post_parent_id( $product_id );
205
  $cog_product_val = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
206
  $cog_term_val = get_product_cost_by_cat( $product_id );
207
+ if (($parent_id > 0) && $cog_product_val == '') {
208
+ $cog_product_val = get_post_meta( $parent_id, '_pixel_cost_of_goods_cost_val', true );
209
+ }
210
  if ($cog_product_val) {
211
  $cog = array(
212
  'type' => get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true ),
238
  $custom_total = 0;
239
  $cat_isset = 0;
240
  foreach ( $order->get_items() as $item_id => $item ) {
241
+ $parent_id = false;
242
+ if (isset( $item['variation_id'] ) && 0 != $item['variation_id']) {
243
+ $parent_id = $item['product_id'];
244
+ }
245
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
246
  $cost_type = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true );
247
  $product_cost = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
248
+ if ($parent_id && $product_cost == '') {
249
+ $product_cost = get_post_meta( $parent_id, '_pixel_cost_of_goods_cost_val', true );
250
+ }
251
  $price = get_post_meta($product_id, '_regular_price', true);
252
  $qlt = $item['quantity'];
253
  if ($product_cost) {
302
  $custom_total = 0;
303
  $cat_isset = 0;
304
  foreach ( WC()->cart->cart_contents as $cart_item_key => $item ) {
305
+ $parent_id = false;
306
+ if (isset( $item['variation_id'] ) && 0 != $item['variation_id']) {
307
+ $parent_id = $item['product_id'];
308
+ }
309
  $product_id = ( isset( $item['variation_id'] ) && 0 != $item['variation_id'] ? $item['variation_id'] : $item['product_id'] );
310
  $cost_type = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_type', true );
311
  $product_cost = get_post_meta( $product_id, '_pixel_cost_of_goods_cost_val', true );
312
+ if ($parent_id && $product_cost == '') {
313
+ $product_cost = get_post_meta( $parent_id, '_pixel_cost_of_goods_cost_val', true );
314
+ }
315
  $price = get_post_meta($product_id, '_regular_price', true);
316
  $qlt = $item['quantity'];
317
  if ($product_cost) {
pixelyoursite.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'ABSPATH' ) ) {
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
- define( 'PYS_FREE_VERSION', '7.1.6' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
4
  exit; // Exit if accessed directly.
5
  }
6
 
7
+ define( 'PYS_FREE_VERSION', '7.1.7' );
8
  define( 'PYS_FREE_PINTEREST_MIN_VERSION', '2.0.6' );
9
  define( 'PYS_FREE_BING_MIN_VERSION', '1.0.0' );
10
  define( 'PYS_FREE_PATH', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Facebook Pixel, New Facebook Pixel, Facebook Conversion Pixel, Facebook Pi
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.4
6
  Tested up to: 5.4
7
- Stable tag: 7.1.6
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
@@ -388,6 +388,11 @@ NO, absolutely not! We don't track any type of data about your website. We simpl
388
 
389
  == Changelog ==
390
 
 
 
 
 
 
391
  = PixelYourSite 7.1.6 =
392
 
393
  * Small code update to declare WooCommerce 4.0 compatibility.
4
  Requires at least: 3.0.1
5
  Requires PHP: 5.4
6
  Tested up to: 5.4
7
+ Stable tag: 7.1.7
8
  License: GPLv3
9
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
10
 
388
 
389
  == Changelog ==
390
 
391
+
392
+ = PixelYourSite 7.1.6 =
393
+
394
+ * This is a minor update that ensures compatibility with the latest changes from the [WooCommerce Cost of Goods plugin by PixelYourSite](https://www.pixelyoursite.com/woocommerce-cost-of-goods)
395
+
396
  = PixelYourSite 7.1.6 =
397
 
398
  * Small code update to declare WooCommerce 4.0 compatibility.