test
This commit is contained in:
@@ -6064,7 +6064,7 @@ function showarray($array)
|
|||||||
echo '<pre>' . json_encode($array, JSON_PRETTY_PRINT) . '</pre>';
|
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 {
|
try {
|
||||||
// Aggiorna Preorder
|
// Aggiorna Preorder
|
||||||
$product = Product::where('sku', $idarticolo)->first();
|
$product = Product::where('sku', $idarticolo)->first();
|
||||||
@@ -6082,23 +6082,11 @@ Route::get('/aggiornapreorder/{idarticolo}/{variation_id}', function ($idarticol
|
|||||||
|
|
||||||
$preordine = true;
|
$preordine = true;
|
||||||
|
|
||||||
$data = [
|
$data = [];
|
||||||
'meta_data' => [
|
// $data['_wpro_variable_is_preorder'] = 'true';
|
||||||
[
|
$data['stock_quantity'] = '1000';
|
||||||
'key' => '_wpro_variable_is_preorder',
|
|
||||||
'value' => $preordine,
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'key' => 'stock_quantity',
|
|
||||||
'value' => 1000,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
$updated = Product::updateVariation($product_id, $variation_id, $data);
|
$updated = Product::update($product_id, $data);
|
||||||
|
|
||||||
// $updated = Product::update($product_id, $variation_id, $data);
|
|
||||||
|
|
||||||
|
|
||||||
if ($updated ) {
|
if ($updated ) {
|
||||||
echo "Prodotto Aggiornato correttamente";
|
echo "Prodotto Aggiornato correttamente";
|
||||||
|
|||||||
Reference in New Issue
Block a user