/** * Display order tracking info * * @param array $params (order, cart) * @return string template rendering */ public function hookOrderDetailDisplayed($params) { global $smarty; $kiala_order = KialaOrder::getByOrder($params['order']->id); if (!Validate::isLoadedObject($kiala_order)) { return false; } $address = new Address($params['order']->id_address_delivery); $kiala_country = KialaCountry::getByIdCountry($address->id_country); $search_by = Configuration::get('KIALA_SEARCH_BY'); if ($search_by == 'customer') { $id = $kiala_order->id_customer; } elseif ($search_by == 'order') { $id = Configuration::get('KIALA_NUMBER_PREFIX') . $kiala_order->id; } else { return false; } $kiala_request = new KialaRequest(); $url = $kiala_request->getTrackingRequest($address, $kiala_country, $params['order']->id_lang, $id, $search_by); $smarty->assign('url_tracking', Tools::safeOutput($url)); return $this->display(__FILE__, 'orderDetail.tpl'); }