Do not count trashed product variations

This commit is contained in:
Szabolcs Légrádi 2015-09-02 23:11:28 +02:00
parent 68460063a0
commit 6bb0dd864b
1 changed files with 1 additions and 1 deletions

View File

@ -612,7 +612,7 @@ class WC_Meta_Box_Product_Data {
}
}
$variations_count = absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation' AND post_status = 'publish'", $post->ID ) ) );
$variations_count = absint( $wpdb->get_var( $wpdb->prepare( "SELECT COUNT(ID) FROM $wpdb->posts WHERE post_parent = %d AND post_type = 'product_variation' AND post_status IN ('publish', 'private')", $post->ID ) ) );
$variations_per_page = absint( apply_filters( 'woocommerce_admin_meta_boxes_variations_per_page', 10 ) );
$variations_total_pages = ceil( $variations_count / $variations_per_page );
?>