Gaugepres Label value and Woocommerce report
-
Hi,
I use the e-commerce wordpress script woocommerce and I would like that the Gaugepress label value is the same that my e-shop total order report.Woocommerce script use fonctions for displaying the total order number in the admin dashboard.
Do you think is it possible to export the total order woocommerce report for import it in the gaugepresse label value ?
This is the woocommerce fonction and script for the admin report display :
/** * Output the sales overview chart. * * @access public * @return void */ function woocommerce_sales_overview() { global $start_date, $end_date, $woocommerce, $wpdb, $wp_locale; $total_sales = $total_orders = $order_items = $discount_total = $shipping_total = 0; $order_totals = apply_filters( 'woocommerce_reports_sales_overview_order_totals', $wpdb->get_row( " SELECT SUM(meta.meta_value) AS total_sales, COUNT(posts.ID) AS total_orders FROM {$wpdb->posts} AS posts LEFT JOIN {$wpdb->postmeta} AS meta ON posts.ID = meta.post_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 meta.meta_key = '_order_total' AND posts.post_type = 'shop_order' AND posts.post_status = 'publish' AND tax.taxonomy = 'shop_order_status' AND term.slug IN ('" . implode( "','", apply_filters( 'woocommerce_reports_order_statuses', array( 'completed', 'processing', 'on-hold' ) ) ) . "') " ) ); $total_sales = $order_totals->total_sales; $total_orders = absint( $order_totals->total_orders );
<div class="postbox"> <h3><span><?php _e( 'Total orders', 'woocommerce' ); ?></span></h3> <div class="inside"> <p class="stat"><?php if ( $total_orders > 0 ) echo $total_orders . ' (' . $order_items . ' ' . __( 'items', 'woocommerce' ) . ')'; else _e( 'n/a', 'woocommerce' ); ?></p> </div> </div>
Sorry for my English language, I’m french.
Thank you for your help !
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Gaugepres Label value and Woocommerce report’ is closed to new replies.