Resolve conflict with master branch

This commit is contained in:
Julia Amosova 2019-12-15 12:28:03 +00:00
commit f020e4b3df
11 changed files with 63 additions and 41 deletions

View File

@ -71,7 +71,7 @@ jQuery( function( $ ) {
var data = {};
$.each( $thisbutton.data(), function( key, value ) {
$.each( $thisbutton[0].dataset, function( key, value ) {
data[ key ] = value;
});

View File

@ -14,7 +14,7 @@
"woocommerce/woocommerce-rest-api": "1.0.4"
},
"require-dev": {
"phpunit/phpunit": "7.5.18",
"phpunit/phpunit": "^7.5.18",
"woocommerce/woocommerce-sniffs": "0.0.9"
},
"config": {

View File

@ -73,7 +73,7 @@ class WC_Admin_Setup_Wizard {
* @return boolean
*/
protected function should_show_theme() {
$support_woocommerce = current_theme_supports( 'woocommerce' ) && ! $this->is_default_theme();
$support_woocommerce = current_theme_supports( 'woocommerce' ) && ! wc_is_wp_default_theme_active();
return (
current_user_can( 'install_themes' ) &&
@ -83,27 +83,6 @@ class WC_Admin_Setup_Wizard {
);
}
/**
* Is the user using a default WP theme?
*
* @return boolean
*/
protected function is_default_theme() {
return wc_is_active_theme(
array(
'twentynineteen',
'twentyseventeen',
'twentysixteen',
'twentyfifteen',
'twentyfourteen',
'twentythirteen',
'twentyeleven',
'twentytwelve',
'twentyten',
)
);
}
/**
* The "automated tax" extra should only be shown if the current user can
* install plugins and the store is in a supported country.

View File

@ -527,6 +527,15 @@ class WC_Meta_Box_Product_Data {
WC_Admin_Meta_Boxes::add_error( $errors->get_error_message() );
}
/**
* Set variation props before save.
*
* @param object $variation WC_Product_Variation object.
* @param int $i
* @since 3.8.0
*/
do_action( 'woocommerce_admin_process_variation_object', $variation, $i );
$variation->save();
do_action( 'woocommerce_save_product_variation', $variation_id, $i );

View File

@ -478,7 +478,7 @@ final class WooCommerce {
* @since 3.3.0
*/
private function theme_support_includes() {
if ( wc_is_active_theme( array( 'twentytwenty', 'twentynineteen', 'twentyseventeen', 'twentysixteen', 'twentyfifteen', 'twentyfourteen', 'twentythirteen', 'twentyeleven', 'twentytwelve', 'twentyten' ) ) ) {
if ( wc_is_wp_default_theme_active() ) {
switch ( get_template() ) {
case 'twentyten':
include_once WC_ABSPATH . 'includes/theme-support/class-wc-twenty-ten.php';

View File

@ -153,7 +153,7 @@ class WC_Shortcode_Checkout {
$held_stock = ( $hold_stock_minutes > 0 ) ? wc_get_held_stock_quantity( $product, $order->get_id() ) : 0;
$required_stock = $quantities[ $product->get_stock_managed_by_id() ];
if ( $product->get_stock_quantity() < ( $held_stock + $required_stock ) ) {
if ( ! apply_filters( 'woocommerce_pay_order_product_has_enough_stock', ( $product->get_stock_quantity() >= ( $held_stock + $required_stock ) ), $product, $order ) ) {
/* translators: 1: product name 2: quantity in stock */
throw new Exception( sprintf( __( 'Sorry, we do not have enough "%1$s" in stock to fulfill your order (%2$s available). We apologize for any inconvenience caused.', 'woocommerce' ), $product->get_name(), wc_format_stock_quantity_for_display( $product->get_stock_quantity() - $held_stock, $product ) ) );
}

View File

@ -2143,6 +2143,28 @@ function wc_is_active_theme( $theme ) {
return is_array( $theme ) ? in_array( get_template(), $theme, true ) : get_template() === $theme;
}
/**
* Is the site using a default WP theme?
*
* @return boolean
*/
function wc_is_wp_default_theme_active() {
return wc_is_active_theme(
array(
'twentytwenty',
'twentynineteen',
'twentyseventeen',
'twentysixteen',
'twentyfifteen',
'twentyfourteen',
'twentythirteen',
'twentyeleven',
'twentytwelve',
'twentyten',
)
);
}
/**
* Cleans up session data - cron callback.
*

6
package-lock.json generated
View File

@ -8423,9 +8423,9 @@
}
},
"grunt-stylelint": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.12.0.tgz",
"integrity": "sha512-6ntxeja38tCZHg3xVgRzRm6taiCuAU9PwqsOdPFwXg1VOR+kx/d8tQvgO9Suf4ouo93zq4bYsMX/JOBJIYEJvw==",
"version": "0.13.0",
"resolved": "https://registry.npmjs.org/grunt-stylelint/-/grunt-stylelint-0.13.0.tgz",
"integrity": "sha512-Ju9N03UBvPwcdoJYL77pDk0k0E8VD4oYtTfoRwvvPM1ON2MjOXWwPyaeIoYPnhUwcfN9D7TaXnTtuhNoWNsyrQ==",
"dev": true,
"requires": {
"chalk": "^2.4.2"

View File

@ -51,7 +51,7 @@
"grunt-rtlcss": "2.0.2",
"grunt-sass": "3.1.0",
"grunt-shell": "3.0.1",
"grunt-stylelint": "0.12.0",
"grunt-stylelint": "0.13.0",
"grunt-wp-i18n": "1.0.3",
"husky": "3.1.0",
"istanbul": "1.0.0-alpha.2",

View File

@ -222,5 +222,7 @@ img {
text-transform: capitalize;
vertical-align: middle;
margin-<?php echo is_rtl() ? 'left' : 'right'; ?>: 10px;
max-width: 100%;
height: auto;
}
<?php

View File

@ -27,11 +27,17 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
<?php
$quantites_required = false;
$previous_post = $post;
$grouped_product_columns = apply_filters( 'woocommerce_grouped_product_columns', array(
'quantity',
'label',
'price',
), $product );
$grouped_product_columns = apply_filters(
'woocommerce_grouped_product_columns',
array(
'quantity',
'label',
'price',
),
$product
);
do_action( 'woocommerce_grouped_product_list_before', $grouped_product_columns, $quantites_required, $product );
foreach ( $grouped_products as $grouped_product_child ) {
$post_object = get_post( $grouped_product_child->get_id() );
@ -56,12 +62,14 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
} else {
do_action( 'woocommerce_before_add_to_cart_quantity' );
woocommerce_quantity_input( array(
'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']',
'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : 0, // WPCS: CSRF ok, input var okay, sanitization ok.
'min_value' => apply_filters( 'woocommerce_quantity_input_min', 0, $grouped_product_child ),
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ),
) );
woocommerce_quantity_input(
array(
'input_name' => 'quantity[' . $grouped_product_child->get_id() . ']',
'input_value' => isset( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ? wc_stock_amount( wc_clean( wp_unslash( $_POST['quantity'][ $grouped_product_child->get_id() ] ) ) ) : 0, // WPCS: CSRF ok, input var okay, sanitization ok.
'min_value' => apply_filters( 'woocommerce_quantity_input_min', 0, $grouped_product_child ),
'max_value' => apply_filters( 'woocommerce_quantity_input_max', $grouped_product_child->get_max_purchase_quantity(), $grouped_product_child ),
)
);
do_action( 'woocommerce_after_add_to_cart_quantity' );
}
@ -90,6 +98,8 @@ do_action( 'woocommerce_before_add_to_cart_form' ); ?>
}
$post = $previous_post; // WPCS: override ok.
setup_postdata( $post );
do_action( 'woocommerce_grouped_product_list_after', $grouped_product_columns, $quantites_required, $product );
?>
</tbody>
</table>