From 2bbebb70d6969afa43a5c8ac3e97296763df23b4 Mon Sep 17 00:00:00 2001 From: curtismchale Date: Mon, 12 Mar 2012 10:23:04 -0700 Subject: [PATCH] fixes debug output when no products in the store --- woocommerce-template.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/woocommerce-template.php b/woocommerce-template.php index 7e7795c98ce..7135c7af823 100644 --- a/woocommerce-template.php +++ b/woocommerce-template.php @@ -26,19 +26,19 @@ if (!function_exists('woocommerce_content')) { if (!function_exists('woocommerce_archive_product_content')) { function woocommerce_archive_product_content() { - if (!is_search()) : + if (!is_search()) { $shop_page = get_post( woocommerce_get_page_id('shop') ); $shop_page_title = apply_filters('the_title', (get_option('woocommerce_shop_page_title')) ? get_option('woocommerce_shop_page_title') : $shop_page->post_title); - $shop_page_content = $shop_page->post_content; - else : + if( is_object( $shop_page ) ) $shop_page_content = $shop_page->post_content; + } else { $shop_page_title = __('Search Results:', 'woocommerce') . ' “' . get_search_query() . '”'; if (get_query_var('paged')) $shop_page_title .= ' — ' . __('Page', 'woocommerce') . ' ' . get_query_var('paged'); $shop_page_content = ''; - endif; + } ?>

- + @@ -764,4 +764,4 @@ if (!function_exists('woocommerce_form_field')) { if ($args['return']) return $field; else echo $field; } -} \ No newline at end of file +}