add_action( 'woocommerce_after_shop_loop_item_title','wpgenie_show_counter_in_loop',50 ); function wpgenie_show_counter_in_loop(){ global $product; $time = ''; if(!isset ($product)) return; if('groupbuy' != $product->get_type()) return; $timetext = __('Time left', 'wc_groupbuy'); if(!$product->is_started()){ $timetext = __('Starting in', 'wc_groupbuy'); $counter_time = $product->get_seconds_to_groupbuy(); } else{ $counter_time = $product->get_seconds_remaining(); } $time = ''.$timetext.'
'; if($product->is_closed()){ $time = ''.__('Group Buy deal finished','wc_groupbuy').''; } echo $time; }