Facebook for WooCommerce - Version 2.1.4

Version Description

Download this release

Release Info

Developer SkyVerge
Plugin Icon Facebook for WooCommerce
Version 2.1.4
Comparing to
See all releases

Code changes from version 2.1.3 to 2.1.4

changelog.txt CHANGED
@@ -1,5 +1,8 @@
1
  *** Facebook for WooCommerce Changelog ***
2
 
 
 
 
3
  2020.10.29 - version 2.1.3
4
  * Fix - Prevent error triggered while trying to refund orders
5
 
1
  *** Facebook for WooCommerce Changelog ***
2
 
3
+ 2020.11.04 - version 2.1.4
4
+ * Fix - Ensure product variant attributes are correctly handled when checking for enhanced attribute values.
5
+
6
  2020.10.29 - version 2.1.3
7
  * Fix - Prevent error triggered while trying to refund orders
8
 
class-wc-facebookcommerce.php CHANGED
@@ -22,7 +22,7 @@ if ( ! class_exists( 'WC_Facebookcommerce' ) ) :
22
 
23
 
24
  /** @var string the plugin version */
25
- const VERSION = '2.1.3';
26
 
27
  /** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
28
  const PLUGIN_VERSION = self::VERSION;
22
 
23
 
24
  /** @var string the plugin version */
25
+ const VERSION = '2.1.4';
26
 
27
  /** @var string for backwards compatibility TODO: remove this in v2.0.0 {CW 2020-02-06} */
28
  const PLUGIN_VERSION = self::VERSION;
facebook-for-woocommerce.php CHANGED
@@ -10,7 +10,7 @@
10
  * Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
11
  * Author: Facebook
12
  * Author URI: https://www.facebook.com/
13
- * Version: 2.1.3
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 4.6.1
10
  * Description: Grow your business on Facebook! Use this official plugin to help sell more of your products using Facebook. After completing the setup, you'll be ready to create ads that promote your products and you can also create a shop section on your Page where customers can browse your products on Facebook.
11
  * Author: Facebook
12
  * Author URI: https://www.facebook.com/
13
+ * Version: 2.1.4
14
  * Text Domain: facebook-for-woocommerce
15
  * WC requires at least: 3.5.0
16
  * WC tested up to: 4.6.1
i18n/languages/facebook-for-woocommerce.pot CHANGED
@@ -2,10 +2,10 @@
2
  # This file is distributed under the same license as the Facebook for WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: Facebook for WooCommerce 2.1.3\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
- "POT-Creation-Date: 2020-10-29 16:47:00+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
2
  # This file is distributed under the same license as the Facebook for WooCommerce package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Facebook for WooCommerce 2.1.4\n"
6
  "Report-Msgid-Bugs-To: "
7
  "https://woocommerce.com/my-account/marketplace-ticket-form/\n"
8
+ "POT-Creation-Date: 2020-11-05 00:23:56+00:00\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=utf-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
includes/Products.php CHANGED
@@ -1088,6 +1088,11 @@ class Products {
1088
  */
1089
  public static function get_available_product_attributes( \WC_Product $product ) {
1090
 
 
 
 
 
 
1091
  return $product->get_attributes();
1092
  }
1093
 
@@ -1111,9 +1116,17 @@ class Products {
1111
 
1112
  if ( empty( $value ) ) {
1113
  // Check normal product attributes
1114
- foreach ( self::get_available_product_attributes( $product ) as $slug => $attribute ) {
1115
- if ( strtolower( $attribute->get_name() ) === $key ) {
1116
- $value = $product->get_attribute( $slug );
 
 
 
 
 
 
 
 
1117
  break;
1118
  }
1119
  }
1088
  */
1089
  public static function get_available_product_attributes( \WC_Product $product ) {
1090
 
1091
+ if ( $product->is_type( 'variation' ) ) {
1092
+ $parent_product = wc_get_product( $product->get_parent_id() );
1093
+ return $parent_product instanceof \WC_Product ? self::get_available_product_attributes( $parent_product ) : array();
1094
+ }
1095
+
1096
  return $product->get_attributes();
1097
  }
1098
 
1116
 
1117
  if ( empty( $value ) ) {
1118
  // Check normal product attributes
1119
+ foreach ( $product->get_attributes() as $slug => $attribute ) {
1120
+ if ( $product->is_type( 'variation' ) ) {
1121
+ $attr_name = $slug;
1122
+ $attr_val = $attribute;
1123
+ } else {
1124
+ $attr_name = $attribute->get_name();
1125
+ $attr_val = $product->get_attribute( $slug );
1126
+ }
1127
+
1128
+ if ( strtolower( $attr_name ) === $key ) {
1129
+ $value = $attr_val;
1130
  break;
1131
  }
1132
  }
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: facebook, automattic, woothemes
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
- Tested up to: 5.5.1
6
- Stable tag: 2.1.3
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
@@ -39,6 +39,9 @@ When opening a bug on GitHub, please give us as many details as possible.
39
 
40
  == Changelog ==
41
 
 
 
 
42
  = 2020.10.29 - version 2.1.3 =
43
  * Fix - Prevent error triggered while trying to refund orders
44
 
2
  Contributors: facebook, automattic, woothemes
3
  Tags: facebook, shop, catalog, advertise, pixel, product
4
  Requires at least: 4.4
5
+ Tested up to: 5.5.3
6
+ Stable tag: 2.1.4
7
  Requires PHP: 5.6 or greater
8
  MySQL: 5.6 or greater
9
  License: GPLv2 or later
39
 
40
  == Changelog ==
41
 
42
+ = 2020.11.04 - version 2.1.4
43
+ * Fix - Ensure product variant attributes are correctly handled when checking for enhanced attribute values.
44
+
45
  = 2020.10.29 - version 2.1.3 =
46
  * Fix - Prevent error triggered while trying to refund orders
47