Changes between Initial Version and Version 1 of Ticket #54436
- Timestamp:
- 11/13/2021 08:52:05 PM (3 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #54436 – Description
initial v1 1 So, I created a new meta key with the name "_tstock" and stored numeric values in it, used the code below for sorting: 2 **$args['orderby'] = 'meta_value_num'; 1 So, I created a new meta key with the name `_tstock` and stored numeric values in it, used the code below for sorting: 2 {{{ 3 $args['orderby'] = 'meta_value_num'; 3 4 $args['order'] = 'DESC'; 4 $args['meta_key'] = '_tstock';** 5 The products tend to repeat after switching the page if the value of _tstock of the last product is similar to first product on the next page. 5 $args['meta_key'] = '_tstock'; 6 }}} 7 The products tend to repeat after switching the page if the value of `_tstock` of the last product is similar to first product on the next page. 8 6 9 Elaborating a bit more :- 7 Let's assume that there are 10 products with the _tstockvalue equal to one and 5 products are displayed on the first page while the rest 5 are displayed on second page.10 Let's assume that there are 10 products with the `_tstock` value equal to one and 5 products are displayed on the first page while the rest 5 are displayed on second page. 8 11 The total number of the product will not change instead some of the products from the first page will be displayed on the second page replacing the ones that should be displayed.