$_first_product = get_posts( array(
'numberposts' => 1,
'post_type' => 'product',
'category' => $_categories,
'post_status' => 'publish',
//'orderby'=>'menu_order',
'order'=>'ASC',
) );
if ( is_array($_first_product) and count($_first_product) and $_first_product[0]->ID == $_product_id )
$_is_first_product = true;