{{
if( sfprice_administrator_applicable() && sfprice_get_administrator_price($product) > 0 )
$price = sfprice_get_administrator_price($product);
return $price;
}
{ elseif( sfprice_resellerplus_applicable() && sfprice_get_resellerplus_price($product) > 0 )
$price = sfprice_get_resellerplus_price($product);
return $price;
}
{ elseif( sfprice_reseller_applicable() && sfprice_get_reseller_price($product) > 0 )
$price = sfprice_get_reseller_price($product);
return $price;
}
{ elseif( sfprice_corporateplus_applicable() && sfprice_get_corporateplus_price($product) > 0 )
$price = sfprice_get_corporateplus_price($product);
return $price;
}
{ elseif( sfprice_corporate_applicable() && sfprice_get_corporate_price($product) > 0 )
$price = sfprice_get_corporate_price($product);
return $price;
}
{ else( sfprice_smallbusiness_applicable() && sfprice_get_smallbusiness_price($product) > 0 )
$price = sfprice_get_smallbusiness_price($product);
return $price;
}}
I am sure that this is very wrong but i am extremely new to programming so i would appreciate direction on how this should have been coded?
I understand my issue is with the if/elseif/else statement structure. But i am unsure how to properly format the information.
elseifyou should probably be using aswitchinstead.switchstatements if you have many conditions. Aswitchwill only let you choose one case, where as if you have many conditions, aswitchwon't do the job.returnon every if eval that is true, might as well just have only if statements. It'd be way easier to read, too. Write code so you (and anyone else) save the most cost from the most valuable resource.. humans.