From 09b661e4fe0499db8f28847536758a597f00eccd Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Sun, 19 May 2024 13:24:00 +0200 Subject: [PATCH] preorder --- routes/web.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/routes/web.php b/routes/web.php index 1767fd9a..b77667ac 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6076,14 +6076,16 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po $product_id = $product['id']; $sku = $product['sku']; + $campoPreOrder = '_wpro_variable_is_preorder'; + if ($product) { $titolo = $product['name']; echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "
"; - if (isKeyPresent($product['meta_data'], '_is_pre_order')) { - $preorder = getValueByKey($product['meta_data'], '_is_pre_order'); + if (isKeyPresent($product['meta_data'], $campoPreOrder)) { + $preorder = getValueByKey($product['meta_data'], $campoPreOrder); } if ($preorder) { @@ -6111,7 +6113,7 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po $idprodotto = $product['parent_id']; if ($idprodotto > 0) { $data['meta_data'] = $product['meta_data']; - updateValueByKey($data['meta_data'], '_is_pre_order', 'true'); + updateValueByKey($data['meta_data'], $campoPreOrder, 'true'); echo "
Dati da Salvare:"; echo showarray($data);