AnsweredAssumed Answered

If else statements in Logic hooks.php

Question asked by Yuenchee Chan on Jul 30, 2015
Latest reply on Jul 30, 2015 by Yuenchee Chan
Why does only the "else" values works and not the "if" and "elseif" ?

My codes are:
$add_points = 0;  $quantity = 0;
  //assign points to items//
           if (redemption_items_c == "voucher") {
     $add_points = $add_points + 200;
     } elseif (redemption_items_c == "umbrella") {
     $add_points = $add_points + 100; 
     } else {
     $add_points = $add_points + 10;
     }
     
  //assign points to quantity//
     if (quantity_c == "1") {
     $quantity = $quantity + 1;
     } elseif (quantity_c == "2") {
     $quantity = $quantity + 2;
     } else {
     $quantity = $quantity + 3;
     }

Outcomes