Merge pull request #4 from woothemes/master

sync
This commit is contained in:
Aristeides Stathopoulos 2016-09-09 03:17:28 +03:00 committed by GitHub
commit 7a509f53d4
8 changed files with 20 additions and 13 deletions

View File

@ -332,7 +332,7 @@ jQuery( function( $ ) {
wc_checkout_form.init_payment_methods( selectedPaymentMethod );
// Fire updated_checkout e
$( document.body ).trigger( 'updated_checkout' );
$( document.body ).trigger( 'updated_checkout', [ data ] );
}
});

File diff suppressed because one or more lines are too long

View File

@ -961,8 +961,9 @@ class WC_Product {
}
$price_display_suffix = get_option( 'woocommerce_price_display_suffix' );
$woocommerce_calc_taxes = get_option( 'woocommerce_calc_taxes', 'no' );
if ( $price_display_suffix ) {
if ( $price_display_suffix && 'yes' === $woocommerce_calc_taxes ) {
$price_display_suffix = ' <small class="woocommerce-price-suffix">' . $price_display_suffix . '</small>';
@ -977,6 +978,8 @@ class WC_Product {
);
$price_display_suffix = str_replace( $find, $replace, $price_display_suffix );
} else {
$price_display_suffix = '';
}
return apply_filters( 'woocommerce_get_price_suffix', $price_display_suffix, $this );

View File

@ -406,7 +406,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
} else {
$attributes[] = array(
'id' => 0,
'name' => str_replace( 'pa_', '', $name ),
'name' => $name,
'option' => $attribute,
);
}
@ -425,7 +425,7 @@ class WC_REST_Products_Controller extends WC_REST_Posts_Controller {
} else {
$attributes[] = array(
'id' => 0,
'name' => str_replace( 'pa_', '', $attribute['name'] ),
'name' => $attribute['name'],
'position' => (int) $attribute['position'],
'visible' => (bool) $attribute['is_visible'],
'variation' => (bool) $attribute['is_variation'],

View File

@ -236,10 +236,13 @@ class WC_Comments {
* @param int $post_id
*/
public static function clear_transients( $post_id ) {
delete_post_meta( $post_id, '_wc_average_rating' );
delete_post_meta( $post_id, '_wc_rating_count' );
delete_post_meta( $post_id, '_wc_review_count' );
WC_Product::sync_average_rating( $post_id );
if ( 'product' === get_post_type( $post_id ) ) {
delete_post_meta( $post_id, '_wc_average_rating' );
delete_post_meta( $post_id, '_wc_rating_count' );
delete_post_meta( $post_id, '_wc_review_count' );
WC_Product::sync_average_rating( $post_id );
}
}
/**

View File

@ -925,6 +925,7 @@ class WC_Form_Handler {
}
} catch ( Exception $e ) {
wc_add_notice( apply_filters( 'login_errors', $e->getMessage() ), 'error' );
do_action( 'woocommerce_login_failed' );
}
}
}

View File

@ -100,7 +100,7 @@ class WC_Shortcodes {
if ( $products->have_posts() ) {
?>
<?php do_action( "woocommerce_shortcode_before_{$loop_name}_loop" ); ?>
<?php do_action( "woocommerce_shortcode_before_{$loop_name}_loop", $atts ); ?>
<?php woocommerce_product_loop_start(); ?>
@ -112,11 +112,11 @@ class WC_Shortcodes {
<?php woocommerce_product_loop_end(); ?>
<?php do_action( "woocommerce_shortcode_after_{$loop_name}_loop" ); ?>
<?php do_action( "woocommerce_shortcode_after_{$loop_name}_loop", $atts ); ?>
<?php
} else {
do_action( "woocommerce_shortcode_{$loop_name}_loop_no_results" );
do_action( "woocommerce_shortcode_{$loop_name}_loop_no_results", $atts );
}
woocommerce_reset_loop();

View File

@ -4,7 +4,7 @@
*
* Shows the first intro screen on the account dashboard.
*
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/my-account-dashboard.php.
* This template can be overridden by copying it to yourtheme/woocommerce/myaccount/dashboard.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to