diff --git a/src/Api/Response/Response.php b/src/Api/Response/Response.php index cbbac5a3..91cee86f 100644 --- a/src/Api/Response/Response.php +++ b/src/Api/Response/Response.php @@ -89,7 +89,7 @@ public function getVariationIds() foreach ($products as $product) { if (isset($product['bestVariant'])) { $ids[] = (int) $product['bestVariant']; - } else if (count($product['variants'])) { + } else if ($product['variants'] && count($product['variants'])) { $ids[] = (int) $product['variants'][0]['id']; } else if (isset($product['properties'][Plugin::API_PROPERTY_VARIATION_ID])) { $ids[] = (int) $product['properties'][Plugin::API_PROPERTY_VARIATION_ID];