Пример #1
0
 public function getTableRecentOrders()
 {
     $header = array(array('title' => $this->l('Customer Name'), 'class' => 'text-left'), array('title' => $this->l('Products'), 'class' => 'text-center'), array('title' => $this->l('Total'), 'class' => 'text-center'), array('title' => $this->l('Date'), 'class' => 'text-center'), array('title' => $this->l('Action'), 'class' => 'text-center'));
     $orders = Order::getOrdersWithInformations((int) Configuration::get('DASHPRODUCT_NBR_SHOW_LAST_ORDER', 10));
     $body = array();
     foreach ($orders as $order) {
         $currency = Currency::getCurrency((int) $order['id_currency']);
         $tr = array();
         $tr[] = array('id' => 'firstname_lastname', 'value' => Tools::htmlentitiesUTF8($order['firstname']) . ' ' . Tools::htmlentitiesUTF8($order['lastname']), 'class' => 'text-left');
         $tr[] = array('id' => 'state_name', 'value' => count(OrderDetail::getList((int) $order['id_order'])), 'class' => 'text-center');
         $tr[] = array('id' => 'total_paid', 'value' => Tools::displayPrice((double) $order['total_paid'], $currency), 'class' => 'text-center', 'wrapper_start' => '<span class="badge">', 'wrapper_end' => '<span>');
         $tr[] = array('id' => 'date_add', 'value' => Tools::displayDate($order['date_add']), 'class' => 'text-center');
         $tr[] = array('id' => 'details', 'value' => $this->l('Details'), 'class' => 'text-right', 'wrapper_start' => '<a class="btn btn-default" href="index.php?tab=AdminOrders&id_order=' . (int) $order['id_order'] . '&vieworder&token=' . Tools::getAdminTokenLite('AdminOrders') . '" title="' . $this->l('Details') . '"><i class="icon-search"></i>', 'wrapper_end' => '</a>');
         $body[] = $tr;
     }
     return array('header' => $header, 'body' => $body);
 }
Пример #2
0
 /**
  * Get the an order detail list of the current order
  * @return array
  */
 public function getOrderDetailList()
 {
     return OrderDetail::getList($this->id);
 }
Пример #3
0
 public static function getOrderReason($id_order)
 {
     $reason = '';
     $order_details = OrderDetail::getList($id_order);
     foreach ($order_details as $order_detail) {
         $reason .= $order_detail['product_quantity'] . ' x ' . $order_detail['product_name'] . '; ';
     }
     return Tools::substr($reason, 0, 250);
 }