• Resolved cwebb41

    (@cwebb41)


    Would like to ouput different layers when certain conditions are met…..

    <?php
    if($item->product_id == ‘2’){
    if($item->quantity == ‘2’) echo ‘<img src=”ticket7.jpg”>’;
    echo <div id=”Layer1″ <?php echo $order->bill_first_name ?> </div>

    elseif($item->quantity == ‘5’) echo ‘<img src=”ticket8.jpg” >’;
    echo <div id=”Layer2″ <?php echo $order->bill_first_name ?> </div>

    else echo ‘<img src=”ticket9.jpg” width=”208″ height=”293″>’;
    echo <div id=”Layer3″ <?php echo $order->bill_first_name ?> </div>
    }
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • start by fixing the php syntax errors;

    possibly (?):

    <?php
    if($item->product_id == '2'){
    if($item->quantity == '2') { echo '<img src="ticket7.jpg">';
    echo '<div id="Layer1"> '. $order->bill_first_name . '</div>'; }
    
    elseif($item->quantity == '5') { echo '<img src="ticket8.jpg" >';
    echo '<div id="Layer2"> ' . $order->bill_first_name . '</div>'; }
    
    else { echo '<img src="ticket9.jpg" width="208" height="293">';
    echo '<div id="Layer3"> ' . $order->bill_first_name . '</div>'; }
    }
    ?>
    Thread Starter cwebb41

    (@cwebb41)

    Very good!……..works beautifully…..thanks a million.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘IF condition for div layers?’ is closed to new replies.