aa
This commit is contained in:
@@ -977,8 +977,6 @@ class ArticleFormatter
|
|||||||
$stockInfo = self::getStockInfo($product);
|
$stockInfo = self::getStockInfo($product);
|
||||||
$preorderInfo = self::getPreorderInfo($product);
|
$preorderInfo = self::getPreorderInfo($product);
|
||||||
|
|
||||||
echo "PRODUCT ";
|
|
||||||
dd($product);
|
|
||||||
echo "PREORDERINFO ";
|
echo "PREORDERINFO ";
|
||||||
dd($preorderInfo);
|
dd($preorderInfo);
|
||||||
|
|
||||||
@@ -1145,10 +1143,22 @@ class ArticleFormatter
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static function findInsideProduct($product, $field)
|
private static function findInsideProduct($product, $field)
|
||||||
{
|
{
|
||||||
// Implementation needed - this was referenced but not shown in original code
|
// Se il campo specificato non è presente, restituisce null
|
||||||
return $product[$field] ?? 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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getRigaArticoloByArt($article, $index, $separator)
|
function getRigaArticoloByArt($article, $index, $separator)
|
||||||
|
|||||||
Reference in New Issue
Block a user