| @@ -188,8 +188,13 @@ | ||
| 188 | 188 | |
| 189 | 189 | if ( 'menu_order' === $order_by ) { |
| 190 | 190 | $this->args['orderby'] = 'menu_order title'; |
| 191 | 191 | } |
| 192 | + | |
| 193 | + if ( 'price' === $order_by ) { | |
| 194 | + $this->args['orderby'] = 'meta_value_num'; | |
| 195 | + $this->args['meta_key'] = '_price'; // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_key | |
| 196 | + } | |
| 192 | 197 | } |
| 193 | 198 | |
| 194 | 199 | return $this; |
| 195 | 200 | } |
| @@ -269,13 +274,18 @@ | ||
| 269 | 274 | * @return void |
| 270 | 275 | */ |
| 271 | 276 | private function tax_params(): void { |
| 272 | 277 | $categories = isset( $this->meta['categories'] ) ? array_filter( $this->meta['categories'] ) : []; |
| 278 | + $brands = isset( $this->meta['brands'] ) ? array_filter( $this->meta['brands'] ) : []; | |
| 273 | 279 | $tags = isset( $this->meta['tags'] ) ? array_filter( $this->meta['tags'] ) : []; |
| 274 | 280 | $attributes = isset( $this->meta['attributes'] ) ? array_filter( $this->meta['attributes'] ) : []; |
| 275 | 281 | |
| 276 | 282 | if ( ! empty( $categories ) ) { |
| 277 | 283 | $this->args['product_category_id'] = $categories; |
| 284 | + } | |
| 285 | + | |
| 286 | + if ( ! empty( $brands ) ) { | |
| 287 | + $this->args['product_brand_id'] = $brands; | |
| 278 | 288 | } |
| 279 | 289 | |
| 280 | 290 | if ( ! empty( $tags ) ) { |
| 281 | 291 | $this->args['product_tag_id'] = $tags; |