macjo Posted March 22, 2018 Share Posted March 22, 2018 Hey, So here is my question. I'm currently connecting our ERP system to PrestaShop threw modules. I was able to transfert our products, customers and I'm able to change the order id state. Now I'm having a bit of struggle with the Customer groups(create and update) and modifying the quantities of an order(the reason for this is some of our clients sell products that are weight variable so if the client asks for 1kg but we can only sell that item with 900g then we need to change it in the order). As anyone ever done this or can link me to a topic that talks about this? Thank you in advance. Link to comment Share on other sites More sharing options...
macjo Posted March 26, 2018 Author Share Posted March 26, 2018 Anyone? Link to comment Share on other sites More sharing options...
macjo Posted July 12, 2018 Author Share Posted July 12, 2018 Here is the solution to my own question. Feel free to write me if you have any questions public function modifyItemInOrder($order_id, $order_param) { if ($order_id) { $order_detail = new OrderDetail($order_id); $order_detail->total_price_tax_incl = $order_param->total_price_tax_incl; $order_detail->total_price_tax_excl = $order_param->total_price_tax_excl; $order_detail->total_shipping_price_tax_incl = $order_param->total_shipping_price_tax_incl; $order_detail->total_shipping_price_tax_excl = $order_param->total_shipping_price_tax_incl; $order_detail->product_quantity = $order_param->product_quantity; $order_detail->update(); } } Cheers 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