From d0460c2f086a4d71edeaca8160d9ce64b1f04e7f Mon Sep 17 00:00:00 2001 From: Paul Sealock Date: Wed, 8 Jul 2020 15:25:51 +1200 Subject: [PATCH] Variation Names: Allow long names to be shown (https://github.com/woocommerce/woocommerce-admin/pull/4715) --- .../src/API/Reports/Products/Stats/DataStore.php | 8 ++++++++ .../src/API/Reports/Variations/DataStore.php | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/plugins/woocommerce-admin/src/API/Reports/Products/Stats/DataStore.php b/plugins/woocommerce-admin/src/API/Reports/Products/Stats/DataStore.php index 80a165970d1..facbe2902b1 100644 --- a/plugins/woocommerce-admin/src/API/Reports/Products/Stats/DataStore.php +++ b/plugins/woocommerce-admin/src/API/Reports/Products/Stats/DataStore.php @@ -130,6 +130,14 @@ class DataStore extends ProductsDataStore implements DataStoreInterface { $data = $this->get_cached_data( $cache_key ); if ( false === $data ) { + // Ensure full variation titles are queried. + add_filter( + 'woocommerce_product_variation_title_include_attributes', + function() { + return true; + } + ); + $this->initialize_queries(); $selections = $this->selected_columns( $query_args ); diff --git a/plugins/woocommerce-admin/src/API/Reports/Variations/DataStore.php b/plugins/woocommerce-admin/src/API/Reports/Variations/DataStore.php index dcc9db7bc5d..8bee7ab9f1b 100644 --- a/plugins/woocommerce-admin/src/API/Reports/Variations/DataStore.php +++ b/plugins/woocommerce-admin/src/API/Reports/Variations/DataStore.php @@ -174,6 +174,14 @@ class DataStore extends ReportsDataStore implements DataStoreInterface { * @param array $query_args Query parameters. */ protected function include_extended_info( &$products_data, $query_args ) { + // Ensure full variation titles are queried. + add_filter( + 'woocommerce_product_variation_title_include_attributes', + function() { + return true; + } + ); + foreach ( $products_data as $key => $product_data ) { $extended_info = new \ArrayObject(); if ( $query_args['extended_info'] ) {