Use appli col in ps_orders to know if the order is passed on mobile
website
This commit is contained in:
parent
055a403a6e
commit
d5b292d911
@ -44,7 +44,7 @@ class AdminOrders extends AdminTab
|
||||
os.`color`,
|
||||
IF(
|
||||
(SELECT COUNT(so.id_order) FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer) > 1
|
||||
AND (SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer ORDER BY so.date_add ASC LIMIT 1) != a.id_order
|
||||
AND (SELECT so.id_order FROM `'._DB_PREFIX_.'orders` so WHERE so.id_customer = a.id_customer ORDER BY so.date_add ASC LIMIT 1) != a.id_order
|
||||
, 0, 1) as new,
|
||||
(SELECT COUNT(od.`id_order`) FROM `'._DB_PREFIX_.'order_detail` od WHERE od.`id_order` = a.`id_order` GROUP BY `id_order`) AS product_number,
|
||||
a.id_order AS `mixed`,
|
||||
@ -72,13 +72,16 @@ class AdminOrders extends AdminTab
|
||||
foreach(Country::getCountries((int) $cookie->id_lang, TRUE) as $country) {
|
||||
$country_array[(int) $country['id_country']] = $country['name'];
|
||||
}
|
||||
$appliArray = array(
|
||||
|
||||
$deviceList = array(
|
||||
0 => 'Site',
|
||||
1 => 'Appli'
|
||||
1 => 'Appli',
|
||||
2 => 'Mobile',
|
||||
);
|
||||
|
||||
foreach ($states AS $state)
|
||||
|
||||
foreach ($states AS $state){
|
||||
$statesArray[$state['id_order_state']] = $state['name'];
|
||||
}
|
||||
|
||||
$carriers = Db::getInstance()->ExecuteS('
|
||||
SELECT c.`id_carrier`, IF(c.`name` = "0", "'.Configuration::get('PS_SHOP_NAME').'", c.`name`) AS `name`'.($this->cursale !== NULL? ', (
|
||||
@ -91,20 +94,22 @@ class AdminOrders extends AdminTab
|
||||
foreach ($carriers as $row) {
|
||||
$carriersArray[(int)$row['id_carrier']] = $row['name'];
|
||||
}
|
||||
|
||||
$this->fieldsDisplay = array(
|
||||
'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'new' => array('title' => $this->l('New'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'filter_key' => 'new', 'tmpTableFilter' => true, 'icon' => array(0 => 'blank.gif', 1 => 'news-new.gif'), 'orderby' => false),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 100, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'price' => true, 'currency' => true),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 80),
|
||||
'osname' => array('title' => $this->l('Status'), 'widthColumn' => 200, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200),
|
||||
'id_carrier' => array('title' => $this->l('Carrier'), 'align' => 'center', 'width' => 80, 'callback' => 'printCarrier', 'orderby' => false, 'type' => 'select', 'select' => $carriersArray, 'filter_key' => 'a!id_carrier', 'filter_type' => 'int'),
|
||||
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'),
|
||||
//'mixed' => array('title' => $this->l('Mixed'), 'callback' => 'printMixedSale', 'orderby' => false, 'search' => false),
|
||||
'id_pdf' => array('title' => $this->l('PDF'), 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false),
|
||||
'id_country' => array('title' => $this->l('Pays'), 'callback' => 'printCountry', 'orderby' => false, 'type' => 'select', 'select' => $country_array, 'filter_key' => 'x!id_country', 'filter_type' => 'int', 'width' => 35,),
|
||||
'appli' => array('title' => $this->l('Appli'), 'width' => 25, 'align' => 'center', 'type' => 'select', 'select' => $appliArray, 'filter_key' => 'a!appli', 'callback' => 'printAppliIcons', 'orderby' => false),
|
||||
'id_order' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||
'new' => array('title' => $this->l('New'), 'width' => 25, 'align' => 'center', 'type' => 'bool', 'filter_key' => 'new', 'tmpTableFilter' => true, 'icon' => array(0 => 'blank.gif', 1 => 'news-new.gif'), 'orderby' => false),
|
||||
'customer' => array('title' => $this->l('Customer'), 'widthColumn' => 100, 'width' => 140, 'filter_key' => 'customer', 'tmpTableFilter' => true),
|
||||
'total_paid' => array('title' => $this->l('Total'), 'width' => 70, 'align' => 'right', 'prefix' => '<b>', 'suffix' => '</b>', 'price' => true, 'currency' => true),
|
||||
'payment' => array('title' => $this->l('Payment'), 'width' => 80),
|
||||
'osname' => array('title' => $this->l('Status'), 'widthColumn' => 200, 'type' => 'select', 'select' => $statesArray, 'filter_key' => 'os!id_order_state', 'filter_type' => 'int', 'width' => 200),
|
||||
'id_carrier' => array('title' => $this->l('Carrier'), 'align' => 'center', 'width' => 80, 'callback' => 'printCarrier', 'orderby' => false, 'type' => 'select', 'select' => $carriersArray, 'filter_key' => 'a!id_carrier', 'filter_type' => 'int'),
|
||||
'date_add' => array('title' => $this->l('Date'), 'width' => 35, 'align' => 'right', 'type' => 'datetime', 'filter_key' => 'a!date_add'),
|
||||
//'mixed' => array('title' => $this->l('Mixed'), 'callback' => 'printMixedSale', 'orderby' => false, 'search' => false),
|
||||
'id_pdf' => array('title' => $this->l('PDF'), 'callback' => 'printPDFIcons', 'orderby' => false, 'search' => false),
|
||||
'id_country' => array('title' => $this->l('Pays'), 'callback' => 'printCountry', 'orderby' => false, 'type' => 'select', 'select' => $country_array, 'filter_key' => 'x!id_country', 'filter_type' => 'int', 'width' => 35,),
|
||||
'appli' => array('title' => $this->l('Device'), 'width' => 25, 'align' => 'center', 'type' => 'select', 'select' => $deviceList, 'filter_key' => 'a!appli', 'callback' => 'printDeviceIcons', 'orderby' => false),
|
||||
);
|
||||
|
||||
parent::__construct();
|
||||
|
||||
if(!isset($_POST['submitFilter']) && !isset($_POST['orderFilter_a!date_add'])) {
|
||||
|
@ -92,7 +92,25 @@ class Order extends OrderCore {
|
||||
|
||||
public function printAppliIcons($value, $params)
|
||||
{
|
||||
$name = ((int)$value?'mobile':'computer');
|
||||
$name = ((int)$value?'mobile':'computer');
|
||||
return '<img src="/img/'.$name.'.png" alt="" width="18px"/>';
|
||||
}
|
||||
|
||||
public function printDeviceIcons($value, $params)
|
||||
{
|
||||
switch($value) {
|
||||
default:
|
||||
case 0:
|
||||
$name = 'computer';
|
||||
break;
|
||||
case 1:
|
||||
$name = 'application';
|
||||
break;
|
||||
case 2:
|
||||
$name = 'mobile';
|
||||
break;
|
||||
}
|
||||
|
||||
return '<img src="/img/'.$name.'.png" alt="" width="18px"/>';
|
||||
}
|
||||
|
||||
@ -108,7 +126,6 @@ class Order extends OrderCore {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static function getTotalbyDate($date_start, $date_end, $state = 0){
|
||||
if($state == 0){
|
||||
if($date_start == $date_end){
|
||||
|
@ -18,11 +18,15 @@
|
||||
$message = "Problème de sercure_key. A valider manuellement" . "\n\n" . $message;
|
||||
Logger::addLog('Invalid secure_key', 4, '0000001', 'Cart', intval($id_cart));
|
||||
}
|
||||
|
||||
|
||||
// Copying data from cart
|
||||
$order = new Order();
|
||||
$order->appli = Tools::isApi() ? 1 : 0;
|
||||
$order->mobile = Tools::isMobile() ? 1 : 0;
|
||||
$order->appli = 0;
|
||||
if (Tools::isApi()) {
|
||||
$order->appli = 1;
|
||||
} elseif (Tools::isMobile()) {
|
||||
$order->appli = 2;
|
||||
}
|
||||
$order->id_carrier = (int)($cart->id_carrier);
|
||||
$order->id_customer = (int)($cart->id_customer);
|
||||
$order->id_address_invoice = (int)($cart->id_address_invoice);
|
||||
|
Loading…
Reference in New Issue
Block a user