id_cart); $data = $module->getOrderDetail($cart,(int)$cart->id_lang,$order); $status = array( 2 => array('anticon-credit-card','text-green-light'), 4 => array('anticon-truck','text-purple-light'), 5 => array('anticon-home3','text-purple'), 6 => array('anticon-blocked','text-rose'), 7 => array('anticon-blocked','text-rose'), 8 => array('anticon-blocked','text-rose'), 17 => array('anticon-truck','text-orange'), 18 => array('anticon-warning','text-orange'), 19 => array('anticon-pause','text-orange'), ); $currency = new Currency((int)(Configuration::get('PS_CURRENCY_DEFAULT'))); $currentState = OrderHistory::getLastOrderState((int)$order->id); $addressDelivery = new Address($order->id_address_delivery, (int)($cart->id_lang)); $addressInvoice = new Address($order->id_address_invoice, (int)($cookie->id_lang)); $shipping_numbers = Db::getInstance()->ExecuteS(' SELECT DISTINCT lpws.`shipping_number`, lpws.`date_add` FROM `'._DB_PREFIX_.'lapostews` lpws LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = lpws.`id_order_detail`) WHERE `id_order` ='. (int)$order->id ); $shipping_numbers2 = Db::getInstance()->ExecuteS(' SELECT DISTINCT ppp.`shipping_number`, ppp.`date_add` FROM `'._DB_PREFIX_.'philea_parcel` ppp LEFT JOIN `'._DB_PREFIX_.'order_detail` od ON (od.`id_order_detail` = ppp.`id_order_detail`) WHERE od.`id_order` ='. (int)$order->id ); //$carrier_socol = array(38,40,45);// local //$carrier_socol = array(45,47,48);// dev $carrier_socol = array(87,88,89);// prod $html = '
'.$currentState->name.'
'; if(count($shipping_numbers) > 0 || count($shipping_numbers2) > 0) { $html .= ''. $number['shipping_number'] .' ajouté le '. $date->format('d/m/Y') .'
'; } } if(count($shipping_numbers2) > 0){ foreach ($shipping_numbers2 as $key => $number) { $date = new DateTime($number['date_add']); $html .= ''. $number['shipping_number'] .' ajouté le '. $date->format('d/m/Y') .'
'; } } } $html .= ''.$order->payment.'
Total produits '.Tools::displayPrice($cart->getOrderTotal(TRUE,1),$currency).'
'; if ($cart->getOrderTotal(TRUE, 2) != 0){ $html .= 'Total réduction '.Tools::displayPrice($cart->getOrderTotal(TRUE,2),$currency).'
'; } $html .= ''.$data['carrier_name'].' '.Tools::displayPrice($cart->getOrderTotal(TRUE, 5),$currency).'
'.$data['delay_name'].'
'; if(isset($data['delivery_date'])){ foreach($data['delivery_date'] as $k => $date) { if($k == 1) { $html .= 'Date de réception prévue entre le '.$date['date_start']->format('d/m/Y').' et le '.$date['date_end']->format('d/m/Y').'
'; } elseif ($k == 5){ $html .= 'Livraison prévue avant le 24/12
'; } elseif ($k == 8){ $html .= 'Envoi en 48h
'; } } } $html .= ''.$data['order_address'].'
Total à régler '.Tools::displayPrice($cart->getOrderTotal(TRUE),$currency).'
Order not found
'; die(); } } else { echo 'An error occured, order not found.
'; die(); } die();