diff --git a/includes/class-wc-ajax.php b/includes/class-wc-ajax.php index 1dade2307b2..54a22f95e97 100644 --- a/includes/class-wc-ajax.php +++ b/includes/class-wc-ajax.php @@ -908,7 +908,7 @@ class WC_AJAX { $validation_error = apply_filters( 'woocommerce_ajax_add_order_item_validation', $validation_error, $product, $order, $qty ); if ( $validation_error->get_error_code() ) { - throw new Exception( '' . __( 'Error:', 'woocommerce' ) . ' ' . $validation_error->get_error_message() ); + throw new Exception( sprintf( __( 'Error: %s', 'woocommerce' ), $validation_error->get_error_message() ) ); } $item_id = $order->add_product( $product, $qty ); $item = apply_filters( 'woocommerce_ajax_order_item', $order->get_item( $item_id ), $item_id, $order, $product );