Preview: basket.php
Size: 10.15 KB
//home/justbyquicklly-old/public_html/js/basket.php
<?php
include("wfcart.php");
include("include/config.php");
include("include/functionsbasket.php");
include("include/sessionmsg.php");
$cart =& $_SESSION['cart'];
if(!is_object($cart)) $cart = new wfCart();
if($_SESSION['value_user_id']==''){
header("location:login.php?redirect=basket.php");
exit();
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?php echo SITE_TITLE; ?></title>
<link rel="shortcut icon" href="images/favicon.ico">
<link href="css/style.css" rel="stylesheet" type="text/css">
<link href="fonts/font.css" rel="stylesheet" type="text/css">
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,400,600' rel='stylesheet' type='text/css'>
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- google analytics code-->
<?php include_once("analyticstracking.php") ?>
</head>
<body>
<?php include("head-top.php"); ?><br>
<div id="container">
<div id="page">
<section class="page-content">
<div align="center" style="color:#C00; font-weight:bold;"><?php echo $_SESSION['sess_msg']; $_SESSION['sess_msg']='';?></div>
<?php
$yousave=0;
$itmes=$cart->get_contents();
$no_of_itmes=count($itmes);
if($no_of_itmes>0 || count($_SESSION['myprecart'])>0){?>
<div class="basket">
<br>
<h4>Your Basket (<?php echo $no_of_itmes; ?> items)</h4>
<div class="item_des">
<ul class="head">
<li>ITEM DESCRIPTION</li>
<li>UNIT PRICE</li>
<li>QUANTITY</li>
<li>TAX</li>
<li>SUBTOTAL</li>
<li>SAVINGS</li>
</ul>
<?php
$cat_price=0;
$nettax='';
$pcats=array();
foreach($itmes as $item){
$prArr=$obj->query("select storeid,product_name,brand,sell_price,mrp_price,product_id,tax_value,$tbl_brand.slug as bslug from $tbl_product join $tbl_productprice on $tbl_productprice.product_id=$tbl_product.id left join $tbl_brand on $tbl_brand.id=$tbl_product.brand_id where $tbl_productprice.id='".$item['id']."' ",$debug=-1);
$resultProductRows=$obj->numRows($prArr);
$resultProduct=$obj->fetchNextObject($prArr);
$mainparent=getMainParent($resultProduct->storeid);
if(!in_array($mainparent,$pcats)){
$pcats[]=$mainparent;
//print_r($pcats);
?>
<h5><?php echo getField('storename','stores',$mainparent); ?> <span style="float:right; color:#F60"></span></h5>
<?php if(50>$cart->total){
$GLOBALS['del_charge']=getField('fee','stores',$mainparent);
}else{ ?>
<?php $GLOBALS['del_charge']=getFieldid('shippingamount',$tbl_setting,1); ?>
<?php } ?>
<?php } ?>
<ul class="cart">
<li>
<!--<span><a href="pb/<?php echo $resultProduct->bslug; ?>"><?php echo stripslashes($resultProduct->brand); ?></a></span>-->
<a href="pd/<?php echo $resultProduct->product_id;?>/<?php echo buildURL($resultProduct->product_name);?>" target="_blank">
<?php echo ucwords(strtolower($item['info'])); ?></a>
</li>
<li>
<?php
if($resultProductRows>0){?>
<?php echo $website_currency_symbol;?> <?php echo number_format($item['price'],2); ?>
<?php }else{
$giftArr=$obj->query("select * from $tbl_giftcards where id= '".$_SESSION['mygiftcard']."' ",$debug=-1);
$resultCard=$obj->fetchNextObject($giftArr);
echo number_format($resultCard->card_amount,2);
}?>
<?php if($item['price']!=$resultProduct->mrp_price){?>
<span class="price_Rate"><?php echo $website_currency_symbol;?> <?php echo number_format($resultProduct->mrp_price,2); ?></span>
<?php } ?>
</li>
<li>
<div class="uiv2-grid-count-btn">
<?php
if($resultProductRows>0){?>
<button onClick="return DescQty(<?php echo $item['id']; ?>);">-</button>
<input type="text" class="text-change-qty-search-popup" placeholder="1" id="p_<?php echo $item['id']; ?>" value="<?php echo $item['qty']; ?>" maxlength="2" onBlur="return UpdateMyCart(<?php echo $item['id']; ?>);">
<button class="icon" onClick="return IncQty(<?php echo $item['id']; ?>);">+</button>
<?php }else{ echo $item['qty']; }?>
</div>
</li>
<li>
<?php $total_tax=number_format(($item['qty']*$resultProduct->tax_value),2);
echo $website_currency_symbol; ?> <?php echo$total_tax;
$nettax=$nettax+($resultProduct->tax_value*$item['qty']);
$_SESSION['net_tax']=$nettax;
?>
</li>
<li>
<?php
//if($resultProductRows>0){?>
<?php echo $website_currency_symbol;?> <?php echo number_format(($total_tax+$item['subtotal']),2); ?>
<?php //}else{
//$giftArr=$obj->query("select * from $tbl_giftcards where id= '".$_SESSION['mygiftcard']."' ");
//$resultCard=$obj->fetchNextObject($giftArr);
//echo number_format($resultCard->card_amount,2);
//}?>
</li>
<?php
if($resultProductRows>0){?>
<li class="close-btn"><a href="javascript:void(0)" onClick="location.href='process.php?action=del_cart&pid=<?php echo $item['id']; ?>'"></a></li>
<?php }?>
<li>
<?php $savings=$resultProduct->mrp_price-$item['price']; $savings=$savings*$item['qty']; if($savings>0){ echo $website_currency_symbol.' '.number_format($savings,2); $yousave=$yousave+$savings;} ?>
</li>
</ul>
<?php } ?>
<?php if(count($_SESSION['myprecart'])>0){ print_r($_SESSION['myprecart']);?>
<h5>Pre Carts</a> </h5>
<?php foreach($_SESSION['myprecart'] as $prek=>$prev){
$preArr=$obj->query("select * from $tbl_precart where id='$prek' ",$debug=1);
$resultP=$obj->fetchNextObject($preArr);
?>
<ul class="cart">
<li>
<a href="prd/<?php echo $resultP->id;?>/<?php echo buildURL($resultP->precart_title);?>" target="_blank"><?php echo stripslashes($resultP->precart_title); ?></a>
</li>
<li>
<?php echo $website_currency_symbol;?> <?php echo number_format($resultP->cart_amount,2); ?>
</li>
<li>
<div class="uiv2-grid-count-btn">
<!--<button onClick="return DescpreQty(<?php echo $item['id']; ?>);">-</button>-->
<input readonly type="text" class="text-change-qty-search-popup" placeholder="1" id="pre_<?php echo $resultP->id; ?>" value="<?php echo $item['qty']; ?>" maxlength="2" onBlur="return UpdateMyCart(<?php echo $item['id']; ?>);">
<!--<button class="icon" onClick="return IncpreQty(<?php echo $resultP->id; ?>);">+</button>-->
</div>
</li>
<li>
<?php echo $website_currency_symbol;?> <?php echo number_format($resultP->cart_amount,2); ?>
</li>
<li>
<?php //print_r(); ?>
<?php echo $website_currency_symbol;?> <?php echo number_format($resultP->cart_amount,2); ?>
</li>
<li class="close-btn"><a href="javascript:void(0)" onclick="location.href='process.php?action=del_cart&pid=<?php echo $resultP->id; ?>'"></a></li>
<li>
<!--<?php $savings=$resultProduct->mrp_price-$item['price']; $savings=$savings*$item['qty']; if($savings>0){ echo $website_currency_symbol.' '.number_format($savings,2); $yousave=$yousave+$savings;} ?>-->
</li>
</ul>
<?php } } ?>
</div>
<div class="clear"></div>
</div>
<div class="enter-your-evoucher">
<a href="<?php echo SITE_URL; ?>category.php">CONTINUE SHOPPING</a>
</div>
<div class="checkoutblock-right">
<?php $_SESSION['yoursaving']=$yousave; ?>
<!--<div class="toppromo">
<h4>Offer on Fresho
Bread</h4>
<p>"Buy Any Spread & Get 15% Off on Fresho Bread"</p>
</div> -->
<div class="deliver-charges">
<div class="deliver-charges-totalamount">
<div class="subtotal-listblock">
<div class="total-list">
<p>Subtotal </p>
<span style="color:#333"><?php echo $website_currency_symbol;?> <?php
/*
print_r($cart);
print_r($resultP);
*/
/*$cart->total=($cart->total+$resultP->cart_amount);
$cart->itemcount=($cart->itemcount+1);
$cart->items['1']=$resultP->id;
$cart->itemprices[$resultP->id]=$resultP->cart_amount;
$cart->itemqtys[$resultP->id]=1;
$cart->iteminfo[$resultP->id]=$resultP->precart_title;
*/
echo number_format(($nettax+$cart->total),2); ?></span>
</div>
<div class="total-list">
<h6 style="color:#333; font-weight:bold; border-top:1px solid #ccc">TOTAL
<span style="color:#000; font-weight:bold"><?php echo $website_currency_symbol;?> <?php $total_charge=$cart->total+$nettax+$delivery_charges;echo number_format($total_charge,2);?></span>
</h6>
</div>
</div>
<div class="clear"></div>
</div>
<?php if($rssetting->minorderamount>$cart->total){?>
<div class="avial-freedelivery">
<p><img src="images/free-delivery.png" /></p>
<h5>Shop for <?php echo $website_currency_symbol;?> <?php echo number_format($rssetting->minorderamount-$cart->total,2); ?> more to avail Free Delivery!</h5>
</div>
<?php } ?>
<!--<h5 class="order">* For this order: Accepted food coupon is Rs. 703.00</h5> -->
<div class="condi">
<span>By placing your order,you agree to <strong>MyValue365's</strong> <a href="privacy-policy.php">privacy policy</a> and <a href="term-&-condition.php">conditions of use</a>.</span>
</div>
<input type="button" value="Checkout" onClick="location.href='checkout.php'" class="register_btn1" id="check-btn" />
</div>
</div>
<?php }else{ ?>
<div align="center" style="width:100%">Your cart is empty.</div>
<div class="enter-your-evoucher">
<a href="<?php echo SITE_URL; ?>category.php">CONTINUE SHOPPING</a>
</div>
<?php } ?>
<div class="clear"></div>
</div>
</section>
</div>
<div class="clear"></div><br></div>
<?php include("footerin.php"); ?>
</div>
</div>
</body>
</html>
Directory Contents
Dirs: 1 × Files: 76