variations

This commit is contained in:
paoloar77
2024-05-18 17:24:49 +02:00
parent 679fd174f0
commit 550e4f085c
2 changed files with 7 additions and 20 deletions

View File

@@ -20,8 +20,8 @@ use Carbon\Carbon;
use Illuminate\Support\Facades\Route;
use Codexshaper\WooCommerce\Facades\WooCommerce;
use App\Models\Post;
use App\Models\PostMeta;
// use App\Models\Post;
// use App\Models\PostMeta;
/*
@@ -6069,23 +6069,9 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
if ($product) {
echo "Prodotto trovato: " . $product['name'] . "<br>";
$post_meta_data = PostMeta::where('post_id', $product_id)->get();
$variations = Variation::all($product->id);
dd($variations);
$stock_status = $post_meta_data['_stock_status'];
echo "Stock Status Iniziale: " . $stock_status;
$campo = '_stock_status';
$valore = 'preorder';
$rowCount = PostMeta::where('post_id', $product_id)
->update([$campo => $valore]);
if ($rowCount > 0) {
echo "*** Nuovo valore: " . $valore . " ***<br> Righe aggiornate: " . $rowCount;
} else {
echo "Errore: Nessuna riga aggiornata";
}
} else {
echo "Il prodotto non esiste";
}