WooCommerce Services - Version 1.10.1

Version Description

  • Fix bug with product variation names in Packaging description
Download this release

Release Info

Developer woothemes
Plugin Icon 128x128 WooCommerce Services
Version 1.10.1
Comparing to
See all releases

Code changes from version 1.10.0 to 1.10.1

classes/class-wc-connect-compatibility-wc26.php CHANGED
@@ -93,5 +93,16 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC26' ) ) {
93
  /* translators: %d: Deleted Product ID */
94
  return sprintf( __( '#%d - [Deleted product]', 'woocommerce-services' ), $product_id );
95
  }
 
 
 
 
 
 
 
 
 
 
 
96
  }
97
  }
93
  /* translators: %d: Deleted Product ID */
94
  return sprintf( __( '#%d - [Deleted product]', 'woocommerce-services' ), $product_id );
95
  }
96
+
97
+ /**
98
+ * For a given product, return it's name. In supported versions, variable
99
+ * products will include their attributes.
100
+ *
101
+ * @param WC_Product $product Product (variable, simple, etc)
102
+ * @return string The product (or variation) name, ready to print
103
+ */
104
+ public function get_product_name( WC_Product $product ) {
105
+ return $product->get_title();
106
+ }
107
  }
108
  }
classes/class-wc-connect-compatibility-wc30.php CHANGED
@@ -107,6 +107,17 @@ if ( ! class_exists( 'WC_Connect_Compatibility_WC30' ) ) {
107
  /* translators: %d: Deleted Product ID */
108
  return sprintf( __( '#%d - [Deleted product]', 'woocommerce-services' ), $product_id );
109
  }
 
 
 
 
 
 
 
 
 
 
 
110
  }
111
 
112
  }
107
  /* translators: %d: Deleted Product ID */
108
  return sprintf( __( '#%d - [Deleted product]', 'woocommerce-services' ), $product_id );
109
  }
110
+
111
+ /**
112
+ * For a given product, return it's name. In supported versions, variable
113
+ * products will include their attributes.
114
+ *
115
+ * @param WC_Product $product Product (variable, simple, etc)
116
+ * @return string The product (or variation) name, ready to print
117
+ */
118
+ public function get_product_name( WC_Product $product ) {
119
+ return $product->get_name();
120
+ }
121
  }
122
 
123
  }
classes/class-wc-connect-compatibility.php CHANGED
@@ -110,6 +110,15 @@ if ( ! class_exists( 'WC_Connect_Compatibility' ) ) {
110
  * @return string The product (or variation) name, ready to print
111
  */
112
  abstract public function get_product_name_from_order( $product_id, $order );
 
 
 
 
 
 
 
 
 
113
  }
114
 
115
  }
110
  * @return string The product (or variation) name, ready to print
111
  */
112
  abstract public function get_product_name_from_order( $product_id, $order );
113
+
114
+ /**
115
+ * For a given product, return it's name. In supported versions, variable
116
+ * products will include their attributes.
117
+ *
118
+ * @param WC_Product $product Product (variable, simple, etc)
119
+ * @return string The product (or variation) name, ready to print
120
+ */
121
+ abstract public function get_product_name( WC_Product $product );
122
  }
123
 
124
  }
classes/class-wc-connect-shipping-method.php CHANGED
@@ -230,7 +230,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
230
 
231
  private function lookup_product( $package, $product_id ) {
232
  foreach ( $package[ 'contents' ] as $item ) {
233
- if ( $item[ 'product_id' ] === $product_id ) {
234
  return $item[ 'data' ];
235
  }
236
  }
@@ -340,7 +340,7 @@ if ( ! class_exists( 'WC_Connect_Shipping_Method' ) ) {
340
  /** @var WC_Product $product */
341
  $product = $this->lookup_product( $package, $package_item->product_id );
342
  if ( $product ) {
343
- $items[] = $product->get_title();
344
  }
345
  }
346
 
230
 
231
  private function lookup_product( $package, $product_id ) {
232
  foreach ( $package[ 'contents' ] as $item ) {
233
+ if ( $item[ 'product_id' ] === $product_id || $item[ 'variation_id' ] === $product_id ) {
234
  return $item[ 'data' ];
235
  }
236
  }
340
  /** @var WC_Product $product */
341
  $product = $this->lookup_product( $package, $package_item->product_id );
342
  if ( $product ) {
343
+ $items[] = WC_Connect_Compatibility::instance()->get_product_name( $product );
344
  }
345
  }
346
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic, woothemes, allendav, kellychoffman, jkudish, jeffstiel
3
  Tags: canada-post, shipping, stamps, usps, woocommerce, taxes, payment, stripe
4
  Requires at least: 4.6
5
  Tested up to: 4.9.1
6
- Stable tag: 1.10.0
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -89,6 +89,9 @@ The source code is freely available [in GitHub](https://github.com/Automattic/wo
89
 
90
  == Changelog ==
91
 
 
 
 
92
  = 1.10.0 =
93
  * Add WooCommerce compatibility to plugin header
94
  * Add ability to refresh server schemas from status page
3
  Tags: canada-post, shipping, stamps, usps, woocommerce, taxes, payment, stripe
4
  Requires at least: 4.6
5
  Tested up to: 4.9.1
6
+ Stable tag: 1.10.1
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
89
 
90
  == Changelog ==
91
 
92
+ = 1.10.1 =
93
+ * Fix bug with product variation names in Packaging description
94
+
95
  = 1.10.0 =
96
  * Add WooCommerce compatibility to plugin header
97
  * Add ability to refresh server schemas from status page
woocommerce-services.php CHANGED
@@ -7,7 +7,7 @@
7
  * Author URI: https://woocommerce.com/
8
  * Text Domain: woocommerce-services
9
  * Domain Path: /i18n/languages/
10
- * Version: 1.10.0
11
  * WC requires at least: 2.6.0
12
  * WC tested up to: 3.2.6
13
  *
7
  * Author URI: https://woocommerce.com/
8
  * Text Domain: woocommerce-services
9
  * Domain Path: /i18n/languages/
10
+ * Version: 1.10.1
11
  * WC requires at least: 2.6.0
12
  * WC tested up to: 3.2.6
13
  *