This commit is contained in:
paoloar77
2025-01-16 09:37:27 +01:00
parent 0130ad9c92
commit 114cdf8ea5

View File

@@ -977,8 +977,9 @@ class ArticleFormatter
$stockInfo = self::getStockInfo($product); $stockInfo = self::getStockInfo($product);
$preorderInfo = self::getPreorderInfo($product); $preorderInfo = self::getPreorderInfo($product);
// echo "PREORDERINFO "; echo "PREORDERINFO " . $article->IdArticolo;
// dd($preorderInfo);
dd($preorderInfo);
return self::formatArticleRow( return self::formatArticleRow(
$article, $article,
@@ -1146,17 +1147,16 @@ class ArticleFormatter
{ {
try { try {
// Se il campo specificato non è presente, restituisce null // Se il campo specificato non è presente, restituisce null
if (!isset($product->meta_data) || !is_array($product->meta_data)) { if (!isset($product['meta_data']) || !is_array($product['meta_data'])) {
return null; return null;
} }
// Cerca nella meta_data il valore corrispondente alla chiave specificata foreach ($product['meta_data'] as $item) {
foreach ($product->meta_data as $meta) { if (isset($item->key) && $item->key === $field) {
if (isset($meta->key) && $meta->key === $field) { return $item->value;
return $meta->value; // Accedi come oggetto
} }
} }
// Restituisce null se non trovato // Restituisce null se non trovato
return null; return null;
} catch (Exception $e) { } catch (Exception $e) {