@@ 904-906 (lines=3) @@ | ||
901 | $validation_error = new WP_Error(); |
|
902 | $validation_error = apply_filters( 'woocommerce_ajax_add_order_item_validation', $validation_error, $product, $order, $qty ); |
|
903 | ||
904 | if ( $validation_error->get_error_code() ) { |
|
905 | throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . $validation_error->get_error_message() ); |
|
906 | } |
|
907 | $item_id = $order->add_product( $product, $qty ); |
|
908 | $item = apply_filters( 'woocommerce_ajax_order_item', $order->get_item( $item_id ), $item_id, $order, $product ); |
|
909 | $added_items[ $item_id ] = $item; |
@@ 971-973 (lines=3) @@ | ||
968 | $validation_error = new WP_Error(); |
|
969 | $validation_error = apply_filters( 'woocommerce_process_login_errors', $validation_error, $creds['user_login'], $creds['user_password'] ); |
|
970 | ||
971 | if ( $validation_error->get_error_code() ) { |
|
972 | throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . $validation_error->get_error_message() ); |
|
973 | } |
|
974 | ||
975 | if ( empty( $creds['user_login'] ) ) { |
|
976 | throw new Exception( '<strong>' . __( 'Error:', 'woocommerce' ) . '</strong> ' . __( 'Username is required.', 'woocommerce' ) ); |