test
This commit is contained in:
@@ -27,6 +27,15 @@ function getValueByKey($array, $key)
|
||||
|
||||
// Funzione per aggiornare il valore di un certo key in un array di oggetti
|
||||
function updateValueByKey(&$array, $key, $newValue) {
|
||||
foreach ($array as &$item) {
|
||||
if ($item->key === $key) {
|
||||
$item->value = $newValue;
|
||||
break; // Se trova il key, termina il loop
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateValueByKeyArr(&$array, $key, $newValue) {
|
||||
foreach ($array as &$item) {
|
||||
if ($item['key'] === $key) {
|
||||
$item['value'] = $newValue;
|
||||
|
||||
@@ -6079,7 +6079,7 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
|
||||
if ($product) {
|
||||
$titolo = $product['name'];
|
||||
|
||||
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'];
|
||||
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "<br>";
|
||||
|
||||
|
||||
if (isKeyPresent($product['meta_data'], '_is_pre_order')) {
|
||||
@@ -6088,8 +6088,6 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
|
||||
|
||||
if ($preorder) {
|
||||
echo "<span class='badge badge-success'>PREORDER</span>: " . $preorder;
|
||||
} else {
|
||||
echo "<span class='badge badge-danger'>NO PREORDER</span>: " . $preorder;
|
||||
}
|
||||
echo "<br>";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user