Forum Replies Created

Viewing 4 replies - 16 through 19 (of 19 total)
  • Thread Starter arnone

    (@arnone)

    Oh thank you Konstantinos Kouratoras, that will be perfect !

    Thread Starter arnone

    (@arnone)

    Ok, I’ve just add this code and everything is ok now ?? :

    Global $wpdb;
    		$value = apply_filters( 'woocommerce_reports_sales_overview_order_items', absint( $wpdb->get_var( "
    		SELECT SUM( order_item_meta.meta_value )
    		FROM {$wpdb->prefix}woocommerce_order_items as order_items
    		LEFT JOIN {$wpdb->prefix}woocommerce_order_itemmeta as order_item_meta ON order_items.order_item_id = order_item_meta.order_item_id
    		LEFT JOIN {$wpdb->posts} AS posts ON order_items.order_id = posts.ID
    		LEFT JOIN {$wpdb->term_relationships} AS rel ON posts.ID = rel.object_ID
    		LEFT JOIN {$wpdb->term_taxonomy} AS tax USING( term_taxonomy_id )
    		LEFT JOIN {$wpdb->terms} AS term USING( term_id )
    		WHERE 	term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "')
    		AND 	posts.post_status 	= 'publish'
    		AND 	tax.taxonomy		= 'shop_order_status'
    		AND 	order_items.order_item_type = 'line_item'
    		AND 	order_item_meta.meta_key = '_qty'
    	" ) ) );
    Thread Starter arnone

    (@arnone)

    Oh sorry for my question, that’s OK now, I’ve hidden min and max labels and put an image just in the bottom.
    Thank you !

    Hi,
    I’m interested in this code, is it possible to share it please ?
    Thank you and congrats for your nice job !

Viewing 4 replies - 16 through 19 (of 19 total)