本文整理汇总了PHP中Coupon::findCouponByCode方法的典型用法代码示例。如果您正苦于以下问题:PHP Coupon::findCouponByCode方法的具体用法?PHP Coupon::findCouponByCode怎么用?PHP Coupon::findCouponByCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Coupon
的用法示例。
在下文中一共展示了Coupon::findCouponByCode方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: if
$stateTax = "CA";
} else {
$stateTax = "";
}
if($stateTax == "CA") {
$tax = $grandtotal * .0925;
} else {
$tax =0;
}
?>
<?
if($carts->fldCartCoupon != '') {
$coupon = Coupon::findCouponByCode($carts->fldCartCoupon);
if($coupon->fldCouponPrice != '') {
$discAmount = $coupon->fldCouponPrice;
unset($_SESSION['FreeShipping']);
} else if($coupon->fldCouponPercent != '') {
$percent = $coupon->fldCouponPercent / 100;
$discAmount = $grandtotal * $percent;
unset($_SESSION['FreeShipping']);
} else {
$_SESSION['FreeShipping'] = 1;
$discAmount = 0;
}
$grandtotal = ($grandtotal - $discAmount) + $shippingRate->fldShippingRateAmount;
?>
示例2: Total
<tr style="background-color:#6B5983;color:#FFF; height:30px">
<td colspan=3 align="right"><font color="#FFFFFF">
<B><font face="Arial, Helvetica, sans-serif" size="2">Sub Total ($) :</font></B>
</font></td>
<td align=right><B>
<font face="Arial, Helvetica, sans-serif" size="2" color="#FFFFFF">
<?
echo number_format($grandtotal,2);
?>
</font>
</B></td>
</tr>
<? if(isset($_SESSION['coupon_code'])) {
$coupon = Coupon::findCouponByCode($_SESSION['coupon_code']);
if($coupon->fldCouponPrice != '') {
$discAmount = $coupon->fldCouponPrice;
unset($_SESSION['FreeShipping']);
} else if($coupon->fldCouponPercent != '') {
$percent = $coupon->fldCouponPercent / 100;
$discAmount = $grandtotal * $percent;
unset($_SESSION['FreeShipping']);
} else {
$_SESSION['FreeShipping'] = 1;
$discAmount = 0;
}
$grandtotal = $grandtotal - $discAmount;
?>
<tr style="background-color:#6B5983;color:#FFF; height:30px">