diff --git a/routes/web.php b/routes/web.php index feb7c656..75fe6173 100644 --- a/routes/web.php +++ b/routes/web.php @@ -6064,7 +6064,7 @@ function showarray($array) echo '
' . json_encode($array, JSON_PRETTY_PRINT) . ''; }; -Route::get('/aggiornapreorder/{idarticolo}/{variation_id}', function ($idarticolo, $variation_id) { +Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $postid) { try { // Aggiorna Preorder $product = Product::where('sku', $idarticolo)->first(); @@ -6082,23 +6082,11 @@ Route::get('/aggiornapreorder/{idarticolo}/{variation_id}', function ($idarticol $preordine = true; - $data = [ - 'meta_data' => [ - [ - 'key' => '_wpro_variable_is_preorder', - 'value' => $preordine, - ], - [ - 'key' => 'stock_quantity', - 'value' => 1000, - ], - ] - ]; + $data = []; + // $data['_wpro_variable_is_preorder'] = 'true'; + $data['stock_quantity'] = '1000'; - $updated = Product::updateVariation($product_id, $variation_id, $data); - - // $updated = Product::update($product_id, $variation_id, $data); - + $updated = Product::update($product_id, $data); if ($updated ) { echo "Prodotto Aggiornato correttamente";