This commit is contained in:
paoloar77
2024-05-19 13:24:00 +02:00
parent f5c88ec54d
commit 09b661e4fe

View File

@@ -6076,14 +6076,16 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
$product_id = $product['id'];
$sku = $product['sku'];
$campoPreOrder = '_wpro_variable_is_preorder';
if ($product) {
$titolo = $product['name'];
echo "Prodotto trovato: " . $product['name'] . "StockQty = " . $product['stock_quantity'] . "<br>";
if (isKeyPresent($product['meta_data'], '_is_pre_order')) {
$preorder = getValueByKey($product['meta_data'], '_is_pre_order');
if (isKeyPresent($product['meta_data'], $campoPreOrder)) {
$preorder = getValueByKey($product['meta_data'], $campoPreOrder);
}
if ($preorder) {
@@ -6111,7 +6113,7 @@ Route::get('/aggiornapreorder/{idarticolo}/{postid}', function ($idarticolo, $po
$idprodotto = $product['parent_id'];
if ($idprodotto > 0) {
$data['meta_data'] = $product['meta_data'];
updateValueByKey($data['meta_data'], '_is_pre_order', 'true');
updateValueByKey($data['meta_data'], $campoPreOrder, 'true');
echo "<br>Dati da Salvare:";
echo showarray($data);