Merge branch 'ticket-AideContact-SAV' into develop

This commit is contained in:
Marion Muszynski 2016-10-26 16:55:22 +02:00
commit 6f438dfcd8

View File

@ -70,9 +70,10 @@ class BlockOrderSummary extends Module {
}
public function hookRightColumnSav($params) {
global $cookie;
if(isset($params['order'])) {
$cart = new Cart((int)$params['order']->id_cart);
$data = $this->getOrderDetail($cart,(int)$cart->id_lang);
$data = $this->getOrderDetail($cart,(int)$cart->id_lang,$params['order']);
echo "<style type='text/css'>
#blockordersummary {
@ -98,7 +99,7 @@ class BlockOrderSummary extends Module {
border-top: 1px dashed #ccc;
line-height: 1.4em;
}
#blockordersummary .content div.my-cart {
#blockordersummary .content div.order-info{
border-top: 1px solid #ccc;
}
#blockordersummary h4{
@ -166,9 +167,15 @@ class BlockOrderSummary extends Module {
</style>";
$currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT')));
$currentState = OrderHistory::getLastOrderState((int)$params['order']->id);
$tokenOrders = Tools::getAdminToken('AdminOrders'.(int)(Tab::getIdFromClassName('AdminOrders')).(int)($cookie->id_employee));
echo '<div id="blockordersummary">
<div class="content">
<h4>'.$this->l('Summary of my order' ).'</h4>
<h4>'.$this->l('Summary of my order' ).' <a target="_blank" href="?tab=AdminOrders&id_order='.(int)$params['order']->id.'&vieworder&token='.$tokenOrders.'">(#'.(int)$params['order']->id.')</a></h4>
<div class="order-info">
<h5>'.$this->l('Order Status').'</h5>
<p>'.($currentState->id == 8?'<span class="anticon anticon-blocked"></span>':($currentState->id == 18?'<span class="anticon anticon-warning"></span>':'')).' <b>'.$currentState->name.'</b></p>
</div>
<div class="my-cart">
<h5>'.$this->l('My Cart').'</h5>
<ul>';
@ -192,7 +199,7 @@ class BlockOrderSummary extends Module {
foreach($data['delivery_date'] as $k => $date) {
if($k == 1) {
echo '<p class="delivery-date">
'.$this->l('Date de réception prévue entre le').' <strong>'.date('d/m/Y',strtotime($date['date_start'])).'</strong> '.$this->l('et le').' <strong>'.date('d/m/Y',strtotime($date['date_start'])).'</strong>
'.$this->l('Date de réception prévue entre le').' <strong>'.$date['date_start']->format('d/m/Y').'</strong> '.$this->l('et le').' <strong>'.$date['date_end']->format('d/m/Y').'</strong>
</p>';
} elseif ($k == 5){
echo '<p class="delivery-date">'.$this->l('Livraison prévue avant le').' <strong>'.$this->l('24/12').'</strong></p>';
@ -213,7 +220,7 @@ class BlockOrderSummary extends Module {
}
}
public function getOrderDetail($cart,$id_lang){
public function getOrderDetail($cart,$id_lang, $order = null){
if(Db::getInstance()->getValue('
SELECT `id_carrier`
FROM `'._DB_PREFIX_.'carrier`
@ -278,7 +285,11 @@ class BlockOrderSummary extends Module {
$delay_products = SaleDelay::associateDelay($products);
$delays = array_keys($delay_products);
$date = new DateTime();
if ($order!=null) {
$date = new DateTime($order->date_add);
} else {
$date = new DateTime();
}
$delivery_date = SaleDelay::getDeliveryDate($delays, null, $date, true);
foreach($delays as $delay) {