简体   繁体   English

尝试将小计乘以运费%以获得总计

[英]trying to multiply subtotal with a shipping % to get grand total

coming from the cart i have two options one for check and one for paypal 来自购物车,我有两种选择,一种用于支票,一种用于贝宝

one i need to display the fees of the total price as a shipping and handling charge 我需要将总价的费用显示为运费和手续费

 <td><form id="formb" name="formb" method="post" action="checkout_paypal.php" onSubmit="return checkouttwo();">
                  <span class="TextA">Pick-up date:</span>
                  <input name="PICKUP1" type="text" class="TextA" id="PICKUP1" size="20" />
<input type="hidden" name="memberid" value="<?echo$_SESSION['memberid']?>">
<input type="hidden" name="cart" value="<?echo$wcart?>">
<input type="hidden" name="amount" value="<?echo$SHOWMEQ?>">

                <label>
                  <input name="button" type="submit" class="TextB" id="button" value="Pay by Paypal" />
                  </label>
              </form></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                </tr>
                <tr>
                  <td valign="top" class="TextB">Total: $<?echo$SHOWMEQ?></td>
                  <td valign="top"><span class="TextB">Shipping & Handling Fee: $</span><br />
                    <span class="TextB">Total: $<?echo$GETMYTOTAL?></span></td>

that would my code be to add that 3% shipping and handling charge in there so it can carry down to my total? 那我的代码是在那增加3%的运费和手续费,这样它就可以累计到我的总额中吗?

Ryan, 瑞安

You just have to write 你只需要写

<span class="TextB">Total: $<?php echo ($SHOWMEQ*3/100)+$SHOWMEQ;?></span>

It will display total amount along with 3% shipping and handling charges. 它将显示总金额以及3%的运费和手续费。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM