PrestashopEnthu Posted February 26, 2018 Share Posted February 26, 2018 (edited) I am trying to get the total amount of refund. I have tried the following and successfully achieve 1 item refund amount based on the refund quantity from back-office. Can anyone point out how can I list all the id_order_detail based on the selection from refund checkboxes? It is currently only returning the latest checkbox checked for id_order_detail. I am stuck at this point. My code are as follow: $order = $params['order']; $id_order = (int)$order->id; $order_detail = new OrderDetail((int) $params['id_order_detail']); $products = $order_detail->getList($id_order); $id_order_detail = $order_detail->id; $cancel_quantity = Tools::getValue('cancelQuantity'); $key = array_search($id_order_detail, array_column($products, 'id_order_detail')); $refund = $products[$key]['unit_price_tax_incl'] * (int) $cancel_quantity[$id_order_detail]; Any guidance is truly appreciated. Hope someone has an experience handling this previously. Thank you. Edited February 26, 2018 by Enthu86 (see edit history) Link to comment Share on other sites More sharing options...
jgamio Posted February 27, 2018 Share Posted February 27, 2018 To got information about the returning items you need use the OrdenReturn class I dont sure right now but I think is a function on the Order to return the id to use on the other class Take a look on the OrderReturnController to see how they work Link to comment Share on other sites More sharing options...
PrestashopEnthu Posted February 28, 2018 Author Share Posted February 28, 2018 @jgamio Thanks for the tip. Is there any way I can pass all the values from the selected checkboxes over? I could just loop it over and add the values. I have completed a single item return but failed on multiple currently. Link to comment Share on other sites More sharing options...
jgamio Posted March 4, 2018 Share Posted March 4, 2018 Hi sure is always a way where are you taking the values ? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now