This commit is contained in:
paoloar77
2024-05-21 01:18:26 +02:00
parent 210806f35c
commit b08ba09c78

View File

@@ -10,6 +10,11 @@ function showarray($array)
echo '<pre>' . json_encode($array, JSON_PRETTY_PRINT) . '</pre>';
};
function getarraystr($array)
{
return '<pre>' . json_encode($array, JSON_PRETTY_PRINT) . '</pre>';
};
function isKeyPresent($array, $key)
{
foreach ($array as $item) {
@@ -216,12 +221,12 @@ function loadArticleByIdArticle($id, $checkprevendita = false)
}
$ris = 'Articles:' . PHP_EOL;
$ris .= '<pre>' . print_r($articles, true) . '</pre>'; // Utilizzo di print_r con <pre> per formattare
$ris .= getarraystr($articles); // Converte solo i dati specificati in JSON
$product = Product::where('sku', $id)->first();
$ris .= 'Product:' . PHP_EOL;
$ris .= '<pre>' . print_r($product, true) . '</pre>'; // Utilizzo di print_r con <pre> per formattare
$ris .= 'Product:'. PHP_EOL;
$ris .= getarraystr($product);
return $ris;