From 5f924bb7bd5c0cf866f34c0107f38bcd1088de34 Mon Sep 17 00:00:00 2001 From: ZIANE Zakaria <101505748+ZZiane@users.noreply.github.com> Date: Thu, 3 Oct 2024 00:54:02 +0100 Subject: [PATCH] Fix: Correct number formatting by removing unnecessary price separators (#888) * Fix: Correct number formatting by removing unnecessary price separators * fix: correct spacing and quote usage in query arguments --- .../data/connection/class-product-connection-resolver.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/data/connection/class-product-connection-resolver.php b/includes/data/connection/class-product-connection-resolver.php index bc9961df..95e1aa27 100644 --- a/includes/data/connection/class-product-connection-resolver.php +++ b/includes/data/connection/class-product-connection-resolver.php @@ -657,11 +657,11 @@ public function sanitize_input_fields( array $where_args ) { ]; } if ( ! empty( $where_args['minPrice'] ) ) { - $query_args['min_price'] = str_replace( '.', '', number_format( $where_args['minPrice'], 2 ) ); + $query_args['min_price'] = number_format( $where_args['minPrice'], 2, '', '' ); } if ( ! empty( $where_args['maxPrice'] ) ) { - $query_args['max_price'] = str_replace( '.', '', number_format( $where_args['maxPrice'], 2 ) ); + $query_args['max_price'] = number_format( $where_args['maxPrice'], 2, '', '' ); } if ( isset( $where_args['stockStatus'] ) ) {