From b9998bdcb3bd9c6e781bba67181c4c2ab11c248e Mon Sep 17 00:00:00 2001 From: Jacek Pyziak Date: Thu, 31 Oct 2024 11:53:28 +0100 Subject: [PATCH] Refactor product combination check to ensure it's an array before counting --- autoload/admin/factory/class.ShopProduct.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/admin/factory/class.ShopProduct.php b/autoload/admin/factory/class.ShopProduct.php index 7437b8d..c372c3f 100644 --- a/autoload/admin/factory/class.ShopProduct.php +++ b/autoload/admin/factory/class.ShopProduct.php @@ -263,7 +263,7 @@ class ShopProduct { $product = \shop\Product::getFromCache( $product_id, $lang_id ); - if ( count( $product -> product_combinations ) ) + if ( is_array( $product -> product_combinations ) and count( $product -> product_combinations ) ) { foreach ( $product -> product_combinations as $product_combination ) {