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

@@ -145,6 +145,7 @@ return [
'prefix_indexes' => true, 'prefix_indexes' => true,
], ],
/*
'wordpress' => [ 'wordpress' => [
'driver' => 'mysql', 'driver' => 'mysql',
'host' => env('WORDPRESS_HOST'), 'host' => env('WORDPRESS_HOST'),
@@ -153,9 +154,9 @@ return [
'username' => env('WORDPRESS_USER'), 'username' => env('WORDPRESS_USER'),
'password' => env('WORDPRESS_PWD'), 'password' => env('WORDPRESS_PWD'),
'charset' => 'utf8', 'charset' => 'utf8',
'collation' => '', 'collation' => 'utf8mb4_unicode_ci',
'prefix' => '', // Prefix della tabella di WordPress 'prefix' => '', // Prefix della tabella di WordPress
] ]*/
], ],

View File

@@ -20,8 +20,8 @@ use Carbon\Carbon;
use Illuminate\Support\Facades\Route; use Illuminate\Support\Facades\Route;
use Codexshaper\WooCommerce\Facades\WooCommerce; use Codexshaper\WooCommerce\Facades\WooCommerce;
use App\Models\Post; // use App\Models\Post;
use App\Models\PostMeta; // use App\Models\PostMeta;
/* /*
@@ -6069,23 +6069,9 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
if ($product) { if ($product) {
echo "Prodotto trovato: " . $product['name'] . "<br>"; 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 { } else {
echo "Il prodotto non esiste"; echo "Il prodotto non esiste";
} }