Skip to content

Commit

Permalink
Fix: Correct number formatting by removing unnecessary price separato…
Browse files Browse the repository at this point in the history
…rs (#888)

* Fix: Correct number formatting by removing unnecessary price separators

* fix: correct spacing and quote usage in query arguments
  • Loading branch information
ZZiane authored Oct 2, 2024
1 parent 2f663a4 commit 5f924bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ) ) {
Expand Down

0 comments on commit 5f924bb

Please sign in to comment.