Fix/37785 cash on delivery not showing (#37927)

* Mkae sure the date_column_name default matches that of stats

* Add changelog

* Fix test
This commit is contained in:
louwie17 2023-04-21 14:44:58 -03:00 committed by GitHub
parent bf8d19e35a
commit 07fc512429
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: minor
Type: fix
Sync up date_column_name default for orders table, between stats and table data.

View File

@ -23,7 +23,7 @@ class DataStore extends ReportsDataStore implements DataStoreInterface {
* Dynamically sets the date column name based on configuration
*/
public function __construct() {
$this->date_column_name = get_option( 'woocommerce_date_type', 'date_created' );
$this->date_column_name = get_option( 'woocommerce_date_type', 'date_paid' );
parent::__construct();
}

View File

@ -414,6 +414,7 @@ class WC_Admin_Tests_API_Reports_Orders extends WC_REST_Unit_Test_Case {
* See: https://github.com/woocommerce/woocommerce-admin/issues/5803#issuecomment-738403405.
*/
public function test_order_price_formatting_with_different_base_currency() {
update_option( 'woocommerce_date_type', 'date_created' );
wp_set_current_user( $this->user );
WC_Helper_Reports::reset_stats_dbs();