Example #1
0
						$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; 
				
		   ?>
                                                
                                                <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">