mardi 27 juin 2017

Any integer is less than or equal to 0

I have the following php if statement:

if ( 
    ( 
        ( 
            $order->get_total() >= $_POST["min-order"] && ( 
                isset($_POST["min-order"]) 
                && !empty($_POST["min-order"]) 
            ) 
        ) || empty($_POST["min-order"]) 
    ) && ( 
        ( 
            $order->get_total() <= $_POST["max-order"] && ( 
                isset($_POST["max-order"]) 
                && !empty($_POST["max-order"]) 
            ) 
        ) || empty($_POST["max-order"]) 
    ) 
) {
    //do stuff
}

Somehow if max-order is set to 0, any number is less than or equal to 0. What am I missing here?

Aucun commentaire:

Enregistrer un commentaire