-=[ Mr. Bumblebee ]=-
_Indonesia_
<?php
include("global_header.php");
define('SECTION','');
define('NO_BANNER2','1');
define('NO_BANNER','1');
if($_REQUEST['c'] == '1'){
cart_clear_all();
}
define('TOTAL_CART_ITEM',cart_getTotalItem() );
define('TOTAL_PRODUCT2_PRICE',cart_getTotalItemPrice());
define('TOTAL_PRODUCT2_WEIGHT',cart_getTotalProductWeight());
$arr_data_discount = getDiscountCodeInfo(USING_DISCOUNT_CODE,getRequestVar('shipping_country',''),getRequestVar('delivery_method_id',''));
define('DISCOUNT',$arr_data_discount['discount']) ;
//$delivery_price = cart_getDeliveryPrice(MEMBER_COUNTRY_ID);
$delivery_price = 0;
define('DELIVERY_PRICE',$delivery_price);
define('GRAND_PRICE',TOTAL_PRODUCT2_PRICE + DELIVERY_PRICE +DISCOUNT );
//cart_add_item(1,2,5,3,21);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php include("meta_header.php"); ?>
</head>
<body class="section_product2">
<?php include("header.php"); ?>
<div class="main_content_full">
<h1>
Shopping Cart
<div class="cart_step"><img src="css/images/shop/cart_step1.png"></div>
</h1>
<?php
if(TOTAL_CART_ITEM > 0){
?>
<!-- table_cart_list -->
<div class="table_cart_list">
<?php
$each_product2_total_price = 0;
$product2_total_price = 0;
//$total_product2_weight = 0;
$sql = getCartSQL(2);
$rows = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
$k = 0;
while($data = $G_DB_CONNECT->fetch_array($rows)){
$k++;
$terms_desc = $data['terms_desc'];
$cart_id = $data['id'];
$qty = $data['qty'];
$product2_id = $data['product2_id'];
$product2_seo_url = $data['product2_seo_url'];
$product2_code = $data['product2_code'];
$product2_name = $data['product2_name'];
$product2_weight = $data['weight'];
//$total_product2_weight += $product2_weight*$qty;
$product2_weight = formatWeight($product2_weight);
$arr_product2_price_data = getFinalProductPriceData($product2_id);
$product2_type_id = getDataName(TB_PRODUCT2,'product2_type_id',$product2_id);
$price = $arr_product2_price_data['price'];
////////////////////////////////////////
$product2_color_id = $data['product2_color_id'];
$product2_size_id = $data['product2_size_id'];
////////////////////////////////////////
$product2_size_name = getLangName(TB_PRODUCT2_SIZE,'name',$product2_size_id,CURRENT_LANG);
$product2_color_name = getLangName(TB_PRODUCT2_COLOR,'name',$product2_color_id,CURRENT_LANG);
$each_product2_total_price = $price*$qty;
$product2_total_price += $each_product2_total_price;
$this_form_name = "frm_cart_item".$cart_id;
$product2_link = "shop-detail.php?id=".$product2_id;
?>
<!-- item -->
<div class="item">
<div class="content_left">
<?php
$sql = "select img from ".TB_PRODUCT2_PHOTO;
$sql .= " where ";
$sql .= " disabled='0' ";
$sql .= " and product2_id='".$product2_id."' ";
$sql .= " order by sort_order asc limit 0,1";
$rowsp = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
while($datap = $G_DB_CONNECT->fetch_array($rowsp)){
$img = $datap['img'];
$arr_data = getThumbPhotoPath($img,"thumb",80,5000);
?>
<div class="cart_photo_thumb" style="background-image:url(<?php echo $arr_data['img_path']; ?>)">
<a href="<?php echo $product2_link; ?>"><img src="<?php echo $arr_data['img_path']; ?>" border="0"/></a>
</div>
<?php
}
}
?>
<div style="clear:both"></div></div>
<div class="content_right">
<div class="cart_product_name"><?php echo $product2_name; ?></div>
<div class="cart_product_price"><?php echo $arr_product2_price_data['price_desc']; ?></div>
<div class="cart_product_code">Product ID : <?php echo $product2_code; ?></div>
<form name="<?php echo $this_form_name ; ?>" id="<?php echo $this_form_name ; ?>" method="POST" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']; ?>" target="_self" autocomplete="off" class="frm_cart" update_product2_subtotal="update_product2_subtotal<?php echo $cart_id; ?>">
<input name="cart_id" id="cart_id" value="<?php echo $cart_id; ?>" type="hidden"/>
<input name="product2_id" id="product2_id" value="<?php echo $product2_id; ?>" type="hidden"/>
<table border="0" cellspacing="0" cellpadding="0" class="table_cart_info2">
<tr>
<td class="title">Quantity :</td>
<td>
<select name="qty" id="qty" class="input_qty numeric input_qty_cart input_shop_select" rel="<?php echo $this_form_name ; ?>">
<?php
define('MAX_QTY',10);
$max_qty = MAX_QTY;
$sql = "select qty from ".TB_PRODUCT_COLOR_SIZE_QTY." as product_color_size_qty ";
$sql .= " where product_id='".$product_id."' and product_color_id='".$product_color_id."' and product_size_id='".$product_size_id."' and qty>0 ";
$rowsp4 = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
while($datap4 = $G_DB_CONNECT->fetch_array($rowsp4)){
$this_max_qty = $datap4['qty'];
}
}
if($qty > MAX_QTY){
$max_qty =$qty;
}
for($i=1;$i<=$max_qty;$i++){
?>
<option value="<?php echo $i ;?>" <?php if($i == $qty){ echo 'selected';} ?>><?php echo $i ;?></option>
<?php
}
?>
</select>
</td>
<td class="title">Size :</td>
<td>
<?php
$sql = "select product2_size.*, product2_size_desc.name as name ";
$sql .= " from ".TB_PRODUCT2_SIZE." as product2_size , ".TB_PRODUCT2_SIZE_DESC." as product2_size_desc ";
$sql .= " where ";
$sql .= " product2_size.id=product2_size_desc.product2_size_id ";
$sql .= " and product2_size_desc.language_id='".CURRENT_LANG."' ";
$sql .= " and product2_size.disabled='0' ";
$sql .= " and product2_size.id in ( ";
$sql .= " select product2_size_id from ".TB_PRODUCT2_COLOR_SIZE_QTY;
$sql .= " where ";
$sql .= " product2_id = '".$product2_id."' and qty >0 ";
$sql .= " ) ";
$sql .= " order by product2_size.sort_order asc ";
$k=0;
$rowsp2 = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
?>
<select class="input_middle input_shop_select product2_size_id" name="product2_size_id" id="product2_size_id" rel="<?php echo $this_form_name ; ?>"/>
<?php
while($datap2 = $G_DB_CONNECT->fetch_array($rowsp2)){
$k++;
$this_product2_size_id = $datap2['id'];
$product2_size_name = $datap2['name'];
$selected = '';
if($product2_size_id == $this_product2_size_id){
$selected = 'selected';
}
?>
<option value="<?php echo $this_product2_size_id; ?>" <?php echo $selected; ?>><?php echo $product2_size_name; ?></option>
<?php
}
?>
</select>
<?php
}
?>
</td>
<td class="title">Color :</td>
<td>
<?php
$sql = "select product2_color.*, product2_color_desc.name as name ";
$sql .= " from ".TB_PRODUCT2_COLOR." as product2_color , ".TB_PRODUCT2_COLOR_DESC." as product2_color_desc ";
$sql .= " where ";
$sql .= " product2_color.id=product2_color_desc.product2_color_id ";
$sql .= " and product2_color_desc.language_id='".CURRENT_LANG."' ";
$sql .= " and product2_color.disabled='0' ";
$sql .= " and product2_color.id in ( ";
$sql .= " select product2_color_id from ".TB_PRODUCT2_COLOR_SIZE_QTY;
$sql .= " where ";
$sql .= " product2_id = '".$product2_id."' and qty >0 ";
$sql .= " ) ";
$sql .= " order by product2_color.sort_order asc ";
$k=0;
$rowsp2 = $G_DB_CONNECT->query($sql);
if($G_DB_CONNECT->affected_rows > 0){
?>
<select class="input_middle input_shop_select product2_color_id" name="product2_color_id" id="product2_color_id" rel="<?php echo $this_form_name ; ?>"/>
<?php
while($datap2 = $G_DB_CONNECT->fetch_array($rowsp2)){
$k++;
$this_product2_color_id = $datap2['id'];
$product2_color_name = $datap2['name'];
$selected = '';
if($this_product2_color_id == $product2_color_id){
$selected = 'selected';
}
?>
<option value="<?php echo $this_product2_color_id; ?>" <?php echo $selected; ?>><?php echo $product2_color_name; ?></option>
<?php
}
?>
</select>
<?php
}
?>
</td>
</tr>
</table>
</form>
<div style="clear:both"></div></div>
<div class="btn_delete_item btn_cart_delete_item" cart_id="<?php echo $cart_id; ?>" msg="<?php echo $product2_name;?>, <?php echo $product2_size_name;?>, <?php echo $product2_color_name;?>"><a href="#"><img src="css/images/shop/btn_delete_item.png"></a></div>
<div style="clear:both"></div></div>
<!-- item -->
<?php
}
?>
<?php
}
?>
<div style="clear:both"></div></div>
<!-- table_cart_list -->
<!-- cart_bottom_box -->
<div class="cart_bottom_box">
<div class="content_left">
<!-- promotion_code_box -->
<div class="promotion_code_box">
<div class="title">Promotion Code<div style="clear:both"></div></div>
<div class="content">
<p class="subtitle">Enter your Promotion code if you have one :</p>
<form name="frm_discount" id="frm_discount" method="POST" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']; ?>" target="_self" autocomplete="off" style="float:left; margin-left:0px;">
<table border="0" cellspacing="0" cellpadding="0" class="table_discount">
<tr>
<td>
<input name="discount_code" id="discount_code" class="input_discount input_discount_code default_input_group" label="Promotion Code" default="<?php echo DEFAULT_DISCOUNT_CODE; ?>" value="<?php echo getRequestVar('discount_code',USING_DISCOUNT_CODE); ?>"/>
</td>
<td>
<div class="btn_discount_code btn_discount" <?php if(USING_DISCOUNT_CODE != ''){ echo 'style="display:none"';} ?>><a href="#">enter</a></div>
<div class="btn_remove_discount btn_discount_code_remove" <?php if(USING_DISCOUNT_CODE == ''){ echo 'style="display:none"';} ?>><a href="#">remove</a></div>
</td>
</tr>
</table>
</form>
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<!-- promotion_code_box -->
<span class="desktop_content">
<div style="clear:both;padding-top:20px;"></div>
<div class="btn_cart_back"><a href="shop.php">back</a></div>
<span>
<div style="clear:both"></div></div>
<div class="content_right">
<!-- cart_summery_box -->
<div class="cart_summery_box">
<div class="title">Order Summary<div style="clear:both"></div></div>
<div class="content">
<table border="0" cellspacing="0" cellpadding="0" width="100%" class="table_cart_summery">
<tr>
<td class="title2">Subtotal</td>
<td class="content2"><span class="price update_final_product2_price"><?php echo displayPriceOnly2(TOTAL_PRODUCT2_PRICE); ?></span></td>
</tr>
<tr>
<td class="title2 highlight2">Discount</td>
<td class="content2 highlight2"><span class="update_final_discount_price">-<?php echo displayPriceOnly2(abs(DISCOUNT)); ?></span></td>
</tr>
<tr>
<td class="title2">Total</td>
<td class="content2"><span class="price update_final_grand_total" ><?php echo displayPriceOnly2(GRAND_PRICE); ?></span</td>
</tr>
</table>
<div style="clear:both"></div></div>
<div class="btn_checkout"><a href="#">Proceed to Checkout</a></div>
<div style="clear:both"></div></div>
<!-- cart_summery_box -->
<div style="clear:both"></div></div>
<div style="clear:both"></div></div>
<!-- cart_bottom_box -->
<span class="mobile_content">
<div style="clear:both;padding-top:20px;"></div>
<div class="btn_cart_back"><a href="shop.php">back</a></div>
<span>
<form name="frm_cart_delete_item" id="frm_cart_delete_item" method="POST" enctype="multipart/form-data" action="<?=$_SERVER['PHP_SELF']; ?>" target="_self" autocomplete="off">
<input name="cart_action" id="cart_action" value="3" type="hidden"/>
<input name="cart_id" id="cart_id" value="" type="hidden"/>
</form>
<input id="checked_out_of_stock" name="checked_out_of_stock" value="" type="hidden"/>
<?php
$checkout_url = 'checkout.php';
if(!$_SESSION['falready_login'] ){
$checkout_url = "login.php?redirect=checkout.php";
}
?>
<form name="frm_check" id="frm_check" method="POST" enctype="multipart/form-data" action="<?php echo $checkout_url; ?>" target="_self" autocomplete="off">
<input name="a" id="a" value="1" type="hidden"/>
<input name="cart_id" id="cart_id" value="" type="hidden"/>
</form>
<form name="frm_next" id="frm_next" action="<?php echo $checkout_url; ?>" enctype="multipart/form-data" method="post" autocomplete="off" class="frm_next">
<input name="shop_pick_up" id="shop_pick_up" value="0" type="hidden" />
</form>
<script type="text/javascript">
$(document).ready(function(){
$('.input_qty_cart').change(function(e){
var form_id = $(this).attr('rel');
update_cart(form_id);
});
$('.input_qty_cart').bind("keyup", function(e) {
var form_id = $(this).attr('rel');
update_cart(form_id);
});
$('.product2_color_id').change(function(e){
var form_id = $(this).attr('rel');
update_cart(form_id);
});
$('.product2_size_id').change(function(e){
var form_id = $(this).attr('rel');
update_cart(form_id);
});
$('.btn_checkout').click(function(e){
e.preventDefault();
check_update_cart();
});
/*
if($('#frm_discount #discount_code').val() != $('#frm_discount #discount_code').attr('default') && $('#frm_discount #discount_code').val() != '' ){
handle_discount_code();
}
*/
update_cart_price()
$('.btn_discount_code').click(function(e){
//$('#frm_discount #discount_code').css('border','1px solid #abadb3');
e.preventDefault();
$('.msg_form_error').html('');
$('.msg_form_error').hide();
//empty_default_value('frm_discount');
handle_discount_code();
});
$('.btn_discount_code_remove').click(function(e){
// $('#frm_discount #discount_code').css('border','1px solid #abadb3');
e.preventDefault();
$('.msg_form_error').html('');
$('.msg_form_error').hide();
//empty_default_value('frm_discount');
handle_discount_code_remove();
});
});
function check_update_cart(){
var ajax_json_path = "json_check_update_cart_qty.php";
var params=$('#frm_check').serialize();
$.ajax({
url:ajax_json_path,
type:'post',
dataType:'json',
data:params,
success: function(json){
success = json.success;
if(success){
if(json.out == ''){
//top.location.href = href;
document.frm_check.submit();
}else{
$('#checked_out_of_stock').val('1');
openDialog('',json.out);
}
}else{
}
} ,
error: function(json){
}
});
return false;
}
function handle_discount_code(){
if($('#frm_discount #discount_code').val() == '' || $('#frm_discount #discount_code').val() == $('#frm_discount #discount_code').attr('default')){
//start_display_discount_fail('<?php echo WARN_PROMOTIONAL_CODE; ?> <?php echo MSG_WAS_LEFT_BLANK; ?>');
openDialog('',$('#frm_discount #discount_code').attr('label'));
// $('#frm_discount #discount_code').css('border','2px solid #a1c3fa');
}else{
// $('#frm_discount #discount_code').css('border','1px solid #abadb3');
check_discount_code('frm_discount');
}
}
function handle_discount_code_remove(){
remove_discount_code('frm_discount');
}
</script>
<?php
}else{
?>
<p style="width:100%;text-align:center;">
No item.
</p>
<?php
}
?>
<div style="clear:both"></div></div>
<?php include("footer.php"); ?>
</body>
</html>
Copyright © 2017 || Recoded By Mr.Bumblebee