0

I've got a function that is providing an error on my Wordpress page. I can't really write PHP only HTML/CSS/JQUERY so I don't know what this errors means and how to fix it..

If i turn on my DEBUG, it says that there is something wrong on the following line :

$is_store_close = $WCFMmp->wcfmmp_store_hours->wcfmmp_is_store_close( $atts['vendor_id'] );

Below is the full code i'm using.

function kia_store_hours_shortcode( $atts ) {
global $WCFMmp;
$html = '';
$atts = shortcode_atts( array(
    'vendor_id' => '',
), $atts, 'store_hours' );
if ( $atts['vendor_id'] ) {
    $is_store_close = $WCFMmp->wcfmmp_store_hours->wcfmmp_is_store_close( $atts['vendor_id'] );
    if( $is_store_close ) {
        ?>
        <p class="store-closed">
            <?php echo __( 'This shop is currently closed and isn\'t accepting orders. Please take a look at the opening hours.', 'wc-frontend-manager' ); ?>
        </p>
        <?php
    } else { 
        ?>
        <p class="store-open">
            <?php echo __( 'This shop is currently open and is accepting orders. Happy ordering!', 'wc-frontend-manager' ); ?>
        </p>
      <?php
    }
}
return $html; 
} 
add_shortcode( 'store_hours', 'kia_store_hours_shortcode' );

0 Answers0