im building module uses hook hookactionorderslipadd();
. in parameters there seems no way obtain id_order_slip required building new orderslip($id_order_slip);
the way see using database query credit slips order , selecting last one. not seem neat. can point me in right direction?
the start of hook:
public function hookactionorderslipadd($params){ $post = tools::getallvalues(); ppp($post); ppp($params); $id_order_slip = '????'; $order_slip = new orderslip($id_order_slip); ppp($order_slip); }
try code.
public function hookactionorderslipadd($params) { $order_slips = orderslip::getordersslip((int)$params['order']->id_customer, (int)$params['order']->id); foreach ($order_slips $order_slip_details) { $order_slip = new orderslip((int)$order_slip_details['id_order_slip']); /* actions. */ } }
Comments
Post a Comment