Only show T&C's notice if there is a valid T&Cs page

This commit is contained in:
Caleb Burks 2018-02-28 21:58:34 -05:00
parent 8bfb0a96d4
commit 0568470bb8
1 changed files with 1 additions and 1 deletions

View File

@ -693,7 +693,7 @@ class WC_Checkout {
$this->validate_posted_data( $data, $errors );
$this->check_cart_items();
if ( empty( $data['woocommerce_checkout_update_totals'] ) && empty( $data['terms'] ) && apply_filters( 'woocommerce_checkout_show_terms', wc_get_page_id( 'terms' ) > 0 ) ) {
if ( empty( $data['woocommerce_checkout_update_totals'] ) && ! empty( $_POST['terms-field'] ) && empty( $data['terms'] ) && apply_filters( 'woocommerce_checkout_show_terms', wc_get_page_id( 'terms' ) > 0 ) ) {
$errors->add( 'terms', __( 'You must accept our Terms & Conditions.', 'woocommerce' ) );
}