public function hookOrderDetailDisplayed($params) { if (!Mondialrelay::isMondialRelayCarrier($params['order']->id_carrier)) { return ''; } $res = Db::getInstance()->getRow(' SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi` FROM `' . _DB_PREFIX_ . 'mr_selected` s WHERE s.`id_cart` = ' . $params['order']->id_cart); if (!$res or $res['MR_Selected_Num'] == 'LD1' or $res['MR_Selected_Num'] == 'LDS') { return ''; } $this->context->smarty->assign(array('mr_addr' => $res['MR_Selected_LgAdr1'] . ($res['MR_Selected_LgAdr1'] ? ' - ' : '') . $res['MR_Selected_LgAdr2'] . ($res['MR_Selected_LgAdr2'] ? ' - ' : '') . $res['MR_Selected_LgAdr3'] . ($res['MR_Selected_LgAdr3'] ? ' - ' : '') . $res['MR_Selected_LgAdr4'] . ($res['MR_Selected_LgAdr4'] ? ' - ' : '') . $res['MR_Selected_CP'] . ' ' . $res['MR_Selected_Ville'] . ' - ' . $res['MR_Selected_Pays'], 'mr_url' => $res['url_suivi'])); return $this->fetchTemplate('/tpl/', 'order_detail'); }
public function hookOrderDetailDisplayed($params) { if (!Mondialrelay::isMondialRelayCarrier($params['order']->id_carrier)) { return; } $sql = ' SELECT s.`MR_Selected_LgAdr1`, s.`MR_Selected_LgAdr2`, s.`MR_Selected_LgAdr3`, s.`MR_Selected_LgAdr4`, s.`MR_Selected_CP`, s.`MR_Selected_Ville`, s.`MR_Selected_Pays`, s.`MR_Selected_Num`, s.`url_suivi`, s.`exp_number`, m.dlv_mode FROM `' . _DB_PREFIX_ . 'mr_selected` s INNER JOIN ' . _DB_PREFIX_ . 'mr_method m ON m.id_mr_method = s.id_method WHERE s.`id_cart` = ' . (int) $params['order']->id_cart; $res = Db::getInstance()->getRow($sql); if (!$res) { return; } $point_relais = $res['MR_Selected_LgAdr1'] . ($res['MR_Selected_LgAdr1'] ? ' <br/> ' : '') . $res['MR_Selected_LgAdr2'] . ($res['MR_Selected_LgAdr2'] ? ' <br/> ' : '') . $res['MR_Selected_LgAdr3'] . ($res['MR_Selected_LgAdr3'] ? ' <br/> ' : '') . $res['MR_Selected_LgAdr4'] . ($res['MR_Selected_LgAdr4'] ? ' <br/> ' : '') . $res['MR_Selected_CP'] . ' ' . $res['MR_Selected_Ville'] . ' <br/> ' . $res['MR_Selected_Pays']; if ($res['dlv_mode'] == 'LD1' || $res['dlv_mode'] == 'LDS' || $res['dlv_mode'] == 'HOM') { $this->context->smarty->assign(array('mr_url' => $res['url_suivi'])); } else { $this->context->smarty->assign(array('mr_addr' => $point_relais, 'mr_url' => $res['url_suivi'])); } return $this->fetchTemplate('/views/templates/front/', 'order_detail'); }