Skip to content

Commit 5f924bb

Browse files
authored
Fix: Correct number formatting by removing unnecessary price separators (wp-graphql#888)
* Fix: Correct number formatting by removing unnecessary price separators * fix: correct spacing and quote usage in query arguments
1 parent 2f663a4 commit 5f924bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

includes/data/connection/class-product-connection-resolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -657,11 +657,11 @@ public function sanitize_input_fields( array $where_args ) {
657657
];
658658
}
659659
if ( ! empty( $where_args['minPrice'] ) ) {
660-
$query_args['min_price'] = str_replace( '.', '', number_format( $where_args['minPrice'], 2 ) );
660+
$query_args['min_price'] = number_format( $where_args['minPrice'], 2, '', '' );
661661
}
662662

663663
if ( ! empty( $where_args['maxPrice'] ) ) {
664-
$query_args['max_price'] = str_replace( '.', '', number_format( $where_args['maxPrice'], 2 ) );
664+
$query_args['max_price'] = number_format( $where_args['maxPrice'], 2, '', '' );
665665
}
666666

667667
if ( isset( $where_args['stockStatus'] ) ) {

0 commit comments

Comments
 (0)