Reports fix when beginning with a number.

This commit is contained in:
Mike Jolley 2012-09-30 19:35:05 +01:00
parent a406f24103
commit c9e61eef82
2 changed files with 5 additions and 4 deletions

View File

@ -2148,7 +2148,7 @@ function woocommerce_category_sales() {
<?php <?php
// Variables // Variables
foreach ( $chart_data as $name => $data ) { foreach ( $chart_data as $name => $data ) {
$varname = str_replace( '-', '_', sanitize_title( $name ) ) . '_data'; $varname = 'cat_' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data';
echo 'var ' . $varname . ' = jQuery.parseJSON( \'' . json_encode( $data ) . '\' );'; echo 'var ' . $varname . ' = jQuery.parseJSON( \'' . json_encode( $data ) . '\' );';
} }
?> ?>
@ -2160,7 +2160,7 @@ function woocommerce_category_sales() {
$labels = array(); $labels = array();
foreach ( $chart_data as $name => $data ) { foreach ( $chart_data as $name => $data ) {
$labels[] = '{ label: "' . esc_js( $name ) . '", data: ' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data }'; $labels[] = '{ label: "' . esc_js( $name ) . '", data: ' . 'cat_' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data }';
} }
echo implode( ',', $labels ); echo implode( ',', $labels );
@ -2446,7 +2446,7 @@ function woocommerce_coupon_sales() {
<?php <?php
// Variables // Variables
foreach ( $chart_data as $name => $data ) { foreach ( $chart_data as $name => $data ) {
$varname = str_replace( '-', '_', sanitize_title( $name ) ) . '_data'; $varname = 'coupon_' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data';
echo 'var ' . $varname . ' = jQuery.parseJSON( \'' . json_encode( $data ) . '\' );'; echo 'var ' . $varname . ' = jQuery.parseJSON( \'' . json_encode( $data ) . '\' );';
} }
?> ?>
@ -2458,7 +2458,7 @@ function woocommerce_coupon_sales() {
$labels = array(); $labels = array();
foreach ( $chart_data as $name => $data ) { foreach ( $chart_data as $name => $data ) {
$labels[] = '{ label: "' . esc_js( $name ) . '", data: ' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data }'; $labels[] = '{ label: "' . esc_js( $name ) . '", data: ' . 'coupon_' . str_replace( '-', '_', sanitize_title( $name ) ) . '_data }';
} }
echo implode( ',', $labels ); echo implode( ',', $labels );

View File

@ -152,6 +152,7 @@ Yes you can! Join in on our [GitHub repository](http://github.com/woothemes/wooc
= 1.7.0 = = 1.7.0 =
* Feature - Added sales by category report. * Feature - Added sales by category report.
* Feature - Added sales by coupon report (kudos Max Rice).
* Feature - Multiple downloadable files per product/variation (kudos Justin Stern). * Feature - Multiple downloadable files per product/variation (kudos Justin Stern).
* Feature - Download expiry for variations (kudos niravmehta). * Feature - Download expiry for variations (kudos niravmehta).
* Feature - Added wildcard support to local delivery postcodes. * Feature - Added wildcard support to local delivery postcodes.