Improve product combination check to ensure it's an array before counting

This commit is contained in:
2024-10-31 11:53:07 +01:00
parent ee240f7dbd
commit 55ddfd3a70

View File

@@ -263,7 +263,7 @@ class ShopProduct
{ {
$product = \shop\Product::getFromCache( $product_id, $lang_id ); $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 ) foreach ( $product -> product_combinations as $product_combination )
{ {