Esempio n. 1
0
    $obj = new cartDisplayer($id);
    $obj2 = new lib_giftPoint($id);
}
if (strcmp($res, "VERIFIED") == 0) {
    // check the payment_status is Completed
    // check that txn_id has not been previously processed
    // check that receiver_email is your Primary PayPal email
    // check that payment_amount/payment_currency are correct
    // process payment
    if ($payment_status == 'Completed') {
        $query = "SELECT 'txn_id' FROM shop_ipn WHERE txn_id ='" . $txn_id . "'";
        $result = mysql_query($query);
        if (mysql_num_rows($result) == 0) {
            if ($receiver_email == '*****@*****.**') {
                $totalcost = $obj->getCostTotal();
                $shipcost = getShippingCost($obj->getItemTotal());
                $taxcost = getTaxCost($totalcost);
                $reduce = 0;
                //default
                if ($obj2->isApplyDiscount($totalcost) == true) {
                    $reduce = $obj2->getReduction() * -1;
                    $taxcost = getTaxCost($totalcost - $obj2->getReduction());
                }
                $finalcost = $totalcost + $shipcost + $taxcost + $reduce;
                if ($payment_amount < $finalcost * 1.005 + 0.1 and $payment_amount > $finalcost * 0.995 - 0.1 and $payment_currency == 'USD') {
                    //reset gift point if it has been used:
                    if ($obj2->isApplyDiscount($totalcost) == true) {
                        $obj2->resetPoints();
                    }
                    update_shopipn($id, $txn_id);
                    update_store_status($id);
Esempio n. 2
0
?>

<div class="cart_content">
            <div class="cart_head"><span class="title_icon"><img src="images/cart.jpg" width="24" height="24" alt="" title="" /></span>我的購物車</div>
        
          	<div class="feat_prod_box_details">
			<form method="POST" action="process/prcs.change_cart_quantity.php">
        	  <table class="cart_table">
        	  <tr>
        	    <td><table class="cart_table">
        	      <tr class="cart_title">
				  	<?php 
if (!isset($_SESSION["id"])) {
    echo '<td colspan="6"><span class="red">請 <a href="login.php">登錄</a> 後才能訪問到您的購物車.</span></td>';
} else {
    if ($cartObj2->getItemTotal() == 0) {
        echo '<td colspan="6"><span class="red">您的購物車是空的。請新增項目.</span></td>';
    } else {
        ?>
          	        <td width="85">刪除</td>
        	        <td width="105">圖片</td>
        	        <td width="150">項目</td>
        	        <td width="82">單價</td>
        	        <td width="77">數量</td>
					<td width="88">庫存</td>
					<td width="91">原價</td>
        	        <td width="136">售價</td>
					<?php 
    }
}
?>
Esempio n. 3
0
<?php

if (isset($_SESSION["id"])) {
    $cartObj = new cartDisplayer($_SESSION["id"]);
    $quantity = $cartObj->getItemTotal();
    $costTotal = $cartObj->getCostTotal();
} else {
    $quantity = 0;
    $costTotal = 0;
}
?>

<div class="right_content">
        
          <div class="cart">
            <div class="title"><span class="title_icon"><img src="images/cart.gif" alt="" title="" /></span>My cart</div>
                  <div class="home_cart_content">
                  <?php 
echo $quantity;
?>
 x items | <span class="red">TOTAL: $<?php 
echo $costTotal;
?>
</span>
                  </div>
                  <a href="cart.php" class="view_cart">view cart</a>
              
              </div>