Hi Cristian, thanks for your feedback.
It’s possible to add an option for showing products randomly in the catalog by adding some custom code. By using a code snippets plugin (for example this one) you can try to add the following snippet (adapted from a Stack Overflow answer) to add a “Random” option to the product sort selector that appears in the shop catalog page:
add_filter( 'woocommerce_get_catalog_ordering_args', 'custom_woocommerce_get_catalog_ordering_args' );
function custom_woocommerce_get_catalog_ordering_args( $args ) {
if( is_search() ) {
return $args;
}
$orderby_value = isset( $_GET['orderby'] ) ? wc_clean( (string) wp_unslash( $_GET['orderby'] ) ) : wc_clean( get_query_var( 'orderby' ) );
if ( ! $orderby_value ) {
$orderby_value = apply_filters( 'woocommerce_default_catalog_orderby', get_option( 'woocommerce_default_catalog_orderby', 'menu_order' ) );
}
if ( 'random_list' == $orderby_value ) {
$args['orderby'] = 'rand';
$args['order'] = '';
$args['meta_key'] = '';
}
return $args;
}
add_filter( 'woocommerce_default_catalog_orderby_options', 'custom_woocommerce_catalog_orderby' );
add_filter( 'woocommerce_catalog_orderby', 'custom_woocommerce_catalog_orderby' );
function custom_woocommerce_catalog_orderby( $sortby ) {
$sortby['random_list'] = 'Random';
return $sortby;
}
I hope that helps.
Additionally, if you think that this is a functionality that WooCommerce should implement natively, please feel free to submit an enhancement request in the WooCommerce repository in GitHub.