This commit is contained in:
paoloar77
2025-01-16 09:26:46 +01:00
parent d58bd30263
commit 0b4ec86cba

View File

@@ -1143,22 +1143,22 @@ class ArticleFormatter
}
private static function findInsideProduct($product, $field)
{
// Se il campo specificato non è presente, restituisce null
if (!isset($product['meta_data']) || !is_array($product['meta_data'])) {
{
// Se il campo specificato non è presente, restituisce null
if (!isset($product['meta_data']) || !is_array($product['meta_data'])) {
return null;
}
// Cerca nella meta_data il valore corrispondente alla chiave specificata
foreach ($product['meta_data'] as $meta) {
if (isset($meta['key']) && $meta['key'] === $field) {
return $meta['value'];
}
}
// Restituisce null se non trovato
return null;
}
// Cerca nella meta_data il valore corrispondente alla chiave specificata
foreach ($product['meta_data'] as $meta) {
if (isset($meta['key']) && $meta['key'] === $field) {
return $meta['value'];
}
}
// Restituisce null se non trovato
return null;
}
}
function getRigaArticoloByArt($article, $index, $separator)