Good morning, I managed to sort the products based on the date entered in a custom field and it works on this page:
https://staging.sviluppomanageriale.it/catalogo-corsi/
However, I can’t get it to work in list mode, like on this page:
https://staging.sviluppomanageriale.it/lista-corsi-test/
This is the script I placed in functions.php. Can you help me make it work in list mode as well?
add_filter('woocommerce_get_catalog_ordering_args', 'woocommerce_catalog_orderby');
function woocommerce_catalog_orderby( $args ) {
$args['order'] = 'ASC';
$args['meta_key'] = 'data_corso'; // ACF
$args['orderby'] = 'meta_value';
return $args;
}
Thank you.
Graz