Skip to content

Commit

Permalink
Fix formatting product when variation has no attributes
Browse files Browse the repository at this point in the history
Address #371
  • Loading branch information
tomalec committed Mar 7, 2024
1 parent 7594c1b commit ec9848a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion includes/class-wc-abstract-google-analytics-js.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ec9848a

Please sign in to comment.