fgatica95 Posted April 10, 2013 Share Posted April 10, 2013 (edited) Hello, I need a function or a PHP code that updates the order status tu status #2 (Payment Acepted) I've tried this: <?php require(dirname(__FILE__).'/config/config.inc.php'); $objOrder = new Order(1); //order with id=1 $history = new OrderHistory(); $history->id_order = (int)$objOrder->id; $history->changeIdOrderState(2, (int)($objOrder->id)); //order status=2 echo 'done'; ?> But it dont work (It should update order #1 to status 2). It display done. Prestashop version: 1.4.8.3 Somebody knows how to do it? Thanks in advance! Edited April 10, 2013 by fgatica95 (see edit history) Link to comment Share on other sites More sharing options...
Rafaelcr1 Posted August 21, 2013 Share Posted August 21, 2013 (edited) Hello friend, I also had this problem and managed to solve this: So you need to specify two times the new state : $history = new OrderHistory(); $history->id_order = (int)($id_order); [b]$history->id_order_state = (int)(4);[/b] $history->changeIdOrderState((int)(4), $order); [b]$history->add(true);[/b] More details see this link: http://forge.prestas...owse/PSCFV-5580 After a look at my shop prestashop modules: http://www.rfcmodulos.com.br bye Edited August 21, 2013 by Rafaelcr1 (see edit history) 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