Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

admin booking cart listing changes #149

Merged
merged 1 commit into from
Nov 9, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 2 additions & 14 deletions controllers/admin/AdminCartsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,10 @@ public function __construct()
$this->_orderWay = 'DESC';
$this->context = Context::getContext();

$this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total, ca.name carrier,
$this->_select = 'CONCAT(LEFT(c.`firstname`, 1), \'. \', c.`lastname`) `customer`, a.id_cart total,
IF (IFNULL(o.id_order, \''.$this->l('Non ordered').'\') = \''.$this->l('Non ordered').'\', IF(TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', a.`date_add`)) > 86400, \''.$this->l('Abandoned cart').'\', \''.$this->l('Non ordered').'\'), o.id_order) AS status, IF(o.id_order, 1, 0) badge_success, IF(o.id_order, 0, 1) badge_danger, IF(co.id_guest, 1, 0) id_guest';
$this->_join = 'LEFT JOIN '._DB_PREFIX_.'customer c ON (c.id_customer = a.id_customer)
LEFT JOIN '._DB_PREFIX_.'currency cu ON (cu.id_currency = a.id_currency)
LEFT JOIN '._DB_PREFIX_.'carrier ca ON (ca.id_carrier = a.id_carrier)
LEFT JOIN '._DB_PREFIX_.'orders o ON (o.id_cart = a.id_cart)
LEFT JOIN `'._DB_PREFIX_.'connections` co ON (a.id_guest = co.id_guest AND TIME_TO_SEC(TIMEDIFF(\''.pSQL(date('Y-m-d H:i:00', time())).'\', co.`date_add`)) < 1800)';

Expand All @@ -71,7 +70,7 @@ public function __construct()
),
'customer' => array(
'title' => $this->l('Customer'),
'filter_key' => 'c!lastname'
'havingFilter' => true,
),
'total' => array(
'title' => $this->l('Total'),
Expand All @@ -81,12 +80,6 @@ public function __construct()
'align' => 'text-right',
'badge_success' => true
),
'carrier' => array(
'title' => $this->l('Carrier'),
'align' => 'text-left',
'callback' => 'replaceZeroByShopName',
'filter_key' => 'ca!name'
),
'date_add' => array(
'title' => $this->l('Date'),
'align' => 'text-left',
Expand Down Expand Up @@ -923,11 +916,6 @@ public static function getOrderTotalUsingTaxCalculationMethod($id_cart)
return Cart::getTotalCart($id_cart, true, Cart::BOTH_WITHOUT_SHIPPING);
}

public static function replaceZeroByShopName($echo, $tr)
{
return ($echo == '0' ? Carrier::getCarrierNameFromShopName() : $echo);
}

public function displayDeleteLink($token = null, $id, $name = null)
{
// don't display ordered carts
Expand Down