From 575afc090a1d9acddc11f4400e93b6cf034b19ab Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Sat, 18 May 2024 13:16:38 +0200 Subject: [PATCH] test --- routes/web.php | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/routes/web.php b/routes/web.php index 9f0208f0..dd875d68 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6061,9 +6061,28 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po $product = Product::where('sku', $idarticolo)->first(); if ($product) { - // dd($product); + dd($product); - $metadata = WpPostMeta::where('post_id', $postid)->get(); + $preorder = true; + + if ($preorder) { + $product->stock_status = 'preorder'; + + // Modifica la data di preordine del prodotto (ad esempio impostandola a oggi) + $product->meta_data = [ + [ + 'key' => '_preorder_date', + 'value' => now()->format('Y-m-d H:i:s') + ] + ]; + + // Salva le modifiche + $product->save(); + } + + + $metadata = null; + // $metadata = WpPostMeta::where('post_id', $postid)->get(); if ($metadata) { dd($metadata);