woocommerce_demo_store

Adds a demo store banner to the site if enabled.

Description

woocommerce_demo_store(); 

Usage

  1. if ( !function_exists( 'woocommerce_demo_store' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'woocommerce/includes/wc-template-functions.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = woocommerce_demo_store(); 
  7.  

Defined (1)

The function is defined in the following location(s).

/includes/wc-template-functions.php  
  1. function woocommerce_demo_store() { 
  2. if ( ! is_store_notice_showing() ) { 
  3. return; 
  4.  
  5. $notice = get_option( 'woocommerce_demo_store_notice' ); 
  6.  
  7. if ( empty( $notice ) ) { 
  8. $notice = __( 'This is a demo store for testing purposes — no orders shall be fulfilled.', woocommerce ); 
  9.  
  10. echo apply_filters( 'woocommerce_demo_store', '<p class="woocommerce-store-notice demo_store">' . wp_kses_post( $notice ) . ' <a href="#" class="woocommerce-store-notice__dismiss-link">' . esc_html__( 'Dismiss', woocommerce ) . '</a></p>', $notice );