Don't count twice Closes #2384.

This commit is contained in:
Mike Jolley 2013-02-08 17:58:49 +00:00
parent aa5db92a88
commit f70162177a
2 changed files with 4 additions and 3 deletions

View File

@ -368,7 +368,7 @@ function woocommerce_sales_overview() {
<div class="postbox">
<h3><span><?php _e( 'Total sales', 'woocommerce' ); ?></span></h3>
<div class="inside">
<p class="stat"><?php if ($total_sales>0) echo woocommerce_price($total_sales); else _e( 'n/a', 'woocommerce' ); ?></p>
<p class="stat"><?php if ( $total_sales > 0 ) echo woocommerce_price($total_sales); else _e( 'n/a', 'woocommerce' ); ?></p>
</div>
</div>
<div class="postbox">
@ -2579,7 +2579,8 @@ function woocommerce_category_sales() {
$total = 0;
}
$month_totals[ $count ] += $total;
if ( sizeof( array_intersect( $include_categories, get_ancestors( $category->term_id, 'product_cat' ) ) ) == 0 )
$month_totals[ $count ] += $total;
$category_sales_html .= '<td>' . woocommerce_price( $total ) . '</td>';

View File

@ -27,7 +27,7 @@ class WC_Product_Cat_Dropdown_Walker extends Walker {
*/
function start_el(&$output, $cat, $depth, $args) {
if ( $args['hierarchical'] )
if ( ! empty( $args['hierarchical'] ) )
$pad = str_repeat('&nbsp;', $depth * 3);
else
$pad = '';