function wise_woocommerce_demo_store()
 {
     if (get_option('woocommerce_demo_store_notice') == null) {
         return;
     }
     $notice = get_option('woocommerce_demo_store_notice');
     if (function_exists('is_woocommerce') && is_woocommerce() && $notice != null && is_store_notice_showing()) {
         echo apply_filters('woocommerce_demo_store', '<div class="alert"><p class="demo_store">' . wp_kses_post($notice) . '<a href="#" class="close" data-dismiss="alert" aria-label="close">&times;</a></p></div>');
     } else {
         echo apply_filters('woocommerce_demo_store', '<p class="demo_store" style="display:none;">' . wp_kses_post($notice) . '</p>');
     }
 }
 /**
  * Adds a demo store banner to the site if enabled
  *
  * @access public
  * @return void
  */
 function woocommerce_demo_store()
 {
     if (!is_store_notice_showing()) {
         return;
     }
     $notice = get_option('woocommerce_demo_store_notice');
     if (empty($notice)) {
         $notice = __('This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', 'woocommerce');
     }
     echo apply_filters('woocommerce_demo_store', '<p class="demo_store">' . $notice . '</p>');
 }
 /**
  * Test is_store_notice_showing().
  *
  * @since 2.3.0
  */
 public function test_is_store_notice_showing()
 {
     $this->assertEquals(false, is_store_notice_showing());
 }
 /**
  * Adds a demo store banner to the site if enabled.
  *
  */
 function woocommerce_demo_store()
 {
     if (!is_store_notice_showing()) {
         return;
     }
     $notice = get_option('woocommerce_demo_store_notice');
     if (empty($notice)) {
         $notice = __('This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', 'woocommerce');
     }
     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">' . __('Dismiss', 'woocommerce') . '</a></p>', $notice);
 }
Example #5
0
 /**
  * Adds a demo store banner to the site if enabled
  *
  */
 function woocommerce_site_note()
 {
     if (!is_store_notice_showing()) {
         return;
     }
     $notice = get_option('woocommerce_demo_store_notice');
     if (empty($notice)) {
         $notice = __('This is a demo store for testing purposes &mdash; no orders shall be fulfilled.', 'woocommerce');
     }
     echo '<div class="alert alert-info">' . wp_kses_post($notice) . '</div>';
 }
Example #6
0
 * Used for single page.
 *
 * @package WordPress
 * @subpackage Krypton
 * @since Krypton 1.0
 */
global $krypton_config, $post;
$woocommerce = "";
$sidebars = wp_get_sidebars_widgets();
$sidebar = false;
if (isset($sidebars['krypton-sidebar']) && count($sidebars['krypton-sidebar'])) {
    $sidebar = 'krypton-sidebar';
} elseif (isset($sidebars['sidebar-1']) && !isset($sidebars['krypton-sidebar']) && count($sidebars['sidebar-1'])) {
    $sidebar = 'sidebar-1';
}
if (is_plugin_active('woocommerce/woocommerce.php') && (is_woocommerce() || is_checkout() || is_cart() || is_account_page() || is_store_notice_showing())) {
    $woocommerce = "shop";
    if (isset($sidebars['shop-sidebar']) && count($sidebars['shop-sidebar'])) {
        $sidebar = 'shop-sidebar';
    }
}
get_header($woocommerce);
$sidebar_position = get_post_meta(get_the_ID(), 'sidebar_position', true);
if (!isset($sidebar_position) || empty($sidebar_position) || $sidebar_position == 'default') {
    switch ($krypton_config['layout']) {
        case 1:
            $sidebar_position = "nosidebar";
            break;
        case 2:
            $sidebar_position = "sidebar-left";
            break;
Example #7
0
 public static function is_store_notice_showing()
 {
     return self::exists() && is_store_notice_showing();
 }