andtrx Posted July 20, 2022 Share Posted July 20, 2022 (edited) I have the following situation: 1. in a 3rd party a client can update a order I sent when it was created in the prestashop website. 2. I check via a cron job if the order has been updated in the 3rd party software and I pull it back in our website. 3. If they added products via the 3rd party software, should I remove all of my products from my order and re-create the order with the products from theirs? Or I can simple update and add what is missing? Currently my codes empties the cart and re-ads the prodcuts. I have all that taken care of.I have an issue though, where the order detail products are not emptied out. I cant find a method that does this.$listOfProducts below shows me the current products that are in the order details, but I dont know how to empty that out. $listOfproducts = OrderDetail::getList((int)$order->NumarComanda); $order_detail = new OrderDetail(null, null, null); $order_detail->createList($prestashopOrder, $cart, 4, $cartProducts); $order_detail_list[] = $order_detail; $order_detail->createList($prestashopOrder, $cart, 4, $cartProducts); Simply add the new products to the order details, but the old ones are not emptied so I end up with the correct price of the order but with too many being shown in the product details. Edited July 20, 2022 by andtrx added tags to post (see edit history) Link to comment Share on other sites More sharing options...
andtrx Posted July 20, 2022 Author Share Posted July 20, 2022 This should be marked as solved, its as easy as doing $order_detail = new OrderDetail($prouctDetail['id_order_detail']); $order_detail->delete(); Thanks Link to comment Share on other sites More sharing options...
Ali Samie Posted July 20, 2022 Share Posted July 20, 2022 @andtrx If it is solved please add "[SOLVED]" at the tip of the title. Thanks 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