From 1185df57699790f20f4ab293ca3f31864e8e195a Mon Sep 17 00:00:00 2001 From: paoloar77 Date: Tue, 18 Jun 2024 09:49:25 +0200 Subject: [PATCH] aa --- app/CustomFuncPao.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index ac0bef22..b631845c 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -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'] . "
"; + echo "Data Pubblicazione: " . $datepubblstr . "
"; + } $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', ''); }