2016-07-08 17:51:48 +02:00
< ? php
if ( ! defined ( '_PS_VERSION_' ))
exit ;
class BlockOrderSummary extends Module {
private $types = array ();
public function __construct () {
$this -> name = 'blockordersummary' ;
$this -> tab = 'front_office_features' ;
$this -> version = '1.0' ;
$this -> author = 'Antadis' ;
$this -> need_instance = 0 ;
parent :: __construct ();
$this -> displayName = $this -> l ( 'Order summary block' );
$this -> description = $this -> l ( 'Displays a summary of the current order' );
}
2016-10-14 18:30:05 +02:00
private $hooks = array (
'rightColumnSav' => array ( 'BO SAV right column' , 'Allow to add information in right column of SAV message thread' ),
);
2016-07-08 17:51:48 +02:00
public function install () {
2016-10-14 18:30:05 +02:00
foreach ( $this -> hooks as $k => $v ) {
if ( count ( Db :: getInstance () -> ExecuteS ( '
SELECT `id_hook`
FROM `'._DB_PREFIX_.'hook`
WHERE `name` = " '. $k .' "
LIMIT 1
' )) == 0 ) {
Db :: getInstance () -> ExecuteS ( '
INSERT INTO `'._DB_PREFIX_.'hook`
VALUES ( DEFAULT , " '. $k .' " , " '. $v[0] .' " , " '. $v[1] .' " , 0 , 0 )
' );
}
}
$install_success = parent :: install ();
if ( $install_success ) {
foreach ( $this -> hooks as $k => $v ) {
$install_success = $this -> registerHook ( $k );
if ( ! $install_success ) {
break ;
}
}
}
return $install_success && $this -> registerHook ( 'leftColumn' );
2016-07-08 17:51:48 +02:00
}
public function hookLeftColumn ( $params ) {
global $cookie , $smarty , $cart ;
if (( $step = ( int ) Tools :: getValue ( 'step' )) && ( $step == 3 || $step == 4 )) {
2016-10-14 18:30:05 +02:00
$data = $this -> getOrderDetail ( $cart , $cookie -> id_lang );
$smarty -> assign ( array (
'order_address' => $data [ 'order_address' ],
'carrier_name' => $data [ 'carrier_name' ],
'delay_name' => $data [ 'delay_name' ],
'delivery_date' => ( isset ( $data [ 'delivery_date' ]) ? $data [ 'delivery_date' ] : null )
));
return $this -> display ( __FILE__ , 'blockordersummary.tpl' );
}
}
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
public function hookRightColumn ( $params ) {
return $this -> hookLeftColumn ( $params );
}
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
public function hookRightColumnSav ( $params ) {
2016-10-26 16:54:52 +02:00
global $cookie ;
2016-11-24 16:04:13 +01:00
if ( isset ( $params [ 'customer' ])) {
$orders = Order :: getCustomerOrders ( $params [ 'customer' ] -> id );
}
if ( ! empty ( $orders )) {
if ( ! isset ( $params [ 'order' ])) {
$params [ 'order' ] = new Order (( int ) $orders [ 0 ][ 'id_order' ]);
}
2016-10-17 17:29:37 +02:00
$cart = new Cart (( int ) $params [ 'order' ] -> id_cart );
2016-10-26 16:54:52 +02:00
$data = $this -> getOrderDetail ( $cart ,( int ) $cart -> id_lang , $params [ 'order' ]);
2016-10-17 17:29:37 +02:00
echo " <style type='text/css'>
#blockordersummary {
width : 300 px ;
background : #fff;
padding - bottom : 5 px ;
2016-11-24 16:04:13 +01:00
padding - top : 5 px ;
2016-10-17 17:29:37 +02:00
margin - bottom : 20 px ;
- moz - box - shadow : 1 px 1 px 2 px 2 px #cccccc;
- webkit - box - shadow : 1 px 1 px 2 px 2 px #ccc;
- ms - box - shadow : 1 px 1 px 2 px 2 px #cccccc;
- o - box - shadow : 1 px 1 px 2 px 2 px #cccccc;
box - shadow : 1 px 1 px 2 px 2 px #ccc;
clear : both ;
}
#blockordersummary .content {
padding : 5 px ;
}
#blockordersummary .content div{
color : #1e1633;
margin : 0 px 5 px ;
font - size : 12 px ;
padding : 8 px 0 px 5 px ;
border - top : 1 px dashed #ccc;
line - height : 1.4 em ;
}
2016-10-26 16:54:52 +02:00
#blockordersummary .content div.order-info{
2016-10-17 17:29:37 +02:00
border - top : 1 px solid #ccc;
}
#blockordersummary h4{
display : block ;
font - size : 18 px ;
color : #796dc7;
font - weight : normal ;
margin : 0 px 5 px 2 px ;
padding : 12 px 0 px 10 px ;
border - bottom : 1 px solid #ccc;
}
#blockordersummary h5 {
color : #444d52;
font - family : georgia , times new roman , serif ;
margin - bottom : 10 px ;
font - weight : 600 ;
font - size : 13 px ;
}
#blockordersummary ul {
margin : 0 px 0 px 7 px ;
padding : 0 px ;
list - style : none ;
border - bottom : 1 px solid #999;
}
#blockordersummary li {
padding - bottom : 5 px ;
}
#blockordersummary p {
margin - bottom : 5 px ;
}
#blockordersummary p.carrier-info:after{
content : '' ;
display : block ;
clear : both ;
}
#blockordersummary span.carrier-name {
float : left ;
max - width : 130 px ;
}
#blockordersummary p.delivery-delay {
color : #e36ea2;
font - weight : 600 ;
}
#blockordersummary p.delivery-date strong{
font - size : 11 px ;
}
#blockordersummary .price {
float : right ;
}
#blockordersummary .price.price_total {
color : #e36ea2;
font - weight : bold ;
}
#blockordersummary .address {
color : #1e1633;
}
#blockordersummary .order_total {
color : #e36ea2;
padding : 15 px ;
font - size : 14 px ;
font - weight : bold ;
background : rgba ( 226 , 110 , 162 , 0.2 ) ;
}
</ style > " ;
2016-11-04 12:50:34 +01:00
$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' ),
2016-11-24 16:04:13 +01:00
7 => array ( 'anticon-blocked' , 'text-rose' ),
2016-11-04 12:50:34 +01:00
8 => array ( 'anticon-blocked' , 'text-rose' ),
17 => array ( 'anticon-truck' , 'text-orange' ),
18 => array ( 'anticon-warning' , 'text-orange' ),
19 => array ( 'anticon-pause' , 'text-orange' ),
);
2016-10-24 14:27:50 +02:00
$currency = new Currency (( int )( Configuration :: get ( 'PS_CURRENCY_DEFAULT' )));
2016-10-26 16:54:52 +02:00
$currentState = OrderHistory :: getLastOrderState (( int ) $params [ 'order' ] -> id );
$tokenOrders = Tools :: getAdminToken ( 'AdminOrders' . ( int )( Tab :: getIdFromClassName ( 'AdminOrders' )) . ( int )( $cookie -> id_employee ));
2016-11-04 12:50:34 +01:00
$addressDelivery = new Address ( $params [ 'order' ] -> id_address_delivery , ( int )( $cookie -> id_lang ));
$addressInvoice = new Address ( $params [ '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)$params[' 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)$params[' order ' ] -> id
);
2017-01-11 15:33:44 +01:00
$carrier_socol = explode ( ',' , Configuration :: get ( 'ANT_CARRIERS_SOCOL' ));
2016-11-04 12:50:34 +01:00
echo ' < script type = " text/javascript " src = " http://maps.google.com/maps/api/js?sensor=false " ></ script >
< div id = " blockordersummary " >
2016-11-24 16:04:13 +01:00
< div style = " margin:10px auto; " class = " styled-select semi-square bg-purple-light " >
< select name = " summary_id_order " id = " summary_id_order " class = " " > ' ;
foreach ( $orders as $key => $order ) {
2017-02-07 15:37:14 +01:00
echo '<option value="' . $order [ 'id_order' ] . '" ' . (( int ) $order [ 'id_order' ] == ( int ) $params [ 'order' ] -> id ? 'selected="selected"' : '' ) . '">Commande #' . $order [ 'id_order' ] . ' (' . date ( 'd/m/Y' , strtotime ( $order [ 'date_add' ])) . ')</option>' ;
2016-11-24 16:04:13 +01:00
}
echo ' </ select >
</ div >
2016-10-17 17:29:37 +02:00
< div class = " content " >
2016-10-26 16:54:52 +02:00
< 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 >
2016-11-04 12:50:34 +01:00
< p class = " '. $status[$currentState->id] [1].' " >< span class = " anticon '. $status[$currentState->id] [0].' " ></ span > < b > '.$currentState->name.' </ b ></ p > ' ;
if ( count ( $shipping_numbers ) > 0 || count ( $shipping_numbers2 ) > 0 ) {
echo '<h5>' . $this -> l ( 'Shipping numbers' ) . '</h5>' ;
if ( count ( $shipping_numbers ) > 0 ){
foreach ( $shipping_numbers as $key => $number ) {
$date = new DateTime ( $number [ 'date_add' ]);
echo '<p>' . $number [ 'shipping_number' ] . ' ajouté le ' . $date -> format ( 'd/m/Y' ) . '</p>' ;
}
}
if ( count ( $shipping_numbers2 ) > 0 ){
foreach ( $shipping_numbers2 as $key => $number ) {
$date = new DateTime ( $number [ 'date_add' ]);
echo '<p>' . $number [ 'shipping_number' ] . ' ajouté le ' . $date -> format ( 'd/m/Y' ) . '</p>' ;
}
}
}
2016-11-24 16:34:12 +01:00
echo '<h5>' . $this -> l ( 'Paiement' ) . ' </ h5 >
< p >< span class = " anticon anticon-credit-card " ></ span > < b > '.$params[' order ']->payment.' </ b ></ p >
</ div >
2016-10-17 17:29:37 +02:00
< div class = " my-cart " >
2016-10-26 15:11:40 +02:00
< h5 > '.$this->l(' My Cart ').' </ h5 >
2016-10-17 17:29:37 +02:00
< ul > ' ;
foreach ( $cart -> getProducts () as $key => $product ) {
2016-10-25 12:03:06 +02:00
echo '<li>' . $product [ 'quantity' ] . ' x ' . mb_strimwidth ( $product [ 'name' ], 0 , 35 , " ... " ) . ' <span class="price">' . Tools :: displayPrice ( $product [ 'total_wt' ], $currency ) . '</span></li>' ;
2016-10-17 17:29:37 +02:00
}
echo ' </ ul >
2016-10-24 14:27:50 +02:00
< p > '.$this->l(' Products total ').' < span class = " price price_total " > '.Tools::displayPrice($cart->getOrderTotal(TRUE,1),$currency).' </ span ></ p > ' ;
2016-10-17 17:29:37 +02:00
if ( $cart -> getOrderTotal ( TRUE , 2 ) != 0 ){
2016-10-24 14:27:50 +02:00
echo '<p>' . $this -> l ( 'Discounts total' ) . ' <span class="price price_total">' . Tools :: displayPrice ( $cart -> getOrderTotal ( TRUE , 2 ), $currency ) . '</span></p>' ;
2016-10-17 17:29:37 +02:00
}
echo ' </ div >
< div >
< h5 > '.$this->l(' Shipping ').' </ h5 >
2016-10-24 14:27:50 +02:00
< p class = " carrier-info " >< span class = " carrier-name " > '.$data[' carrier_name '].' </ span > < span class = " price price_total " > '.Tools::displayPrice($cart->getOrderTotal(TRUE, 5),$currency).' </ span ></ p >
2016-10-17 17:29:37 +02:00
</ div >
< div >
2017-08-17 11:22:54 +02:00
< h5 > '.$this->l(' Delivery delays ').' </ h5 > ' ;
2016-10-17 17:29:37 +02:00
if ( isset ( $data [ 'delivery_date' ])){
foreach ( $data [ 'delivery_date' ] as $k => $date ) {
2017-08-17 11:22:54 +02:00
echo '<p class="delivery-delay">' . $data [ 'delay_name' ][ $k ] . '</p>' ;
2016-10-17 17:29:37 +02:00
if ( $k == 1 ) {
echo ' < p class = " delivery-date " >
2016-10-26 16:54:52 +02:00
'.$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 >
2016-10-17 17:29:37 +02:00
</ p > ' ;
} elseif ( $k == 5 ){
echo '<p class="delivery-date">' . $this -> l ( 'Livraison prévue avant le' ) . ' <strong>' . $this -> l ( '24/12' ) . '</strong></p>' ;
2016-11-25 10:49:10 +01:00
} elseif ( $k == 8 ){
echo '<p class="delivery-date">' . $this -> l ( 'Envoi en 48h' ) . '</p>' ;
2017-08-17 11:22:54 +02:00
} elseif ( $k == 9 ){
echo '<p class="delivery-date">' . $this -> l ( 'Delai indiqué sur la fiche produit' ) . '</p>' ;
2016-10-17 17:29:37 +02:00
}
2016-10-14 18:30:05 +02:00
}
}
2016-10-17 17:29:37 +02:00
echo ' </ div >
< div >
2016-11-04 12:50:34 +01:00
< h5 > '.$this->l(' My shipping address ').' ' .
(
2016-11-25 11:50:52 +01:00
( $currentState -> id != 8 && $currentState -> id != 18 && in_array (( int ) $params [ 'order' ] -> id_carrier , $carrier_socol ))
2016-11-04 12:50:34 +01:00
? '<a id="modif_address" data-url="scaddressedit.php?id_cart=' . ( int ) $params [ 'order' ] -> id_cart . '"><span class="anticon anticon-pencil" style="font-size: 16px; vertical-align: baseline;cursor:pointer;"></span></a>'
: (
2016-11-25 11:50:52 +01:00
( $currentState -> id != 8 && $currentState -> id != 18 && ! in_array (( int ) $params [ 'order' ] -> id_carrier , $carrier_socol ))
2016-11-04 12:50:34 +01:00
? '<a href="?tab=AdminAddresses&id_address=' . $addressDelivery -> id . '&addaddress&realedit=1&id_order=' . $params [ 'order' ] -> id . ( $addressDelivery -> id == $addressInvoice -> id ? '&address_type=1' : '' ) . '&token=' . Tools :: getAdminToken ( 'AdminAddresses' . ( int )( Tab :: getIdFromClassName ( 'AdminAddresses' )) . ( int )( $cookie -> id_employee )) . '&back=' . urlencode ( $_SERVER [ 'REQUEST_URI' ]) . '"><span class="anticon anticon-pencil" style="font-size: 16px; vertical-align: baseline;cursor:pointer;"></span></a>'
: ''
)
) .
' </ h5 >
2016-10-17 17:29:37 +02:00
< p class = " address " > '.$data[' order_address '].' </ p >
</ div >
< div >
< h5 > '.$this->l(' My payment ').' </ h5 >
2016-10-24 14:27:50 +02:00
< p class = " order_total " > '.$this->l(' Total to pay ').' < span class = " price price_total " > '.Tools::displayPrice($cart->getOrderTotal(TRUE),$currency).' </ span ></ p >
2016-10-17 17:29:37 +02:00
</ div >
2016-10-14 18:30:05 +02:00
</ div >
2016-11-04 12:50:34 +01:00
</ div >
< script >
$ ( document ) . ready ( function () {
$ ( " #modif_address " ) . click ( function (){
url = $ ( this ) . data ( " url " );
var p = window . open ( url , " Modification SoColissimo " , " width=720, height=360, resizable=1, scrollbars=1 " );
return false ;
});
2016-11-24 16:04:13 +01:00
$ ( \ ' #summary_id_order\').change(function() {
$ . ajax ({
url : \ '' . _MODULE_DIR_ . 'blockordersummary/ajax.php' . ' \ ' ,
type : \ ' GET\ ' ,
data : \ 'id_order=\' + $(this).val() + \'&tokenOrder=' . $tokenOrders . '&tokenAddress=' . Tools :: getAdminToken ( 'AdminAddresses' . ( int )( Tab :: getIdFromClassName ( 'AdminAddresses' )) . ( int )( $cookie -> id_employee )) . ' \ ' ,
success : function ( html ) {
$ ( \ ' #blockordersummary .content\').empty();
$ ( \ ' #blockordersummary .content\').html(html);
},
error : function ( xhr ) {
console . log ( JSON . parse ( xhr . responseText ));
}
});
});
2016-11-04 12:50:34 +01:00
});
</ script > ' ;
2016-10-17 17:29:37 +02:00
}
2016-10-14 18:30:05 +02:00
}
2016-10-26 16:54:52 +02:00
public function getOrderDetail ( $cart , $id_lang , $order = null ){
2016-10-14 18:30:05 +02:00
if ( Db :: getInstance () -> getValue ( '
SELECT `id_carrier`
FROM `'._DB_PREFIX_.'carrier`
WHERE `id_carrier` = '.(int) $cart->id_carrier.'
2016-11-04 12:50:34 +01:00
AND `name` LIKE " %colissimo% "
2016-10-14 18:30:05 +02:00
' )) {
$socol = Db :: getInstance () -> getRow ( '
SELECT *
FROM `'._DB_PREFIX_.'socolissimo_delivery_info`
WHERE `id_cart` = '.(int) $cart->id.'
2017-01-30 10:49:05 +01:00
AND `cecountry` IN ( " FR " , " BE " , " ES " )
2016-11-24 16:23:28 +01:00
AND ( `pradress1` != " " OR `pradress2` != " " OR `pradress3` != " " OR `pradress4` != " " )
2016-10-14 18:30:05 +02:00
' );
2016-11-04 13:03:15 +01:00
if ( $order == null && ( int ) $cart -> id_carrier == 87 ) {
$DOM_front = true ;
} else {
$DOM_front = false ;
}
2016-11-04 13:05:25 +01:00
if ( $socol && ! $DOM_front ) {
2016-10-14 18:30:05 +02:00
$order_address = nl2br ( preg_replace ( " /( \r \n ) { 2,}/ " , " \r \n " , implode ( " \r \n " , array (
$socol [ 'cefirstname' ] . ' ' . $socol [ 'cename' ],
$socol [ 'cecompanyname' ],
2016-11-04 13:08:00 +01:00
$socol [ 'prname' ],
2016-10-14 18:30:05 +02:00
$socol [ 'prcompladress' ],
$socol [ 'pradress1' ],
$socol [ 'pradress2' ],
$socol [ 'pradress3' ],
$socol [ 'pradress4' ],
$socol [ 'przipcode' ] . ' ' . $socol [ 'prtown' ],
2017-01-30 10:49:05 +01:00
$socol [ 'cecountry' ],
2016-10-14 18:30:05 +02:00
$socol [ 'cephonenumber' ],
! empty ( $socol [ 'cedoorcode1' ]) ? 'Code porte 1 : ' . $socol [ 'cedoorcode1' ] : '' ,
! empty ( $socol [ 'cedoorcode2' ]) ? 'Code porte 2 : ' . $socol [ 'cedoorcode2' ] : '' ,
$socol [ 'cedeliveryinformation' ],
))));
2016-07-08 17:51:48 +02:00
} else {
2016-11-24 16:04:13 +01:00
if ( $order ) {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $order -> id_address_delivery )));
} else {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $cart -> id_address_delivery )));
}
2016-07-08 17:51:48 +02:00
}
2017-01-11 15:33:44 +01:00
} elseif ( Db :: getInstance () -> getValue ( '
SELECT COUNT ( * )
FROM `'._DB_PREFIX_.'mr_method`
WHERE `id_carrier` = '.(int) $cart->id_carrier.'
' )) {
$mr = Db :: getInstance () -> getRow ( '
SELECT mr_s .*
FROM `' . _DB_PREFIX_ . 'mr_selected` mr_s
WHERE `id_cart` = ' . (int) $cart->id . '
' );
if ( $mr ) {
$order_address = nl2br ( preg_replace ( " /( \r \n ) { 2,}/ " , " \r \n " , implode ( " \r \n " , array (
$mr [ 'MR_Selected_LgAdr1' ],
$mr [ 'MR_Selected_LgAdr2' ],
$mr [ 'MR_Selected_LgAdr3' ] . ' ' . $mr [ 'MR_Selected_LgAdr4' ],
$mr [ 'MR_Selected_CP' ] . ' ' . $mr [ 'MR_Selected_Ville' ],
'FRANCE' ,
))));
} else {
if ( $order ) {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $order -> id_address_delivery )));
} else {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $cart -> id_address_delivery )));
}
}
2016-10-14 18:30:05 +02:00
} else {
2016-11-24 16:04:13 +01:00
if ( $order ) {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $order -> id_address_delivery )));
} else {
$order_address = nl2br ( AddressFormat :: generateAddress ( new Address (( int ) $cart -> id_address_delivery )));
}
2016-10-14 18:30:05 +02:00
}
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
if ( $id_lang == 3 && ( int ) $cart -> id_carrier == 87 ) {
$carrier_name = " SEUR a domicilio " ;
2017-01-30 10:49:05 +01:00
} elseif ( $id_lang == 3 && (( int ) $cart -> id_carrier == 88 || ( int ) $cart -> id_carrier == 89 )) {
$carrier_name = " SEUR puntos de entrega " ;
2016-10-14 18:30:05 +02:00
} else {
$carrier_name = Db :: getInstance () -> getValue ( '
SELECT `name`
FROM `'._DB_PREFIX_.'carrier`
WHERE `id_carrier` = '.(int) $cart->id_carrier.'
' );
}
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
$products_keys = array ();
$products_delays = array ();
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
$products = $cart -> getProducts ();
$i = 0 ;
foreach ( $products as $product ) {
$products_keys [( int ) $product [ 'id_product' ]] = $i ;
$i ++ ;
}
2016-07-08 17:51:48 +02:00
2016-10-14 18:30:05 +02:00
// assign delay to Products
if ( Module :: isInstalled ( 'privatesales_delay' )) {
if ( ! class_exists ( 'SaleDelay' )) {
require_once _PS_ROOT_DIR_ . '/modules/privatesales_delay/saledelay.php' ;
}
$delay_products = SaleDelay :: associateDelay ( $products );
$delays = array_keys ( $delay_products );
2016-10-26 16:54:52 +02:00
if ( $order != null ) {
$date = new DateTime ( $order -> date_add );
} else {
$date = new DateTime ();
}
2016-10-14 18:30:05 +02:00
$delivery_date = SaleDelay :: getDeliveryDate ( $delays , null , $date , true );
2017-08-17 11:22:54 +02:00
$delay_name = array ();
2016-10-14 18:30:05 +02:00
foreach ( $delays as $delay ) {
$row = Db :: getInstance () -> getRow ( '
SELECT l . `name`
FROM `'._DB_PREFIX_.'privatesale_delay_lang` l
WHERE l . `id_lang` = '.(int) $id_lang.'
AND l . `id_delay` = '.(int)$delay.'
' );
2017-08-17 11:22:54 +02:00
$delay_name [( int ) $delay ] = $row [ 'name' ];
2016-07-08 17:51:48 +02:00
}
}
2016-10-14 18:30:05 +02:00
return array (
'order_address' => $order_address ,
'carrier_name' => $carrier_name ,
'delay_name' => $delay_name ,
'delivery_date' => ( isset ( $delivery_date ) ? $delivery_date : null )
);
2016-07-08 17:51:48 +02:00
}
}