Hello @bmasson,
If you want to show store randomly on the store-page on each page load then you can use the below codes on your child-theme functions.php file –
function dokan_store_listing_orderby_ramdom_filter( $seller_args ) {
$seller_args['orderby'] = 'dokan_store_rand';
return $seller_args;
}
add_filter( 'dokan_seller_listing_args', 'dokan_store_listing_orderby_ramdom_filter', 99 );
function dokan_store_listing_orderby_filter_query( $query ) {
if ( $query->query_vars['orderby'] === 'dokan_store_rand' ) {
$order_by = [
'ID',
'user_login, ID',
'user_email',
'user_registered, ID',
'user_nicename, ID'
];
if ( false === ( $selected_orderby = get_transient( 'dokan_store_listing_random_orderby' ) ) ) {
$selected_orderby = $order_by[ array_rand( $order_by, 1 ) ];
set_transient( 'dokan_store_listing_random_orderby', $selected_orderby, MINUTE_IN_SECONDS * 10 );
}
$query->query_orderby = "ORDER BY $selected_orderby";
}
}
add_action( 'pre_user_query' , 'dokan_store_listing_orderby_filter_query' );
This will show the store thumbnail randomly on the store-list page after each page load by the customer. Please note that if you need more modification then feel free to use my given code and extend as you need.