-1

我正在尝试$grandtotalif声明中添加运输和处理金额:

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 />

我是否需要定义更多变量来执行此操作?

4

1 回答 1

0

您应该在显示增加总计的运费和手续费后添加一行:

if ($PAYMETHOD == $paypal)
{
    echo "Shipping & Handling = ".($GRANDTOTAL * .045);
    $GRANDTOTAL = $GRANDTOTAL * 1.045;
}
    elseif ($PAYMETHOD == $check)
{
    echo "Shipping & Handling = 0";
}
于 2013-08-22T05:31:37.060 回答