9d7e503519
* Include fields date_paid and date_completed to wp_wc_order_stats TODO: add script to create new columns in the database * Add update script and new columns in get_schema * Add new configuration in Analytics > Settings to configure type of date used in Revenue report * Change date_column_name to date_paid TODO: This will be configurable in future * Add date type config field * Use customizable date field in DataStore * Change label * Fix linter errors * Remove blank line * Put default column name back to date_created * Make date_paid and date_completed nullable to help with unit tests * Remove new table creation in update function and use query method instead of get_var * Extend stats constructor * Improve date type configuration description * Set date column name default to date_created to test if build passes * Fix phpcs issue on constructor * Remove cache bypass added by mistake * Improve changelog * Fill date_paid and date_completed for refunds to avoid problems whem they are being used to sort Fix unit tests when date_paid or date_completed are being used as sort date * Change default to date_created * Bump update script to 7.5.0 * Add prefix and postmeta variables for script |
||
---|---|---|
.. | ||
historical-data | ||
README.md | ||
config.js | ||
default-date.js | ||
index.js | ||
index.scss | ||
setting.js | ||
setting.scss |
README.md
Settings
The settings used to modify the way data is retreived or displayed in WooCommerce reports.
Extending Settings
Settings can be added, removed, or modified outside oc wc-admin
by hooking into woocommerce_admin_analytics_settings
. For example:
addFilter( 'woocommerce_admin_analytics_settings', 'wc-example/my-setting', settings => {
return [
...settings,
{
name: 'custom_setting',
label: __( 'Custom setting:', 'woocommerce' ),
inputType: 'text',
helpText: __( 'Help text to describe what the setting does.' ),
defaultValue: 'Default value',
},
];
} );
Each settings has the following properties:
name
(string): The slug of the setting to be updated.label
(string): The label used to describe and displayed next to the setting.inputType
(enum: text|checkbox|checkboxGroup): The type of input to use.helpText
(string): Text displayed beneath the setting.options
(array): Array of options used for inputs with selectable options.defaultValue
(string|array): Value used when resetting to default settings.