我正在尝试在$grandtotal
声明中将运费和处理金额添加到if
:
Order #: <? echo $ORDERID?><br />
<br />
Pick-Up Date: <? echo $MYPICKUP?><br />
Comments: <? echo $COMMENTS?><br /><br />
<?php
$paypal = 'paypal';
$check = 'check';
if ($PAYMETHOD == $paypal)
{
echo "Shipping & Handling = ".($GRANDTOTAL * .045);
}
elseif ($PAYMETHOD == $check)
{
echo "Shipping & Handling = 0";
}
?><br />
Grand Total: $<? echo $GRANDTOTAL?><br />
Payment Method: <? echo $PAYMETHOD?></span><span class="TextB"><br />
我是否需要定义更多变量才能执行此操作?
答案 0 :(得分:0)
您应该在显示Shipping&amp; amp;根据以下方式处理增加格兰特的费用
if ($PAYMETHOD == $paypal)
{
echo "Shipping & Handling = ".($GRANDTOTAL * .045);
$GRANDTOTAL = $GRANDTOTAL * 1.045;
}
elseif ($PAYMETHOD == $check)
{
echo "Shipping & Handling = 0";
}