我正在尝试在下面的代码中添加一个 if 语句,只需要澄清一下它是否会做正确的工作。
Order #: <? echo $ORDERID?><br />
<br />
Pick-Up Date: <? echo $MYPICKUP?><br />
Comments: <? echo $COMMENTS?><br /><br />
<? echo $CART?><br />
Order total: $<? echo $GRANDTOTAL?><br />
Payment Method: <? echo $PAYMETHOD?></span><span class="TextB"><br />
尝试在其中添加 Shipping & Handling: 结果是:
<?php
$paypal = 'paypal';
$check = 'check';
if ($paymethod == $paypal)
{
echo "Shipping & Handling = $GRANDTOTAL * .045";
}
elseif ($paymethod == $check)
{
echo "Shipping & Handling = 0";
}
?>
但我的问题是,选择选项时会显示运费和手续费吗?