1. I’d like to show customers if a store is open or closed on the store list.
– It’s possible.
2. Is it possible to set an automatic filter that shows the stores that are open first?
– This will not possible. We can hide closed stores from list.
Thank you for answering.
How can I do the first thing then?
Best!
Add this snippet to your site –
add_filter( 'wcfmmp_store_list_after_store_info', function( $vendor_id, $store_info ) {
global $WCFMmp;
if( apply_filters( 'wcfm_is_pref_store_hours', true ) && $vendor_id && wcfm_is_vendor( $vendor_id ) ) {
$is_store_close = $WCFMmp->wcfmmp_store_hours->wcfmmp_is_store_close( $vendor_id );
if( $is_store_close ) {
?>
<p class="store-phone">
<i class="wcfmfa fa-times-circle" style="background:red!important;" aria-hidden="true"></i> <?php echo __( 'Close Now', 'wc-frontend-manager' ); ?>
</p>
<?php
} else {
?>
<p class="store-phone">
<i class="wcfmfa fa-check-circle" style="background:green!important;" aria-hidden="true"></i> <?php echo __( 'Open Now', 'wc-frontend-manager' ); ?>
</p>
<?php
}
}
}, 50, 2 );
Thank you so much.
Another question – sorry – how can I switch the …km away on the store list off?
Add this line –
add_filter( 'wcfm_is_allow_store_list_distance', '__return_false' );