Changeset 3151740
- Timestamp:
- 09/14/2024 10:56:52 AM (19 months ago)
- Location:
- stock-car-listing-from-autocerfa/trunk
- Files:
-
- 2 edited
-
src/AutocerfaStockPost.php (modified) (2 diffs)
-
view/front/autocerfa-search-box.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
stock-car-listing-from-autocerfa/trunk/src/AutocerfaStockPost.php
r3095166 r3151740 206 206 207 207 return [ 208 'min' => $ query->posts[0]->price,209 'max' => $ query->posts[count($query->posts) - 1]->price208 'min' => $this->price($query->posts[0]->price), 209 'max' => $this->price($query->posts[count($query->posts) - 1]->price) 210 210 ]; 211 211 } … … 300 300 return (new WP_Query($arg))->posts; 301 301 } 302 303 public function price($price) 304 { 305 $price = preg_replace('/\.\d\b/', '', $price); 306 $price = preg_replace('/\.\d{2}\b/', '', $price); 307 $price = preg_replace('/[^0-9,]+/', '', $price); 308 return (int)(str_replace(',', '.', $price)); 309 } 302 310 } -
stock-car-listing-from-autocerfa/trunk/view/front/autocerfa-search-box.php
r2901090 r3151740 17 17 $AutocerfaDefault = new AutocerfaDefault; 18 18 19 $min_price = empty($autocerfa_shortcodes_settings['search_box']['min_price']) ? $AutocerfaDefault->get_min_price() : $autocerfa_shortcodes_settings['search_box']['min_price'];20 $max_price = empty($autocerfa_shortcodes_settings['search_box']['max_price']) ? $AutocerfaDefault->get_max_price() : $autocerfa_shortcodes_settings['search_box']['max_price'];19 $min_price = $AutocerfaDefault->get_min_price(); 20 $max_price = $AutocerfaDefault->get_max_price(); 21 21 ?> 22 22 <style>
Note: See TracChangeset
for help on using the changeset viewer.