_select .= ', COALESCE(sl.title, a.status) as status_title, sl.description'; $this->_join .= ' LEFT JOIN `' . _DB_PREFIX_ . 'inpost_shipment_status` s ON s.name = a.status LEFT JOIN `' . _DB_PREFIX_ . 'inpost_shipment_status_lang` sl ON sl.id_status = s.id_status AND sl.id_lang = ' . (int) $this->context->language->id; $this->_where .= ' AND a.status NOT IN ("' . implode('","', Status::NOT_SENT_STATUSES) . '")'; } protected function getFieldsList() { $fields = parent::getFieldsList(); return array_merge( array_slice($fields, 0, 2), [ 'status_title' => [ 'title' => $this->module->l('State', self::TRANSLATION_SOURCE), 'type' => 'select', 'list' => $this->getStatusList(), 'filter_key' => 'a!status', 'callback' => 'displayStatus', ], ], array_slice($fields, 2) ); } protected function getStatusList() { $list = []; $collection = new PrestaShopCollection(InPostShipmentStatusModel::class, $this->context->language->id); /** @var InPostShipmentStatusModel $status */ foreach ($collection as $status) { $list[$status->name] = $status->title; } return $list; } public function initBreadcrumbs($tab_id = null, $tabs = null) { parent::initBreadcrumbs($tab_id, $tabs); if (!$this->shopContext->is17()) { $this->breadcrumbs = array_merge([ $this->module->l('InPost shipments', Tabs::TRANSLATION_SOURCE), ], $this->breadcrumbs); } } public function displayStatus($status, $row) { if ($description = $row['description']) { return sprintf( '%s', $description, $status ); } return $status; } }