PluginProbe
ShopBuilder – WooCommerce Builder For Elementor / 3.4.2
ShopBuilder – WooCommerce Builder For Elementor v3.4.2
3.4.2 3.4.1 3.4.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.10 2.1.11 2.1.12 2.1.13 2.1.14 2.1.15 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2.0 2.2.1 2.2.2 All 63 releases
← All changes | app/Models/QueryArgs.php +20 -6 2.1.63.4.2 View file →
@@ -93,9 +93,9 @@
93 93 }
94 94
95 95 if ( $post_not_in ) {
96 96 $post_not_in = explode( ',', $post_not_in );
97 - $this->args['exclude'] = $post_not_in;
97 + $this->args['exclude'] = $post_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
98 98 }
99 99
100 100 if ( $author_in ) {
101 101 $this->args['author'] = $author_in;
@@ -134,9 +134,9 @@
134 134 }
135 135
136 136 if ( $cats_not_in ) {
137 137 $cats_not_in = array_filter( explode( ',', $cats_not_in ) );
138 - $this->args['exclude'] = $cats_not_in;
138 + $this->args['exclude'] = $cats_not_in; // phpcs:ignore WordPressVIPMinimum.Performance.WPQueryParams.PostNotIn_exclude
139 139 }
140 140
141 141 $this->args['number'] = $limit;
142 142 $this->args['hide_empty'] = $this->meta['show_empty'] ? 0 : 1;
@@ -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 }
@@ -240,13 +245,17 @@
240 245
241 246 $this->args['paginate'] = true;
242 247 $this->args['limit'] = $posts_per_page;
243 248
244 - if ( is_front_page() ) {
245 - $paged = ( get_query_var( 'page' ) ) ? get_query_var( 'page' ) : 1;
246 - } else {
247 - $paged = ( get_query_var( 'paged' ) ) ? get_query_var( 'paged' ) : 1;
249 + // Prefer `paged` (archive pagination), fall back to `page` (paginated singular posts).
250 + // Handles the case where the shop/archive is set as the front page.
251 + $paged = get_query_var( 'paged' );
252 + if ( ! $paged ) {
253 + $paged = get_query_var( 'page' );
248 254 }
255 + if ( ! $paged ) {
256 + $paged = 1;
257 + }
249 258
250 259 $offset = $posts_per_page * ( (int) $paged - 1 );
251 260 $this->args['page'] = $paged;
252 261
@@ -269,13 +278,18 @@
269 278 * @return void
270 279 */
271 280 private function tax_params(): void {
272 281 $categories = isset( $this->meta['categories'] ) ? array_filter( $this->meta['categories'] ) : [];
282 + $brands = isset( $this->meta['brands'] ) ? array_filter( $this->meta['brands'] ) : [];
273 283 $tags = isset( $this->meta['tags'] ) ? array_filter( $this->meta['tags'] ) : [];
274 284 $attributes = isset( $this->meta['attributes'] ) ? array_filter( $this->meta['attributes'] ) : [];
275 285
276 286 if ( ! empty( $categories ) ) {
277 287 $this->args['product_category_id'] = $categories;
288 + }
289 +
290 + if ( ! empty( $brands ) ) {
291 + $this->args['product_brand_id'] = $brands;
278 292 }
279 293
280 294 if ( ! empty( $tags ) ) {
281 295 $this->args['product_tag_id'] = $tags;