Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #54436


Ignore:
Timestamp:
11/13/2021 08:52:05 PM (3 years ago)
Author:
sabernhardt
Comment:

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';
     1So, 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';
    34$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}}}
     7The 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
    69Elaborating a bit more :-
    7 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.
     10Let'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.
    811The 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.