Skip to content

Commit

Permalink
Merge pull request #372 from woocommerce/fix/371-variable-product
Browse files Browse the repository at this point in the history
  • Loading branch information
tomalec authored Mar 7, 2024
2 parents c269948 + 9e09435 commit 7d0cc53
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion includes/class-wc-abstract-google-analytics-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ function ( $item ) {
*
* @param WC_Product $product The product to format.
* @param array|bool $variation An array containing product variation attributes to include in the product data.
* For the "variation" type products, we'll use product->get_attributes.
*
* @return array
*/
Expand All @@ -230,7 +231,7 @@ public function get_formatted_product( WC_Product $product, $variation = false )
$variation = $product->get_attributes();
}

if ( false !== $variation ) {
if ( is_array( $variation ) ) {
$formatted['variation'] = implode(
', ',
array_map(
Expand Down

0 comments on commit 7d0cc53

Please sign in to comment.