test
This commit is contained in:
@@ -6064,7 +6064,7 @@ function showarray($array)
|
||||
echo '<pre>' . json_encode($array, JSON_PRETTY_PRINT) . '</pre>';
|
||||
};
|
||||
|
||||
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";
|
||||
|
||||
Reference in New Issue
Block a user