WCFM – Show if restaurant if closed/open shortcode
-
Hello,
I want to show in the front end when the shop is closed or open and it works with the code below but I want to show this content on another page then the standard page. What is the shortcode I can use to display the title when the shop is closed or not?
I see the text ‘This shop is currently closed, please check the opening hours’ on the website, but I want to show it somewhere else on a own separate block.
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="shop-closed"> This shop is currently closed, please check the opening hours. <?php echo __( 'Store closed', 'wc-frontend-manager' ); ?> </p> <?php } else { ?> <p class="shop-open"> This shop is currently open for orders, happy ordering! <?php echo __( 'Store open', 'wc-frontend-manager' ); ?> </p> <?php } } }, 50, 2 );
Best,
- The topic ‘WCFM – Show if restaurant if closed/open shortcode’ is closed to new replies.