• Resolved mchlbowyer

    (@mchlbowyer)


    Hi, on the line pasted below, is this actually correct?

    if ( $order_status == ‘processing’ && ( $order->get_status() == ‘on-hold’ || $order->get_status() == ‘pending’ || $order->get_status() == ‘failed’ ) )

    From the way I read it, you are checking if the status is processing, but then also saying that the status has to be on-hold, pending or failed? Should it not be

    if ( $order_status == ‘processing’ && !( $order->get_status() == ‘on-hold’ || $order->get_status() == ‘pending’ || $order->get_status() == ‘failed’ ) )

    Unless there is something weird with the way WooCommerce works, I cannot see why you would want to change the status of an on-hold, pending or failed order to completed.

    Thanks,
    Mike

The topic ‘Query of conditional statement in code’ is closed to new replies.