diff --git a/app/CustomFuncPao.php b/app/CustomFuncPao.php index 0dc3185d..2d4d81fe 100644 --- a/app/CustomFuncPao.php +++ b/app/CustomFuncPao.php @@ -32,6 +32,8 @@ use Illuminate\Support\Facades\Request; define('QTA_IN_PREVENDITA', 10000); define('QTA_MINIMA_PER_PREVENDITA', 9000); +define('CAMPO_PREORDINE','_ywpo_preorder'); + setlocale(LC_TIME, 'it_IT.UTF-8'); function showarray($array) @@ -139,7 +141,7 @@ function setPreOrder($sku, $aggiornapreordine, $debug) } //$campoPreOrder = '_wpro_variable_is_preorder'; - $campoPreOrder = '_ywpo_preorder'; + $campoPreOrder = CAMPO_PREORDINE; if ($product) { $titolo = $product['name']; @@ -221,7 +223,6 @@ 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'], '_ywpo_preorder', 'yes'); updateValueByKey($data['meta_data'], '_pre_order_date', $datepubblstr); updateValueByKey($data['meta_data'], '_ywpo_for_sale_date', $datepubblstr); updateValueByKey($data['meta_data'], '_wpro_date_label_variable', $label_prenotalo_con_data); @@ -1014,8 +1015,8 @@ function getRigaArticoloByArt($article, $ind, $sep) if ($prodotto) { - if (isset($prodotto['_wpro_variable_is_preorder'])) { - $str .= '
PREORDINE: ' . $prodotto['_wpro_variable_is_preorder'] . ''; + if (isset($prodotto[CAMPO_PREORDINE])) { + $str .= '
PREORDINE: ' . $prodotto[CAMPO_PREORDINE] . ''; } if (isset($prodotto['_wpro_label_variable'])) { $str .= 'Etichetta: ' . $prodotto['_wpro_label_variable'];