WooCommerce - Version 4.7.1-beta.1

Version Description

Download this release

Release Info

Developer claudiosanches
Plugin Icon 128x128 WooCommerce
Version 4.7.1-beta.1
Comparing to
See all releases

Code changes from version 4.7.0 to 4.7.1-beta.1

i18n/languages/woocommerce.pot CHANGED
@@ -2,14 +2,14 @@
2
  # This file is distributed under the same license as the WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: WooCommerce 4.7.0\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "POT-Creation-Date: 2020-11-10T18:01:54-03:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woocommerce\n"
@@ -18405,10 +18405,15 @@ msgstr ""
18405
  msgid "Please choose a product to add to your cart&hellip;"
18406
  msgstr ""
18407
 
18408
- #: includes/class-wc-form-handler.php:932
18409
- #: includes/class-wc-form-handler.php:936
18410
- #: includes/class-wc-form-handler.php:1071
18411
- #: includes/class-wc-form-handler.php:1105
 
 
 
 
 
18412
  #: packages/woocommerce-blocks/assets/js/base/components/block-error-boundary/block-error.js:16
18413
  #: packages/woocommerce-blocks/build/active-filters-frontend.js:1
18414
  #: packages/woocommerce-blocks/build/all-products-frontend.js:6
@@ -18424,23 +18429,23 @@ msgstr ""
18424
  msgid "Error:"
18425
  msgstr ""
18426
 
18427
- #: includes/class-wc-form-handler.php:936
18428
  msgid "Username is required."
18429
  msgstr ""
18430
 
18431
- #: includes/class-wc-form-handler.php:1024
18432
  msgid "Please enter your password."
18433
  msgstr ""
18434
 
18435
- #: includes/class-wc-form-handler.php:1028
18436
  msgid "Passwords do not match."
18437
  msgstr ""
18438
 
18439
- #: includes/class-wc-form-handler.php:1083
18440
  msgid "Your account was created successfully and a password has been sent to your email address."
18441
  msgstr ""
18442
 
18443
- #: includes/class-wc-form-handler.php:1085
18444
  msgid "Your account was created successfully. Your login details have been sent to your email address."
18445
  msgstr ""
18446
 
2
  # This file is distributed under the same license as the WooCommerce plugin.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: WooCommerce 4.7.1-beta.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce\n"
7
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
8
  "Language-Team: LANGUAGE <LL@li.org>\n"
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
+ "POT-Creation-Date: 2020-11-11T21:04:14-03:00\n"
13
  "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
14
  "X-Generator: WP-CLI 2.4.0\n"
15
  "X-Domain: woocommerce\n"
18405
  msgid "Please choose a product to add to your cart&hellip;"
18406
  msgstr ""
18407
 
18408
+ #. translators: 1: product link, 2: product name
18409
+ #: includes/class-wc-form-handler.php:911
18410
+ msgid "Please choose product options by visiting <a href=\"%1$s\" title=\"%2$s\">%2$s</a>."
18411
+ msgstr ""
18412
+
18413
+ #: includes/class-wc-form-handler.php:946
18414
+ #: includes/class-wc-form-handler.php:950
18415
+ #: includes/class-wc-form-handler.php:1085
18416
+ #: includes/class-wc-form-handler.php:1119
18417
  #: packages/woocommerce-blocks/assets/js/base/components/block-error-boundary/block-error.js:16
18418
  #: packages/woocommerce-blocks/build/active-filters-frontend.js:1
18419
  #: packages/woocommerce-blocks/build/all-products-frontend.js:6
18429
  msgid "Error:"
18430
  msgstr ""
18431
 
18432
+ #: includes/class-wc-form-handler.php:950
18433
  msgid "Username is required."
18434
  msgstr ""
18435
 
18436
+ #: includes/class-wc-form-handler.php:1038
18437
  msgid "Please enter your password."
18438
  msgstr ""
18439
 
18440
+ #: includes/class-wc-form-handler.php:1042
18441
  msgid "Passwords do not match."
18442
  msgstr ""
18443
 
18444
+ #: includes/class-wc-form-handler.php:1097
18445
  msgid "Your account was created successfully and a password has been sent to your email address."
18446
  msgstr ""
18447
 
18448
+ #: includes/class-wc-form-handler.php:1099
18449
  msgid "Your account was created successfully. Your login details have been sent to your email address."
18450
  msgstr ""
18451
 
