]]jkjjgdjffksdkdxdsghfghdfghfgdfsdsdfsdfsfdsbcxvxcbccwewqeqwewqskfgj
במ12[cxvbcxvbxcvbcxvcxvbcvxcvbsdfsdfsdfsdfsdfsdfxcvbxcvxbbxqwqewqewv;'
/
home
/
u506006416
/
domains
/
crystalmiracle.co.in
/
public_html
/
Upload FileeE
HOME
<?php include_once("header.php"); /*============= Offers Discount Function =============*/ function offers_discount($p_id='', $qty=''){ $sel_obj = new config(); $p_cond="`p_id`=".$p_id; $p_qu=$sel_obj->display_rcd("product",$p_cond); if(is_array($p_qu) AND !empty($p_qu)) { foreach($p_qu as $p_da) { } } $offer_array = array( 'offer_discount_amount' => 0 , 'offer_name' => NULL, 'shipping_price' => $p_da['shipping_price'], 'packaging_price' => $p_da['packaging_price'] ); $total_amount = $p_da['d_price']*$qty; $offers = json_decode($p_da['offers'], true); if (!empty($offers)) { foreach ($offers as $offer) { if ($qty >= $offer['offer_qty']) { if ($offer['offer_discount_type']=="percent") { $offer_discount_amount = ($offer['offer_discount']*$total_amount)/100; } if ($offer['offer_discount_type']=="flat") { $offer_discount_amount = $offer['offer_discount']; } if ($offer['free_delivery']==1) { $shipping_price = 0; }else{ $shipping_price = $p_da['shipping_price']; } if ($offer['free_packaging']==1) { $packaging_price = 0; }else{ $packaging_price = $p_da['packaging_price']; } $offer_array = array( 'offer_discount_amount' => round($offer_discount_amount) , 'offer_name' => $offer['offer_title'], 'shipping_price' => $shipping_price, 'packaging_price' => $packaging_price ); } } return $offer_array; }else { $offer_array = array( 'offer_discount_amount' => 0 , 'offer_name' => NULL, 'shipping_price' => $p_da['shipping_price'], 'packaging_price' => $p_da['packaging_price'] ); return $offer_array; } } // $off_array = offers_discount(1050, 8); // print_r($off_array); // die(); /*====================================================*/ $count = 0; if(isset($checksession) and !empty($checksession)) { $where_con="`id`="."'$checksession'"; $query=$sel_obj->display_rcd('tblusers',$where_con); if(is_array($query) || !empty($query)) { foreach ($query as $data ) { } } /*--------------- Check Cart ------------*/ $where_con="`user_id`="."'$checksession' AND `status`= 1"; $count = $sel_obj->all_count_row('temp_cart',$where_con); $fetch_temp_cart = $sel_obj->display_rcd('temp_cart',$where_con); }else{ echo "<script>window.location.href='login.php'</script>"; exit(); } if ($count<1) { echo "<script>window.location.href='cart.php'</script>"; } if(!empty($checksession)) { // $disabled='readonly class="notallowed"'; // $disabled='readonly'; $disabled_email = 'readonly'; }else{ echo "<script>window.location.href='login.php'</script>"; exit(); } /*======UKP Validation Order =========*/ $_SESSION['ukp_check'] = $fetch_temp_cart; //print_r($_SESSION['ukp_check']); die(); /*===========Apply Coupon =========*/ if (isset($_POST['coupon_submit'])) { $coupon_c = $_POST['coupon_code']; $coupon_data = array(); $order_data = array(); /*----- Check In Coupon Table ----*/ $where_coup="`code`="."'$coupon_c' AND `status`= 1"; $fetch_coupon = $sel_obj->display_rcd('coupon',$where_coup); foreach($fetch_coupon as $coupon_data) { } /*----- Check In Order Table ----*/ $where_ord="`user_id`='$checksession' AND `coupon_code`='$coupon_c' AND `payment_status`='1'"; $order_query=$sel_obj->display_rcd('orders',$where_ord); // print_r($order_query); die(); foreach ($order_query as $order_data) { } // echo $order_data; // print_r($order_data); die(); // print_r($coupon_data); die(); /*-------------------------------*/ if (empty($coupon_data)) { $msg = "<p class='alert alert-danger'>Invalid Coupon Code</p>"; }elseif (!empty($order_data)) { $msg = "<p class='alert alert-danger'>Invalid Coupon Code</p>"; }elseif ($coupon_data['amount']>$_SESSION['finalpayment']) { $msg = "<p class='alert alert-danger'>Invalid Coupon Code</p>"; }else{ $coupon_code = $_POST['coupon_code']; $coupon_type = $coupon_data['type']; $coupon_discount = $coupon_data['discount']; $msg = "<p class='alert alert-success'> Coupon Code applied successfully</p>"; } } // echo "<br>"; echo $coupon_code ; // echo "<br>"; echo $coupon_type ; // echo "<br>"; echo $coupon_discount ; // die(); /*----- Back Url ----*/ if ($_SERVER['HTTP_REFERER']) { $back_url = $_SERVER['HTTP_REFERER']; } else{ $back_url = "#"; } ?> <!-- Header End --> <style> .select2-container .select2-selection--single { background: transparent none repeat scroll 0 0; border: 1px solid #253237; color: #666; font-size: 14px; padding-left: 20px; padding-right: 10px; /* width: 100%;*/ outline: none; height: 45px; border-radius: 0px; display: flex; flex-direction: column; justify-content: center; } .select2-container--default .select2-selection--single .select2-selection__arrow { top: unset; } </style> <!-- Breadcrumb Area start --> <section class="breadcrumb-area"> <div class="container"> <div class="row"> <div class="col-md-12"> <div class="breadcrumb-content"> <h1 class="breadcrumb-hrading">Checkout</h1> <ul class="breadcrumb-links"> <li><a href="index.php">Home</a></li> <li><a href="<?php echo $back_url; ?>">Back</a></li> <li>Checkout</li> </ul> </div> </div> </div> </div> </section> <!-- Breadcrumb Area End --> <!-- checkout area start --> <div class="checkout-area mt-60px mb-40px "> <div class="container"> <form action="order.php" id="order_form_submit_form" method="POST"> <div class="row"> <div class="col-lg-7"> <div class="billing-info-wrap catpdad"> <h3>Shipping Details</h3> <div class="row"> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>First Name <span style="color:red;">*</span></label> <input required type="text" <?php echo $disabled;?> name="f_name" value="<?php echo @$data['FullName']?>" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Last Name <span style="color:red;">*</span></label> <input required name="l_name" <?php echo $disabled;?> type="text" value="<?php echo @$data['last_name']?>" /> </div> </div> <div class="col-lg-4 col-md-4"> <div class="billing-info mb-20px"> <label>Phone <span style="color:red;">*</span></label> <input maxlength="10" minlength="10" required name="phone" <?php echo $disabled;?> onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')" type="text" value="<?php echo @$data['phonenumber']?>"> </div> </div> <div class="col-lg-4 col-md-4"> <div class="billing-info mb-20px"> <label>Email Address <span style="color:red;">*</span></label> <input required name="email" type="email" value="<?php echo @$data['UserEmail']?>" /> <!--<input required <?php echo $disabled_email;?> name="email" type="email" value="<?php echo @$data['UserEmail']?>" />--> </div> </div> <div class="col-lg-4 col-md-4"> <div class="billing-info mb-20px"> <label>GST NO (optional)</label> <input minlength="15" maxlength="15" name="gst" type="text" <?php echo $disabled;?> value="<?php echo @$data['gst_no']?>" /> </div> </div> <div class="col-lg-12"> <div class="billing-info mb-20px"> <label>Street Address <span style="color:red;">*</span></label> <input required name="str_add1" placeholder="House number and street name" type="text" <?php echo $disabled;?> value="<?php echo @$data['str_address1']?>" /><br><br> <input name="str_add2" <?php echo $disabled;?> placeholder="Apartment, suite, unit etc. (optional)" type="text" value="<?php echo @$data['str_address2']?>" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Town / City <span style="color:red;">*</span></label> <input required name="town" <?php echo $disabled;?> type="text" value="<?php echo @$data['town']?>" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>State <span style="color:red;">*</span></label> <select class="form-control" name="state" <?php echo $disabled;?> required> <?php $stmt=$sel_obj->select('states'); foreach($stmt as $state) { ?> <option <?php if($data['state']==$state['name']){?> Selected <?php }?> value="<?php echo $state['name'];?>"><?php echo $state['name'];?></option> <?php } ?> </select> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Postcode / ZIP <span style="color:red;">*</span></label> <!-- <input maxlength="6" <?php echo $disabled;?> minlength="6" required name="pincode" type="text" value="<?php echo @$data['pincode']?>" /> --> <!--<select class="form-control js-example-matcher" name="pincode" id="pincode" <?php echo $disabled;?> required> <option value=""> Select Pincode </option> <?php $stmt=$sel_obj->select('all_pincode'); foreach($stmt as $pincode) { ?> <option <?php if($data['pincode']==$pincode['pincode']){?> Selected <?php }?> value="<?php echo $pincode['pincode'];?>"><?php echo $pincode['pincode'];?></option> <?php } ?> </select>--> <input required name="pincode" type="text" value="" /> </div> <script> function matchCustom(params, data) { if ($.trim(params.term) === '') { return data; } if (typeof data.text === 'undefined') { return null; } if (data.text.indexOf(params.term) > -1) { var modifiedData = $.extend({}, data, true); // modifiedData.text += ' (matched)'; return modifiedData; } return null; } $(".js-example-matcher").select2({ matcher: matchCustom }); </script> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Address Type <span style="color:red;">*</span></label> <select class="form-control" name="address_type" <?php echo $disabled;?> required> <option value="Home">Home</option> <option value="Office">Office</option> </select> </div> </div> </div> <div class="additional-info-wrap"> <h4>Additional information </h4> <div class="additional-info"> <label>Order notes (Optional)</label> <textarea style="height: 90px;" <?php echo $disabled;?> placeholder="Notes about your order, e.g. special notes for delivery. " name="message"></textarea> </div> </div> <div class="checkout-account mt-25" style="display: none;"> <input class="checkout-toggle" type="checkbox" checked="checked" /> <label>Same As Delivery Address</label> </div> <div class="different-address open-toggle mt-30"> <div class="row"> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>First Name</label> <input type="text" <?php echo $disabled;?> name="ship_first_name" class="shipping_address_array" data-key="First Name" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Last Name</label> <input type="text" <?php echo $disabled;?> name="ship_last_name" class="shipping_address_array" data-key="Last Name" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Phone</label> <input type="text" <?php echo $disabled;?> name="ship_phone" class="shipping_address_array" data-key="Phone" /> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Email Address</label> <input type="text" <?php echo $disabled;?> name="ship_email" class="shipping_address_array" data-key="Email Address " /> </div> </div> <div class="col-lg-12"> <div class="billing-info mb-20px"> <label>Street Address</label> <input placeholder="House number and street name" name="ship_address" <?php echo $disabled;?> type="text" class="shipping_address_array" data-key="Street address" /> <br> <br> <input placeholder="Apartment, suite, unit etc. (optional)" type="text" name="ship_address_op" <?php echo $disabled;?> /> </div> </div> <div class="col-lg-12"> <div class="billing-info mb-20px"> <label>Town / City</label> <input type="text" <?php echo $disabled;?> name="ship_town_city" class="shipping_address_array" data-key="Town City"/> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>State</label> <select class="select_option shipping_address_array" name="ship_state" <?php echo $disabled;?> data-key="State"> <option value="1">Choose</option> <?php $stmt=$sel_obj->select('states'); foreach($stmt as $state) { ?> <option value="<?php echo $state['id'];?>"><?php echo $state['name'];?></option> <?php } ?> </select> </div> </div> <div class="col-lg-6 col-md-6"> <div class="billing-info mb-20px"> <label>Postcode / ZIP</label> <input type="text" <?php echo $disabled;?> name="ship_postcode" id="ship_postcode" class="shipping_address_array" data-key="Pincode" /> </div> </div> <div class="additional-info-wrap"> <h4>Additional information </h4> <div class="additional-info"> <label>Order notes (Optional)</label> <textarea name="ship_notes" <?php echo $disabled;?> placeholder="Notes about your order, e.g. special notes for delivery."></textarea> </div> </div> </div> </div> </div> </div> <div class="col-lg-5"> <div class="your-order-area catpdad"> <h3>Your order</h3> <div class="your-order-wrap gray-bg-4"> <div class="your-order-product-info"> <div class="your-order-top table-responsive"> <table class="table table-bordered"> <tr> <th>#</th> <th>Product Name</th> <th>Qty</th> <th>Total</th> </tr> <?php $up=1; $length_array = []; $total_height = 0; $breadth_array=[]; if(isset($checksession) and !empty($checksession)) { $where_con="`user_id`="."'$checksession' AND `status`= 1"; $fetch_temp_cart = $sel_obj->display_rcd('temp_cart',$where_con); } else { $where_con="`temp_id`="."'$temp_session_id' AND `status`= 1"; $fetch_temp_cart = $sel_obj->display_rcd('temp_cart',$where_con); } if(is_array($fetch_temp_cart) || is_object($fetch_temp_cart)) { $total_gst = 0; $sub_total=""; $shipping_charge = 0; $packaging_charge = 0; $shipp_discount = 0; foreach($fetch_temp_cart as $temp_items) { $gst=str_replace("%"," ",$temp_items['gst']); $totalamount=($temp_items['quantity']*$temp_items['d_price']); $item_total= round($totalamount,'2'); /*----Product Info ------*/ $p_id = $temp_items['p_id']; $get_product_condition="`p_id`="."'$p_id'"; $get_product_query=$sel_obj->display_rcd("product",$get_product_condition); foreach($get_product_query as $get_product) { } /*---- check Quantity -------*/ if ($get_product['quan_available']<1) { $where = array( 'id' => $temp_items['id'], 'status' => 1 ); $sel_obj->delete("temp_cart", $where); } if ($temp_items['quantity'] > intval($get_product['quan_available'])) { $quantity = intval($get_product['quan_available']); }else{ $quantity = $temp_items['quantity']; } /*----Update Cart Values ----*/ $check_data = array( 'id' => $temp_items['id'], ); $update_data = array( 'p_name' => $get_product['p_name'], 'p_code' => $get_product['p_code'], 'img' => $get_product['p_img'], 'price' => $get_product['price'], 'd_price' => $get_product['d_price'], 'gst' => $get_product['gst'], 'quantity' => $quantity, // 'shipping_price' => $get_product['shipping_price'], // 'packaging_price' => $get_product['packaging_price'] ); /*---------- Check Offer Discount -------------*/ $off_array = offers_discount($temp_items['p_id'], $quantity); $update_data['shipping_price'] = $off_array['shipping_price']; $update_data['packaging_price'] = $off_array['packaging_price']; $update_data['offer_discount'] = $off_array['offer_discount_amount']; $update_data['offer_name'] = $off_array['offer_name']; /*---------------------------------------------*/ $update_rating=$sel_obj->update('temp_cart', $update_data, $check_data); /*---------------------------*/ ?> <tr> <td><?php echo $up++; ?></td> <td><?php echo $temp_items['p_name'];?></td> <td><?php echo $temp_items['quantity'];?></td> <td><?php echo "₹".$item_total;?></td> </tr> <?php $finalgst=$sel_obj->get_percentage($totalamount,$gst); $finaltotal=$finalgst+$totalamount; $total_gst+=$finalgst; $sub_total+=$totalamount; $packaging_charge += $temp_items['packaging_price']*$temp_items['quantity']; /*---------- Weight-------------*/ $p_id = $temp_items['p_id']; $get_product_condition="`p_id`="."'$p_id'"; $get_product_query=$sel_obj->display_rcd("product",$get_product_condition); foreach($get_product_query as $get_product) { } $sum_weight = $get_product['weight']*$temp_items['quantity']; $total_weight += $sum_weight; /*------- Shipping Charge -------*/ $shipping_charge += $temp_items['shipping_price']*$temp_items['quantity']; /*-------------Offer Discount---------*/ $offer_discount += $temp_items['offer_discount']; /*------------ Dimension / Volume -----*/ $volume += $get_product['length_cm'] * $get_product['breadth_cm'] * $get_product['height_cm'] * $temp_items['quantity']; /*------------- Height ---------------*/ $total_height += $get_product['height_cm']*$temp_items['quantity'];; $length_array[] = $get_product['length_cm']; $breadth_array[] = $get_product['breadth_cm']; /*--------- Sorting --------*/ rsort($length_array); rsort($breadth_array); /*-------------------------------------*/ } } ?> </table> </div> <!-- --------- Have a Coupon -------- --> <?php if(isset($msg)){ echo $msg; } ?> <button type="button" class="btn btn-danger" style="width:100%;box-shadow:1px 0px 4px 2px #4a060c;" data-toggle="modal" data-target="#coupon_model"> Have a Coupon ? </button> <!-- ---------------- --> <?php $shiping_condition="`temp_id`="."'$temp_session_id'"; $shiping_query=$sel_obj->display_rcd("shiping",$shiping_condition); if(is_array($shiping_query) AND !empty($shiping_query)) { foreach($shiping_query as $shiping_data) { } } // $shipping_charge = max(array_column($fetch_temp_cart, 'shipping_price')); /*----- New Shipping Charge ------*/ if ($shipping_charge>100 && $shipping_charge<181) { $shipp_discount = ($shipping_charge*10)/100; } if ($shipping_charge>180 && $shipping_charge<251) { $shipp_discount = ($shipping_charge*20)/100; } if ($shipping_charge>250) { $shipp_discount = ($shipping_charge*30)/100; } $shipping_charge = $shipping_charge-$shipp_discount; if ($shipping_charge>300) { $shipping_charge = 300; }else{ $shipping_charge = $shipping_charge; } /*------ New Packaging Charge ----*/ if ($packaging_charge>250) { $packaging_charge = 250; }else{ $packaging_charge = $packaging_charge; } /*--------------------------------*/ $grandTOTAL = $sub_total; $sub_total = $sub_total+$shipping_charge; ?> <div class="your-order-total"> <ul class="mb-2"> <li class="order-total">Sub Total</li> <li><span id="subtotal_div">₹<?php echo round($grandTOTAL,2); ?></li> </ul> <ul class="mb-2"> <li class="order-total">Total TAX</li> <li>₹<?php echo round($total_gst,'2');?></li> </ul> <ul class="mb-2"> <li class="order-total">Total Weight</li> <?php if($total_weight!=0){ ?> <li><?php echo round($total_weight,'2');?>Kg</li> <?php } ?> </ul> <?php if($offer_discount!=0){ ?> <ul class="mb-2"> <li class="order-total">Offer Discount</li> <li>₹<?php echo round($offer_discount,'2');?></li> </ul> <?php } ?> <!-- ----Just for Developer View ---- --> <input type="hidden" name="hide_show_packaging_charge" value="<?php echo $packaging_charge; ?>"> <!-- -------------------------------- --> </div> <div class="l_shiping"> <div class="your-order-total"> <ul> <li class="order-total">Shipping Charge</li> <li><span id="shipping_cost_div">₹<?php echo round($shipping_charge,2); ?></span></li> </ul> <ul class="mt-2"> <li class="order-total">Packaging Charge</li> <li><span>₹<?php echo round($packaging_charge,2); ?></span></li> </ul> </div> </div> <div class="your-order-total"> <?php $grandtotal=($grandTOTAL+$total_gst); $grandtotal=($grandtotal+ $shipping_charge+ $packaging_charge - $offer_discount); $discount = 0; if (isset($coupon_code)) { if ($coupon_type == "percent") { $discount = ($coupon_discount*$grandtotal)/100; $grandtotal = $grandtotal - $discount; } if ($coupon_type == "flat") { $discount = $coupon_discount; $grandtotal = $grandtotal - $coupon_discount; } $_SESSION['coupon_code']=$coupon_code; $_SESSION['coupon_discount']=round($discount); $_SESSION['finalpayment']=round($grandtotal); $_SESSION['offer_discount']=round($offer_discount); }else{ $_SESSION['coupon_code']=""; $_SESSION['coupon_discount']=round($discount); $_SESSION['finalpayment']=round($grandtotal); $_SESSION['offer_discount']=round($offer_discount); } ?> <ul class="mt-2" id="coupon_discount_div"> <li class="order-total">Coupon Discount</li> <li><span><?php echo "₹". round($_SESSION['coupon_discount']); ?></span></li> </ul> <ul class="mt-2" id="bank_discount_div" style="display:none;"> <li class="order-total">Bank Discount</li> <li><span>₹<span id="bank_discount_li"></span></span></li> </ul> <ul> <li class="order-total">Total</li> <li><span id="t_price_div"><?php echo "₹". @round($_SESSION['finalpayment']); ?></span></li> <!-- ============== Dimensions ======== --> <input type="hidden" name="length" id="length" value="<?php echo round($length_array[0],2);?>"> <input type="hidden" name="breadth" id="breadth" value="<?php echo round($breadth_array[0],2);?>"> <input type="hidden" name="height" id="height" value="<?php echo round($total_height,2);?>"> <!-- ================================== --> <input type="hidden" name="t_price" id="t_price_input" value="<?php echo round($grandtotal);?>"> <input type="hidden" name="shipping_price" id="shipping_cost_input" value="<?php echo round($shipping_charge,2); ?>"> <input type="hidden" name="subtotal" id="subtotal_input" value="<?php echo round($grandTOTAL,2); ?>"> <input type="hidden" name="packaging_price" value="<?php echo round($packaging_charge,2); ?>"> <input type="hidden" name="weight" id="weight" value="<?php echo round($total_weight,3);?>"> <input type="hidden" name="bank_discount_input" id="bank_discount_input" value="0"> <input type="hidden" name="coupon_discount_input" id="coupon_discount_input" value="<?php echo round($_SESSION['coupon_discount']); ?>"> <input type="hidden" name="check_pin_price_input" id="check_pin_price_input" value="0"> </ul> </div> </div> <div class="payment-method mt-4"> <div class="panel-default mb-3"> <input name="paymentmethod" id="Cash1" type="radio" value="1" /> <label for="Cash1" class="____cash321465978"> Cash On Delivery</label> <small class="text-danger" id="cod_not" style="display:none;">(COD not available)</small> </div> <!-- ------ PayU_1 ------- --> <div class="panel-default" id="PayU_1"> <input name="paymentmethod" type="radio" id="CheckCard" class="____SetInput" value="2"/> <label for="CheckCard"> <img src="assets/images/cards.jpg" class="img-responsive"> </label> </div> <!-- ------ PayU_2 ------- --> <div class="panel-default" id="PayU_2" style="display:none;"> <input type="radio" class="____SetInput" value="2" checked/> <label> <img src="assets/images/cards.jpg" class="img-responsive"> </label> </div> <!-- --------------------- --> <div class="Place-order mt-25"> <button type="submit" class="btn-hover order_form_submit_btn" id="submit_order" name="submit">Place Order</button> </div> </div> </div> </div> </div> </div> </form> </div> </div> <style type="text/css"> .____SetInput { position: absolute; /*margin-top: 22px;*/ margin-top: 3%; } .panel-default img { margin-left: 20px; } .____cash321465978 { margin-left: 13px; font-size: 21px; } </style> <!-- checkout area end --> <!-- ------------- Coupon Code Form Modal --------------- --> <div id="coupon_model" class="modal fade mt-5 p-3" style="display: none;"> <div class="modal-dialog modal-dialog-2 modal-sm" style="max-width: 400px;"> <div class="modal-content"> <div class="modal-header modal-header-2" style="background-color: #de2527;"> <div class="container-fluid" style="padding:0px 10px !Important;"> <div class="row"> <div class="col-md-10"> <h5 style="color:#fff;">Apply Coupon Code</h5> </div> <div class="col-md-2 tex-right"> <button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span> </button> </div> </div> </div> </div> <form action="" method="post"> <div class="modal-body" style="background-color: #ffffff;"> <h5>Please enter a valid coupon code</h5> <!-- <p>Subscribe to our mailing list to get the latest updates straight in your inbox.</p> --> <div class="form-group mt-2"> <input type="text" name="coupon_code" class="form-control" placeholder="Coupon Code" required> </div> </div> <div class="modal-footer"> <div class=""> <button type="submit" name="coupon_submit" class="btn btn-success">Apply</button> </div> </div> </form> </div> </div> </div> <!-- <script>window.location.href='index.php'</script> --> <!-- <script> $("#coupon_model").modal('show'); </script> --> <!-- -------------------------------------------------------- --> <!-- Footer Area start --> <?php include("footer.php");?> <script type="text/javascript"> $(document).ready(function() { var pincode = $("#pincode").val(); var weight = $("#weight").val(); var shipping_cost = $("#shipping_cost_input").val(); var t_price = $("#t_price_input").val(); var check_cod = 1; var subtotal_cost = $("#subtotal_input").val(); /*--------------- Check COD -----------*/ $.ajax({ url:'ajax_action.php', method:'POST', data:{pincode:pincode, weight:weight, check_cod:check_cod, shipping_cost:shipping_cost, subtotal:subtotal_cost, t_price:t_price}, success:function(responce){ var obj = JSON.parse(responce); if (obj.cod == '0'){ // alert(obj.rate); // alert('COD not available at this pincode'); console.log(responce); if (weight>6) { $('#Cash1').attr("disabled",true); $('#cod_not').show(); } } $("#shipping_cost_div").html("₹"+obj.rate); $("#shipping_cost_input").val(obj.rate); $("#subtotal_input").val(obj.subtotal); $("#subtotal_div").html("₹"+obj.subtotal); $("#t_price_div").html("₹"+obj.t_price); $("#t_price_input").val(obj.t_price); $("#check_pin_price_input").val(obj.t_price); } }); /*-------------------------------------*/ $('#pincode').change(function() { var pincode = $("#pincode").val(); var check_cod = 1; $("input[name='paymentmethod']").prop('checked', false); $("#bank_discount_input").val(''); $("#bank_discount_div").hide(); $("#PayU_1").show(); $("#PayU_2").hide(); // alert(weight); $.ajax({ url:'ajax_action.php', method:'POST', data:{pincode:pincode, weight:weight, check_cod:check_cod, shipping_cost:shipping_cost, subtotal:subtotal_cost, t_price:t_price}, success:function(responce){ var obj = JSON.parse(responce); if (obj.cod == '0'){ console.log(responce); // alert('COD not available at this pincode'); if (weight>6) { $('#Cash1').attr("disabled",true); $('#cod_not').show(); } }else{ $('#Cash1').attr("disabled",false); $('#cod_not').hide(); } $("#shipping_cost_div").html("₹"+obj.rate); $("#shipping_cost_input").val(obj.rate); $("#subtotal_input").val(obj.subtotal); $("#subtotal_div").html("₹"+obj.subtotal); $("#t_price_div").html("₹"+obj.t_price); $("#t_price_input").val(obj.t_price); $("#check_pin_price_input").val(obj.t_price); } }); }); }); </script> <script> $(document).ready(function() { // $(document).on("click", "#submit_order", function () { // $(document).on("submit", "#order_form_submit_form", function () { var allowSubmit = false; // $('#order_form_submit_form').submit(function(e){ $(document).on("click", "#submit_order", function () { if ($('input[name="paymentmethod"]:checked').length == 0) { //alert('Schedule time not available'); alert('Select Payment Method'); return false; } }); }); </script> <script> $(document).ready(function(){ // $("#CheckCard").click(function(){ $("input[name='paymentmethod']").click(function(){ var paymentmethod = $(this).val(); var bank_discount_input = $("#bank_discount_input").val(); var coupon_discount_input = $("#coupon_discount_input").val(); // alert(bank_discount_input); if (paymentmethod == "2" && bank_discount_input!='' && bank_discount_input!=0){ return false; } $("#bank_discount_div").hide(); $("#PayU_2").hide(); if (paymentmethod == "2"){ $("#PayU_1").hide(); $("#PayU_2").show(); $("#coupon_discount_div").hide(); $("#bank_discount_div").show(); }else{ $("#PayU_1").show(); $("#PayU_2").hide(); $("#coupon_discount_div").show(); $("#bank_discount_div").hide(); } var t_price = $("#t_price_input").val(); var check_pin_price_input = $("#check_pin_price_input").val(); if ($("#bank_discount_input").val()!='') { if (check_pin_price_input==0) { $("#t_price_div").html("₹"+<?php echo round($grandtotal);?>); $("#t_price_input").val(<?php echo round($grandtotal);?>); }else{ $("#t_price_div").html("₹"+check_pin_price_input); $("#t_price_input").val(check_pin_price_input); } // $("#t_price_div").html("₹"+<?php echo round($grandtotal);?>); // $("#t_price_input").val(<?php echo round($grandtotal);?>); }else{ $("#t_price_div").html("₹"+t_price); $("#t_price_input").val(t_price); } // $("#t_price_div").html("₹"+t_price); // $("#t_price_input").val(t_price); // if (paymentmethod == "2") { var t_price = $("#t_price_input").val(); // alert(t_price); $.ajax({ url:'ajax_action.php', method:'POST', data:{paymentmethod:paymentmethod, t_price:t_price, check_bank_offer:1, coupon_discount_input:coupon_discount_input, bank_discount_input:bank_discount_input}, success:function(responce){ // alert(responce); exit(); var obj = JSON.parse(responce); if (obj.bank_discount != 0){ $("#t_price_div").html("₹"+obj.final_t_price); $("#t_price_input").val(obj.final_t_price); $("#bank_discount_div").show(); $("#bank_discount_li").text(obj.bank_discount); $("#bank_discount_input").val(obj.bank_discount); }else{ $("#bank_discount_div").hide(); $("#bank_discount_input").val(''); } } }); // } }); }); </script>