私は主な問題はあなたがWP_Queryオブジェクトではなくオブジェクトを使用する必要があることだと思うget_posts()。後者はデフォルトではpost_typeが商品ではpostないアイテムのみを返しますが、
したがって、ID 26のカテゴリを指定すると、次のコードはその製品(WooCommerce 3+)を返します。
    $args = array(
    'post_type'             => 'product',
    'post_status'           => 'publish',
    'ignore_sticky_posts'   => 1,
    'posts_per_page'        => '12',
    'tax_query'             => array(
        array(
            'taxonomy'      => 'product_cat',
            'field' => 'term_id', //This is optional, as it defaults to 'term_id'
            'terms'         => 26,
            'operator'      => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
        ),
        array(
            'taxonomy'      => 'product_visibility',
            'field'         => 'slug',
            'terms'         => 'exclude-from-catalog', // Possibly 'exclude-from-search' too
            'operator'      => 'NOT IN'
        )
    )
);
$products = new WP_Query($args);
var_dump($products);
WooCommerceの以前のバージョンでは、可視性はメタフィールドとして保存されていたため、コードは次のようになります。
    $args = array(
    'post_type'             => 'product',
    'post_status'           => 'publish',
    'ignore_sticky_posts'   => 1,
    'posts_per_page'        => '12',
    'meta_query'            => array(
        array(
            'key'           => '_visibility',
            'value'         => array('catalog', 'visible'),
            'compare'       => 'IN'
        )
    ),
    'tax_query'             => array(
        array(
            'taxonomy'      => 'product_cat',
            'field' => 'term_id', //This is optional, as it defaults to 'term_id'
            'terms'         => 26,
            'operator'      => 'IN' // Possible values are 'IN', 'NOT IN', 'AND'.
        )
    )
);
$products = new WP_Query($args);
var_dump($products);
ここでは、ページあたり12個の表示可能な製品のみを返します。 
カテゴリターゲティングの仕組みの詳細については、http://codex.wordpress.org/Class_Reference/WP_Query#Taxonomy_Parametersをご覧ください。IDよりもスラッグで取得する方が便利なことがよくあります。
               
              
categoryまたはproduct_category?