diff --git a/readme.txt b/readme.txt index 559d5c70908..1d2ed424d71 100644 --- a/readme.txt +++ b/readme.txt @@ -183,6 +183,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Fix - Fix IE Download via SSL bug and fix http file over SSL. * Fix - Show non-existing product line items. * Fix - Conflicts with W3 Total Cache DB Cache +* Fix - piwik tracking. * Tweak - Added a check to parent theme for comments_template before loading plugin template. * Tweak - Remove hard coded max from random products widget. * Tweak - Add filter hook to the place order button for easy 3rd party manipulation. @@ -194,7 +195,9 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc * Tweak - woocommerce_show_page_title filter * Tweak - wrapper / css tweaks for TwentyThirteen compatibility * Tweak - Added filters for controlling cross-sell display +* Tweak - Made hierarchy code in breadcrumbs more reliable. * Localisation - NZ States +* Other minor fixes and localisation updates. = 2.0.5 - 26/03/2013 = * Tweak - Made no shipping available messages filterable via woocommerce_cart_no_shipping_available_html and woocommerce_no_shipping_available_html. diff --git a/woocommerce-functions.php b/woocommerce-functions.php index 382dca321b8..0a1e8547bbf 100644 --- a/woocommerce-functions.php +++ b/woocommerce-functions.php @@ -1208,47 +1208,53 @@ function woocommerce_readfile_chunked( $file, $retbytes = true ) { function woocommerce_ecommerce_tracking_piwik( $order_id ) { global $woocommerce; - if (is_admin()) return; // Don't track admin + // Don't track admin + if ( current_user_can('manage_options') ) + return; // Call the Piwik ecommerce function if WP-Piwik is configured to add tracking codes to the page - $wp_piwik_global_settings = get_option('wp-piwik_global-settings'); + $wp_piwik_global_settings = get_option( 'wp-piwik_global-settings' ); // Return if Piwik settings are not here, or if global is not set - if ( ! isset( $wp_piwik_global_settings['add_tracking_code'] ) || ! $wp_piwik_global_settings['add_tracking_code'] ) return; - if ( ! isset( $GLOBALS['wp_piwik'] ) ) return; + if ( ! isset( $wp_piwik_global_settings['add_tracking_code'] ) || ! $wp_piwik_global_settings['add_tracking_code'] ) + return; + if ( ! isset( $GLOBALS['wp_piwik'] ) ) + return; - // Remove WP-Piwik from wp_footer and run it here instead, to get Piwik - // loaded *before* we do our ecommerce tracking calls - remove_action('wp_footer', array($GLOBALS['wp_piwik'],'footer')); - $GLOBALS['wp_piwik']->footer(); - - // Get the order and output tracking code - $order = new WC_Order($order_id); + // Get the order and get tracking code + $order = new WC_Order( $order_id ); + ob_start(); ?> - add_inline_js( $code ); }