includes/class-wc-form-handler.php CHANGED
@@ -885,10 +885,12 @@ class WC_Form_Handler {
885
  * @return bool success or not
886
  */
887
  private static function add_to_cart_handler_variable( $product_id ) {
888
- $variation_id = empty( $_REQUEST['variation_id'] ) ? '' : absint( wp_unslash( $_REQUEST['variation_id'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
889
- $quantity = empty( $_REQUEST['quantity'] ) ? 1 : wc_stock_amount( wp_unslash( $_REQUEST['quantity'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
890
  $variations = array();
891
 
 
 
892
  foreach ( $_REQUEST as $key => $value ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
893
  if ( 'attribute_' !== substr( $key, 0, 10 ) ) {
894
  continue;
@@ -899,7 +901,19 @@ class WC_Form_Handler {
899
 
900
  $passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variations );
901
 
902
- if ( $passed_validation && false !== WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variations ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
903
  wc_add_to_cart_message( array( $product_id => $quantity ), true );
904
  return true;
905
  }
885
  * @return bool success or not
886
  */
887
  private static function add_to_cart_handler_variable( $product_id ) {
888
+ $variation_id = empty( $_REQUEST['variation_id'] ) ? '' : absint( wp_unslash( $_REQUEST['variation_id'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
889
+ $quantity = empty( $_REQUEST['quantity'] ) ? 1 : wc_stock_amount( wp_unslash( $_REQUEST['quantity'] ) ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended
890
  $variations = array();
891
 
892
+ $product = wc_get_product( $product_id );
893
+
894
  foreach ( $_REQUEST as $key => $value ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended
895
  if ( 'attribute_' !== substr( $key, 0, 10 ) ) {
896
  continue;
901
 
902
  $passed_validation = apply_filters( 'woocommerce_add_to_cart_validation', true, $product_id, $quantity, $variation_id, $variations );
903
 
904
+ if ( ! $passed_validation ) {
905
+ return false;
906
+ }
907
+
908
+ // Prevent parent variable product from being added to cart.
909
+ if ( empty( $variation_id ) && $product && $product->is_type( 'variable' ) ) {
910
+ /* translators: 1: product link, 2: product name */
911
+ wc_add_notice( sprintf( __( 'Please choose product options by visiting <a href="%1$s" title="%2$s">%2$s</a>.', 'woocommerce' ), esc_url( get_permalink( $product_id ) ), esc_html( $product->get_name() ) ), 'error' );
912
+
913
+ return false;
914
+ }
915
+
916
+ if ( false !== WC()->cart->add_to_cart( $product_id, $quantity, $variation_id, $variations ) ) {
917
  wc_add_to_cart_message( array( $product_id => $quantity ), true );
918
  return true;
919
  }
includes/class-wc-shortcodes.php CHANGED
@@ -220,7 +220,7 @@ class WC_Shortcodes {
220
 
221
  foreach ( $product_categories as $category ) {
222
  wc_get_template(
223
- 'content-product_cat.php',
224
  array(
225
  'category' => $category,
226
  )
220
 
221
  foreach ( $product_categories as $category ) {
222
  wc_get_template(
223
+ 'content-product-cat.php',
224
  array(
225
  'category' => $category,
226
  )
includes/class-woocommerce.php CHANGED
@@ -22,7 +22,7 @@ final class WooCommerce {
22
  *
23
  * @var string
24
  */
25
- public $version = '4.7.0';
26
 
27
  /**
28
  * WooCommerce Schema version.
22
  *
23
  * @var string
24
  */
25
+ public $version = '4.7.1';
26
 
27
  /**
28
  * WooCommerce Schema version.
includes/wc-template-functions.php CHANGED
@@ -2491,7 +2491,7 @@ if ( ! function_exists( 'woocommerce_output_product_categories' ) ) {
2491
 
2492
  foreach ( $product_categories as $category ) {
2493
  wc_get_template(
2494
- 'content-product_cat.php',
2495
  array(
2496
  'category' => $category,
2497
  )
2491
 
2492
  foreach ( $product_categories as $category ) {
2493
  wc_get_template(
2494
+ 'content-product-cat.php',
2495
  array(
2496
  'category' => $category,
2497
  )
readme.txt CHANGED
@@ -160,6 +160,13 @@ WooCommerce comes with some sample data you can use to see how products look; im
160
 
161
  == Changelog ==
162
 
 
 
 
 
 
 
 
163
  = 4.7.0 - 2020-11-10 =
164
 
165
  **WooCommerce**
160
 
161
  == Changelog ==
162
 
163
+ = 4.7.1 - 2020-11-xx =
164
+
165
+ **WooCommerce**
166
+
167
+ * Fix - Prevent variable product to be added to cart until a valid variation is selected first. #28103
168
+ * Fix - Load product category page and shortcode content with `content-product-cat.php`. #28233
169
+
170
  = 4.7.0 - 2020-11-10 =
171
 
172
  **WooCommerce**
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
- return ComposerAutoloaderInit68241c79afd28a691b9f21faf332c0b3::getLoader();
4
 
5
  require_once __DIR__ . '/composer/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit2c29c03b4afeb28d5d31915e57f2421a::getLoader();
vendor/autoload_packages.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/class-autoloader-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/class-classes-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/class-files-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/class-plugins-handler.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/class-version-selector.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInit68241c79afd28a691b9f21faf332c0b3
6
  {
7
  private static $loader;
8
 
@@ -22,15 +22,15 @@ class ComposerAutoloaderInit68241c79afd28a691b9f21faf332c0b3
22
  return self::$loader;
23
  }
24
 
25
- spl_autoload_register(array('ComposerAutoloaderInit68241c79afd28a691b9f21faf332c0b3', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
- spl_autoload_unregister(array('ComposerAutoloaderInit68241c79afd28a691b9f21faf332c0b3', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
- call_user_func(\Composer\Autoload\ComposerStaticInit68241c79afd28a691b9f21faf332c0b3::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit2c29c03b4afeb28d5d31915e57f2421a
6
  {
7
  private static $loader;
8
 
22
  return self::$loader;
23
  }
24
 
25
+ spl_autoload_register(array('ComposerAutoloaderInit2c29c03b4afeb28d5d31915e57f2421a', 'loadClassLoader'), true, true);
26
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
27
+ spl_autoload_unregister(array('ComposerAutoloaderInit2c29c03b4afeb28d5d31915e57f2421a', 'loadClassLoader'));
28
 
29
  $useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
30
  if ($useStaticLoader) {
31
  require_once __DIR__ . '/autoload_static.php';
32
 
33
+ call_user_func(\Composer\Autoload\ComposerStaticInit2c29c03b4afeb28d5d31915e57f2421a::getInitializer($loader));
34
  } else {
35
  $map = require __DIR__ . '/autoload_namespaces.php';
36
  foreach ($map as $namespace => $path) {
vendor/composer/autoload_static.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  namespace Composer\Autoload;
6
 
7
- class ComposerStaticInit68241c79afd28a691b9f21faf332c0b3
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
@@ -209,9 +209,9 @@ class ComposerStaticInit68241c79afd28a691b9f21faf332c0b3
209
  public static function getInitializer(ClassLoader $loader)
210
  {
211
  return \Closure::bind(function () use ($loader) {
212
- $loader->prefixLengthsPsr4 = ComposerStaticInit68241c79afd28a691b9f21faf332c0b3::$prefixLengthsPsr4;
213
- $loader->prefixDirsPsr4 = ComposerStaticInit68241c79afd28a691b9f21faf332c0b3::$prefixDirsPsr4;
214
- $loader->classMap = ComposerStaticInit68241c79afd28a691b9f21faf332c0b3::$classMap;
215
 
216
  }, null, ClassLoader::class);
217
  }
4
 
5
  namespace Composer\Autoload;
6
 
7
+ class ComposerStaticInit2c29c03b4afeb28d5d31915e57f2421a
8
  {
9
  public static $prefixLengthsPsr4 = array (
10
  'S' =>
209
  public static function getInitializer(ClassLoader $loader)
210
  {
211
  return \Closure::bind(function () use ($loader) {
212
+ $loader->prefixLengthsPsr4 = ComposerStaticInit2c29c03b4afeb28d5d31915e57f2421a::$prefixLengthsPsr4;
213
+ $loader->prefixDirsPsr4 = ComposerStaticInit2c29c03b4afeb28d5d31915e57f2421a::$prefixDirsPsr4;
214
+ $loader->classMap = ComposerStaticInit2c29c03b4afeb28d5d31915e57f2421a::$classMap;
215
 
216
  }, null, ClassLoader::class);
217
  }
vendor/jetpack-autoloader/autoload_functions.php CHANGED
@@ -5,7 +5,7 @@
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
- namespace Automattic\Jetpack\Autoloader\jp24a6cd966207dd699bcb2c85b28af7f3;
9
 
10
  // phpcs:ignore
11
 
5
  * @package automattic/jetpack-autoloader
6
  */
7
 
8
+ namespace Automattic\Jetpack\Autoloader\jp58362641a3e23883626f928955bb0969;
9
 
10
  // phpcs:ignore
11
 
woocommerce.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: WooCommerce
4
  * Plugin URI: https://woocommerce.com/
5
  * Description: An eCommerce toolkit that helps you sell anything. Beautifully.
6
- * Version: 4.7.0
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woocommerce
3
  * Plugin Name: WooCommerce
4
  * Plugin URI: https://woocommerce.com/
5
  * Description: An eCommerce toolkit that helps you sell anything. Beautifully.
6
+ * Version: 4.7.1-beta.1
7
  * Author: Automattic
8
  * Author URI: https://woocommerce.com
9
  * Text Domain: woocommerce