diff --git a/integration/FacebookWordpressWooCommerce.php b/integration/FacebookWordpressWooCommerce.php index 3b0760e7..f1066e21 100644 --- a/integration/FacebookWordpressWooCommerce.php +++ b/integration/FacebookWordpressWooCommerce.php @@ -123,7 +123,8 @@ private static function getProductCategory($product_id){ $product_id, 'product_cat' ); - return count($categories) > 0 ? $categories[0]->name : null; + + return (is_array($categories) && count($categories) > 0) ? $categories[0]->name : null; } public static function trackPurchaseEvent($order_id) {