diff --git a/modules/privatesales_delay/delivery_date.tpl b/modules/privatesales_delay/delivery_date.tpl index 39aea658..3a4ffe36 100644 --- a/modules/privatesales_delay/delivery_date.tpl +++ b/modules/privatesales_delay/delivery_date.tpl @@ -1,6 +1,12 @@
- {$date.name} : {l s='Date de réception prévue entre le' mod='privatesales_delay'} {$date.date_start|date_format:'%d/%m/%Y'} {l s='et le' mod='privatesales_delay'} {$date.date_end|date_format:'%d/%m/%Y'} -
-{/foreach} \ No newline at end of file +{foreach from=$delivery_date key=k item=date} + {if $k == 5} ++ {$date.name} : {l s='Date de réception prévue avant le' mod='privatesales_delay'} 24/12/{$date.date_start|date_format:'%Y'} +
+ {else} ++ {$date.name} : {l s='Date de réception prévue entre le' mod='privatesales_delay'} {$date.date_start|date_format:'%d/%m/%Y'} {l s='et le' mod='privatesales_delay'} {$date.date_end|date_format:'%d/%m/%Y'} +
+ {/if} +{/foreach} \ No newline at end of file diff --git a/modules/privatesales_delay/privatesales_delay.php b/modules/privatesales_delay/privatesales_delay.php index 12db162d..76163b22 100755 --- a/modules/privatesales_delay/privatesales_delay.php +++ b/modules/privatesales_delay/privatesales_delay.php @@ -1,9 +1,9 @@ name = 'privatesales_delay'; $this->tab = 'pricing_promotion'; @@ -146,7 +146,7 @@ class PrivateSales_Delay extends Module return TRUE; } - public function hookdeliveryDelay($params) + public function hookdeliveryDelay($params) { global $smarty, $cookie; @@ -163,7 +163,12 @@ class PrivateSales_Delay extends Module $products = $order->getProducts(); $products = SaleDelay::associateDelay($products); $delays = array_keys($products); - $delivery_date = SaleDelay::getDeliveryDate($delays, $cookie->id_lang, null, true); + if ($order!=null) { + $date = new DateTime($order->date_add); + } else { + $date = new DateTime(); + } + $delivery_date = SaleDelay::getDeliveryDate($delays, $cookie->id_lang, $date, true); $smarty->assign(array( 'delivery_date' => $delivery_date