Woocommerce 3.6.1 updates

This commit is contained in:
Chris Bibby 2019-04-20 09:45:02 +08:00
parent 89f250974d
commit 1fe315cfa2
6 changed files with 35 additions and 32 deletions

View File

@ -11,9 +11,8 @@
* the readme will list any important changes. * the readme will list any important changes.
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.3.0 * @version 3.6.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -36,7 +35,7 @@ if ( is_user_logged_in() ) {
<input type="text" class="input-text form-control" name="username" id="username" autocomplete="username" /> <input type="text" class="input-text form-control" name="username" id="username" autocomplete="username" />
</p> </p>
<p class="form-row form-row-last"> <p class="form-row form-row-last">
<label for="password"><?php esc_html_e( 'Password', 'understrap' ); ?>&nbsp<span class="required">*</span></label> <label for="password"><?php esc_html_e( 'Password', 'understrap' ); ?>&nbsp;<span class="required">*</span></label>
<input class="input-text form-control" type="password" name="password" id="password" autocomplete="current-password" /> <input class="input-text form-control" type="password" name="password" id="password" autocomplete="current-password" />
</p> </p>
<div class="clear"></div> <div class="clear"></div>
@ -44,12 +43,13 @@ if ( is_user_logged_in() ) {
<?php do_action( 'woocommerce_login_form' ); ?> <?php do_action( 'woocommerce_login_form' ); ?>
<p class="form-row"> <p class="form-row">
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox">
<button type="submit" class="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Login', 'understrap' ); ?>"><?php esc_html_e( 'Login', 'understrap' ); ?></button>
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" />
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox inline">
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'understrap' ); ?></span> <input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'understrap' ); ?></span>
</label> </label>
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
<input type="hidden" name="redirect" value="<?php echo esc_url( $redirect ) ?>" />
<button type="submit" class="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Login', 'understrap' ); ?>"><?php esc_html_e( 'Login', 'understrap' ); ?></button>
</p> </p>
<p class="lost_password"> <p class="lost_password">
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'understrap' ); ?></a> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'understrap' ); ?></a>

View File

@ -12,7 +12,7 @@
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.4.0 * @version 3.6.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -25,10 +25,10 @@ if ( $max_value && $min_value === $max_value ) {
<?php <?php
} else { } else {
/* translators: %s: Quantity. */ /* translators: %s: Quantity. */
$labelledby = ! empty( $args['product_name'] ) ? sprintf( __( '%s quantity', 'understrap' ), strip_tags( $args['product_name'] ) ) : ''; $label = ! empty( $args['product_name'] ) ? sprintf( __( '%s quantity', 'understrap' ), wp_strip_all_tags( $args['product_name'] ) ) : __( 'Quantity', 'understrap' );
?> ?>
<div class="quantity"> <div class="quantity">
<label class="sr-only" for="<?php echo esc_attr( $input_id ); ?>"><?php esc_html_e( 'Quantity', 'understrap' ); ?></label> <label class="sr-only" for="<?php echo esc_attr( $input_id ); ?>"><?php echo esc_attr( $label ); ?></label>
<input <input
type="number" type="number"
id="<?php echo esc_attr( $input_id ); ?>" id="<?php echo esc_attr( $input_id ); ?>"
@ -40,9 +40,7 @@ if ( $max_value && $min_value === $max_value ) {
value="<?php echo esc_attr( $input_value ); ?>" value="<?php echo esc_attr( $input_value ); ?>"
title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'understrap' ); ?>" title="<?php echo esc_attr_x( 'Qty', 'Product quantity input tooltip', 'understrap' ); ?>"
size="4" size="4"
pattern="<?php echo esc_attr( $pattern ); ?>" inputmode="<?php echo esc_attr( $inputmode ); ?>" />
inputmode="<?php echo esc_attr( $inputmode ); ?>"
aria-labelledby="<?php echo esc_attr( $labelledby ); ?>" />
</div> </div>
<?php <?php
} }

View File

@ -11,9 +11,8 @@
* the readme will list any important changes. * the readme will list any important changes.
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.3.0 * @version 3.6.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -22,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
?> ?>
<form class="woocommerce-ordering" method="get"> <form class="woocommerce-ordering" method="get">
<select name="orderby" class="orderby custom-select"> <select name="orderby" class="orderby custom-select" aria-label="<?php esc_attr_e( 'Shop order', 'understrap' ); ?>">
<?php foreach ( $catalog_orderby_options as $id => $name ) : ?> <?php foreach ( $catalog_orderby_options as $id => $name ) : ?>
<option value="<?php echo esc_attr( $id ); ?>" <?php selected( $orderby, $id ); ?>><?php echo esc_html( $name ); ?></option> <option value="<?php echo esc_attr( $id ); ?>" <?php selected( $orderby, $id ); ?>><?php echo esc_html( $name ); ?></option>
<?php endforeach; ?> <?php endforeach; ?>

View File

