From ec9848a97acc33ec24dbe279b7707dcbe7b950fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Wytr=C4=99bowicz?= Date: Thu, 7 Mar 2024 13:42:35 +0100 Subject: [PATCH] Fix formatting product when variation has no attributes Address https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/371 --- includes/class-wc-abstract-google-analytics-js.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-wc-abstract-google-analytics-js.php b/includes/class-wc-abstract-google-analytics-js.php index a71b6109..8543a86e 100644 --- a/includes/class-wc-abstract-google-analytics-js.php +++ b/includes/class-wc-abstract-google-analytics-js.php @@ -230,7 +230,7 @@ public function get_formatted_product( WC_Product $product, $variation = false ) $variation = $product->get_attributes(); } - if ( false !== $variation ) { + if ( false !== $variation && is_array( $variation ) ) { $formatted['variation'] = implode( ', ', array_map(