Order Status from completed to processing
-
Hi!
We have installed a new gateaway that allows to pay with credit card, and when someone makes an order, it updates automatically to completed. We want to change that, to processing.
This is the code in the gateaway php
if ($respuesta < 101){
$order = new WC_Order($pedido);
$order->reduce_order_stock();
$order->update_status(‘completed’,__( ‘Awaiting REDSYS payment’, ‘woocommerce’ ));
$this->log->add( ‘redsys’, ‘Operación finalizada. PEDIDO ACEPTADO ‘);
// Remove cart
WC()->cart->empty_cart();
wp_redirect(WC()->plugin_url().”/includes/gateways/redsys/pages/sucess.php?pedido=”.$pedido);
}
else {
$order = new WC_Order($pedido);
$order->update_status(‘cancelled’,__( ‘Awaiting REDSYS payment’, ‘woocommerce’ ));
$this->log->add( ‘redsys’, ‘Operación finalizada. PEDIDO CANCELADO ‘);
wp_redirect(WC()->plugin_url().”/includes/gateways/redsys/pages/failure.php?pedido=”.$pedido);}
Any hint?
- The topic ‘Order Status from completed to processing’ is closed to new replies.