xabikip Posted March 4, 2014 Share Posted March 4, 2014 ¿Como podria hacer para ver las lineas de un pedido desde el hookPaymentConfirmation? Estoy desarrollando un modulo personalizado y necesito ver las lineas del detalle de pedido desde este hook. ¿Como coger datos desde OrderDetail utilizando el $paramas de este hook? Link to comment Share on other sites More sharing options...
Enrique Gómez Posted March 4, 2014 Share Posted March 4, 2014 (edited) Seria algo así public function hookActionPaymentConfirmation($params){ $id_order=($params["id_order"]); $detail_list = Db::getInstance()->executeS('SELECT * FROM `'._DB_PREFIX_.'order_detail` WHERE `id_order` = '.(int)$id_order); foreach ($detail_list as $detail){ .............etc } ..................etc } Edited March 4, 2014 by Enrique Gómez (see edit history) 1 Link to comment Share on other sites More sharing options...
xabikip Posted March 5, 2014 Author Share Posted March 5, 2014 Al final, leyendo la docu oficial he encontrado esta manera. Que es lo mismo pero me parece mas ordenado: public static function get_order_details($id_order){ $sql = new DbQuery(); $sql->select('*'); $sql->from('order_detail'); $sql->where('id_order = '.$id_order.''); $sql->orderBy('id_order_detail'); return Db::getInstance()->executeS($sql); } public function hookActionPaymentConfirmation($params){ $id_order = $params['id_order']; $detail_list = $this->get_order_details($id_order); foreach ($detail_list as $detail){ //Aqui lo tenga que hacer } } Gracias Enrique de nuevo. Un saludo ;-) 1 Link to comment Share on other sites More sharing options...
Recommended Posts