@ -12,7 +12,7 @@
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.4.0 * @version 3.6.0
*/ */
defined( 'ABSPATH' ) || exit; defined( 'ABSPATH' ) || exit;
@ -35,9 +35,6 @@ do_action( 'woocommerce_before_edit_account_address_form' ); ?>
<div class="woocommerce-address-fields__field-wrapper"> <div class="woocommerce-address-fields__field-wrapper">
<?php <?php
foreach ( $address as $key => $field ) { foreach ( $address as $key => $field ) {
if ( isset( $field['country_field'], $address[ $field['country_field'] ] ) ) {
$field['country'] = wc_get_post_data_by_key( $field['country_field'], $address[ $field['country_field'] ]['value'] );
}
woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) ); woocommerce_form_field( $key, $field, wc_get_post_data_by_key( $key, $field['value'] ) );
} }
?> ?>

View File

@ -12,7 +12,7 @@
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.5.1 * @version 3.6.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
@ -21,7 +21,7 @@ if ( ! defined( 'ABSPATH' ) ) {
do_action( 'woocommerce_before_customer_login_form' ); ?> do_action( 'woocommerce_before_customer_login_form' ); ?>
<?php if ( get_option( 'woocommerce_enable_myaccount_registration' ) === 'yes' ) : ?> <?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?>
<div class="u-columns col2-set row" id="customer_login"> <div class="u-columns col2-set row" id="customer_login">
@ -47,11 +47,12 @@ do_action( 'woocommerce_before_customer_login_form' ); ?>
<?php do_action( 'woocommerce_login_form' ); ?> <?php do_action( 'woocommerce_login_form' ); ?>
<p class="form-row"> <p class="form-row">
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?> <label class="woocommerce-form__label woocommerce-form__label-for-checkbox woocommerce-form-login__rememberme">
<button type="submit" class="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Log in', 'understrap' ); ?>"><?php esc_html_e( 'Log in', 'understrap' ); ?></button>
<label class="woocommerce-form__label woocommerce-form__label-for-checkbox inline">
<input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'understrap' ); ?></span> <input class="woocommerce-form__input woocommerce-form__input-checkbox" name="rememberme" type="checkbox" id="rememberme" value="forever" /> <span><?php esc_html_e( 'Remember me', 'understrap' ); ?></span>
</label> </label>
<?php wp_nonce_field( 'woocommerce-login', 'woocommerce-login-nonce' ); ?>
<button type="submit" class="btn btn-outline-primary" name="login" value="<?php esc_attr_e( 'Log in', 'understrap' ); ?>"><?php esc_html_e( 'Log in', 'understrap' ); ?></button>
</p> </p>
<p class="woocommerce-LostPassword lost_password"> <p class="woocommerce-LostPassword lost_password">
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'understrap' ); ?></a> <a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php esc_html_e( 'Lost your password?', 'understrap' ); ?></a>
@ -61,7 +62,8 @@ do_action( 'woocommerce_before_customer_login_form' ); ?>
</form> </form>
<?php if ( get_option( 'woocommerce_enable_myaccount_registration' ) === 'yes' ) : ?> <?php if ( 'yes' === get_option( 'woocommerce_enable_myaccount_registration' ) ) : ?>
</div> </div>
@ -94,6 +96,10 @@ do_action( 'woocommerce_before_customer_login_form' ); ?>
<input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" autocomplete="new-password" /> <input type="password" class="woocommerce-Input woocommerce-Input--text input-text" name="password" id="reg_password" autocomplete="new-password" />
</p> </p>
<?php else : ?>
<p><?php esc_html_e( 'A password will be sent to your email address.', 'understrap' ); ?></p>
<?php endif; ?> <?php endif; ?>
<?php do_action( 'woocommerce_register_form' ); ?> <?php do_action( 'woocommerce_register_form' ); ?>

View File

@ -11,18 +11,17 @@
* the readme will list any important changes. * the readme will list any important changes.
* *
* @see https://docs.woocommerce.com/document/template-structure/ * @see https://docs.woocommerce.com/document/template-structure/
* @author WooThemes
* @package WooCommerce/Templates * @package WooCommerce/Templates
* @version 3.1.0 * @version 3.6.0
*/ */
if ( ! defined( 'ABSPATH' ) ) { if ( ! defined( 'ABSPATH' ) ) {
exit; // Exit if accessed directly exit; // Exit if accessed directly.
} }
global $product; global $product;
if ( 'no' === get_option( 'woocommerce_enable_review_rating' ) ) { if ( ! wc_review_ratings_enabled() ) {
return; return;
} }
@ -33,8 +32,12 @@ $average = $product->get_average_rating();
if ( $rating_count > 0 ) : ?> if ( $rating_count > 0 ) : ?>
<div class="woocommerce-product-rating"> <div class="woocommerce-product-rating">
<?php echo wc_get_rating_html( $average, $rating_count ); ?> <?php echo wc_get_rating_html( $average, $rating_count ); // WPCS: XSS ok. ?>
<?php if ( comments_open() ) : ?><a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'understrap' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a><?php endif ?> <?php if ( comments_open() ) : ?>
<?php //phpcs:disable ?>
<a href="#reviews" class="woocommerce-review-link" rel="nofollow">(<?php printf( _n( '%s customer review', '%s customer reviews', $review_count, 'understrap' ), '<span class="count">' . esc_html( $review_count ) . '</span>' ); ?>)</a>
<?php // phpcs:enable ?>
<?php endif ?>
</div> </div>
<?php endif; ?> <?php endif; ?>