Looking for help?
< All Topics
Print

How to sort products by created date

To sort product list on POS panel, you can add this shortcode to yourtheme/function.php or a snippet code plugin

to sort products on POS product list from new to old

add_filter('op_product_data',function($product_data){
    $product_data['str_key'] = sanitize_title(1000000000000 + (10000000000 - $product_data['id']));
    return $product_data;
},100,1);

to sort products on POS product list from old to new

add_filter('op_product_data',function($product_data){
    $product_data['str_key'] = sanitize_title(1000000000000 +  $product_data['id']);
    return $product_data;
},100,1);
Table of Contents