This commit is contained in:
paoloar77
2024-06-18 09:49:25 +02:00
parent bab1bd79ba
commit 1185df5769

View File

@@ -138,12 +138,16 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
$datepubbl = DateTime::createFromFormat('d-m-Y', $article->DataPubblicazione);
$datepubblstr = $datepubbl->format('Y-m-d');
$label_prenotalo_con_data = 'Prenotalo per riceverlo entro il ' . $article->DataPubblicazione;
if ($idprodotto > 0) {
if ($debug)
if ($debug) {
echo "Variazioni: " . $product['parent_id'] . "<br>";
echo "Data Pubblicazione: " . $datepubblstr . "<br>";
}
$variations = Variation::all($product['parent_id']);
if ($debug)
showarray($variations);
@@ -168,7 +172,7 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
if ($agg) {
updateValueByKey($data['meta_data'], $campoPreOrder, 'yes');
updateValueByKey($data['meta_data'], '_is_pre_order', 'yes');
updateValueByKey($data['meta_data'], '_pre_order_date', $datepubbl);
updateValueByKey($data['meta_data'], '_pre_order_date', $datepubblstr);
updateValueByKey($data['meta_data'], '_wpro_date_label_variable', $label_prenotalo_con_data);
updateValueByKey($data['meta_data'], '_wpro_no_date_label_variable', '');
updateValueByKey($data['meta_data'], '_wpro_manage_price_variable', '');
@@ -176,7 +180,7 @@ function setPreOrder($sku, $aggiornapreordine, $debug)
updateValueByKey($data['meta_data'], '_wpro_label_variable', 'Pre Ordinalo!');
updateValueByKey($data['meta_data'], '_wpro_price_type_variable', 'manual');
updateValueByKey($data['meta_data'], '_wpro_amount_price_variable', 'fixed');
updateValueByKey($data['meta_data'], '_wpro_date_variable', $datenow);
updateValueByKey($data['meta_data'], '_wpro_date_variable', $datepubblstr);
updateValueByKey($data['meta_data'], '_wpro_time_variable', '');
updateValueByKey($data['meta_data'], '_rank_math_gtin_code', '');
}