possible message when out of stock

This commit is contained in:
Mike Jolley 2011-08-31 14:48:06 +01:00
parent ae0482bf9b
commit 9f66eafefb
1 changed files with 5 additions and 0 deletions

View File

@ -72,6 +72,11 @@ if (!function_exists('woocommerce_template_loop_price')) {
if (!function_exists('woocommerce_check_product_visibility')) {
function woocommerce_check_product_visibility( $post, $_product ) {
if (!$_product->is_visible() && $post->post_parent > 0) : wp_safe_redirect(get_permalink($post->post_parent)); exit; endif;
/*if (get_option('woocommerce_hide_out_of_stock_items')=='yes') :
woocommerce::add_error( __('Sorry, this product is currently unavailable.', 'woothemes') );
endif;*/
if (!$_product->is_visible()) : wp_safe_redirect(home_url()); exit; endif;
}
}