samedi 2 mai 2015

prestashop smarty if statement

Consider

$price = 100; $cprice = 50;

if(logged)
{ if (!$specific_price || $specific_price['cprice'] < 0) $price = (float)$result['cprice'];

        else
            $price = (float)$specific_price['cprice'];
    }
    else
        {
        if (!$specific_price || $specific_price['price'] < 0)
            $price = (float)$result['price'];

        else
            $price = (float)$specific_price['price'];
    }

i have coded this way and the first condition works and the statement executes and for the second condition also the first statements are executing. please help me out guys.

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire