815 lines
38 KiB
PHP
815 lines
38 KiB
PHP
<?php
|
|
|
|
$popup_background = of_get_option('thbusiness_popup_image1','');
|
|
//$popup_background = get_bloginfo('wpurl') . '/wp-content/plugins/iper-medical/images/sidepop.jpg';
|
|
$malogo = get_bloginfo('wpurl') . '/wp-content/plugins/iper-medical/images/MedicalAlert.png';
|
|
|
|
session_start();
|
|
|
|
// Set session variables
|
|
$_SESSION["favcolor"] = "green";
|
|
|
|
iper_hook_css();
|
|
get_header('product');
|
|
$_SESSION['Shipping'] = 'template-shipping';
|
|
$package = json_decode(stripslashes($_POST['Package']),true);
|
|
$_SESSION['Package'] = $package;
|
|
$_SESSION['RatePlanID'] = $package['rateplan_sid'];
|
|
$_SESSION['PromotionID'] = $package['promotionId'];
|
|
$_SESSION['Accessories'] = $package['accessories'];
|
|
$_SESSION['Upsells'] = $package['upsells'];
|
|
$_SESSION['ProductName'] = $package['productName'];
|
|
$_SESSION['ProductID'] = $package['product_sid'];
|
|
$_SESSION['RatePlan'] = $package['ratePlan'];
|
|
$_SESSION['ShippingMethods'] = $package['shippingMethods'];
|
|
global $indice;
|
|
|
|
$args = array(
|
|
'posts_per_page' => -1,
|
|
'orderby' => 'date',
|
|
'order' => 'ASC',
|
|
'post_type' => 'shipping'
|
|
);
|
|
$posts_array = get_posts( $args );
|
|
|
|
|
|
?>
|
|
<?php $newArray = array($_SESSION['Accessories']);?>
|
|
<div class="container" style="margin-top: 30px;">
|
|
|
|
|
|
|
|
|
|
<?php
|
|
if($_SESSION['error_counter']>5) {
|
|
header('Location: '.get_permalink($config['id_medical_thank']));
|
|
}
|
|
|
|
|
|
function print_tab_index(){
|
|
static $tab_index = 2;
|
|
$tab_index++;
|
|
echo $tab_index;
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
<div class="spam_blocker"></div>
|
|
|
|
<?php echo $_SESSION['block_active_']; if($_SESSION['block_active_']!='block_active'){?>
|
|
<script type="text/javascript">
|
|
(function(window, $, undefined) {
|
|
$(document).ready(function() {
|
|
woo.getCart();
|
|
});
|
|
})(window, jQuery, undefined);
|
|
|
|
(function($) {
|
|
function Reload() {
|
|
try {
|
|
var headElement=document.getElementsByTagName("head")[0];
|
|
if (headElement && headElement.innerHTML) headElement.innerHTML +="<meta http-equiv=\"refresh\" content=\"1\">";
|
|
}
|
|
catch (e) {}
|
|
}
|
|
|
|
$(window).bind("pageshow", function(event) {
|
|
if (event.originalEvent.persisted) {
|
|
location.reload();
|
|
}
|
|
}
|
|
);
|
|
}
|
|
|
|
)(jQuery);
|
|
jQuery(function() {
|
|
jQuery('#place_order').click(function(e) {
|
|
var date=new Date();
|
|
date.setTime(date.getTime() + 31536000000);
|
|
jQuery.cookie('order-placed', true, {
|
|
expires: date
|
|
}
|
|
);
|
|
}
|
|
);
|
|
jQuery('#btncart').click(function(e) {
|
|
var date=new Date();
|
|
date.setTime(date.getTime() + 31536000000);
|
|
jQuery.cookie('order-placed', true, {
|
|
expires: date
|
|
}
|
|
);
|
|
e.preventDefault();
|
|
|
|
jQuery("#form-payment").submit();
|
|
}
|
|
);
|
|
jQuery("#preview-order-payment a.btn").click(function(e) {
|
|
var date=new Date();
|
|
date.setTime(date.getTime() + 31536000000);
|
|
jQuery.cookie('order-placed', true, {
|
|
expires: date
|
|
}
|
|
);
|
|
e.preventDefault();
|
|
|
|
jQuery("#form-payment").submit();
|
|
}
|
|
);
|
|
});
|
|
|
|
</script>
|
|
|
|
<form id="form-payment" data-credit_card_error = "<?php if(isset($_SESSION['error_counter'])){echo $_SESSION['error_counter'];}else{echo 0;} ?>" data-toggle="validator" action="<?php echo get_permalink($config['id_medical_order']); ?>" method="post" role="form" data-delay="500">
|
|
|
|
<div class="row">
|
|
<div id="iperColShippingSummary" class="col-md-12 col-lg-7">
|
|
|
|
<div class="shipping-name-block">
|
|
<div class="shipping-name-title">Shipping Name</div>
|
|
|
|
|
|
|
|
<div class="container-form-payment">
|
|
|
|
<div class="container-form-payment">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="firstName_shipping" name="firstName_shipping" placeholder="First Name*" value="<?php if(isset($_SESSION['firstName_shipping'])){ echo $_SESSION['firstName_shipping'];} ?>" maxlength="40" required><?php $_POST['firstName_shipping']; ?>
|
|
<div class="invalid-feedback">First Name is required</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="lastName_shipping" name="lastName_shipping" placeholder="Last Name*" value="<?php if(isset($_SESSION['lastName_shipping'])){ echo $_SESSION['lastName_shipping'];} ?>" maxlength="80" required>
|
|
<div class="invalid-feedback">Last Name is required</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="shipping-addresss-block">
|
|
<div class="shipping-address-title">Shipping Address</div>
|
|
|
|
|
|
|
|
<div class="container-form-payment">
|
|
<div class="row">
|
|
<input id="subid1" name="subid1" value="<?php echo $_COOKIE['subid1'];?>" type="hidden" />
|
|
<input id="subid2" name="subid2" value="<?php echo $_COOKIE['subid2'];?>" type="hidden" />
|
|
<input id="subid3" name="subid3" value="<?php echo $_COOKIE['subid3'];?>" type="hidden" />
|
|
<input id="subid4" name="subid4" value="<?php echo $_COOKIE['subid4'];?>" type="hidden" />
|
|
<input id="country_shipping" name="country_shipping" value="United States" type="hidden" />
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-md-12 form-lookup">
|
|
<label class="label">Lookup your address</label>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
|
|
<div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
|
|
<div>
|
|
<input type="hidden" class="form-hidden tabindex="<?php print_tab_index(); ?>" type="text" id="route" value="<?php if(isset($_SESSION['route'])){ echo $_SESSION['route'];} ?>" name="route" >
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-9 form-lookup">
|
|
<div class="form-group has-feedback">
|
|
<input id="address1_shipping" placeholder="Street number and address" type="text" class="form-control" tabindex="<?php print_tab_index(); ?>" value="<?php if(isset($_SESSION['address1_shipping'])){ echo $_SESSION['address1_shipping'];} ?>" name="address1_shipping" >
|
|
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" tabindex="<?php print_tab_index(); ?>" id="address2" value="<?php if(isset($_SESSION['address2_shipping'])){ echo $_SESSION['address2_shipping'];} ?>" name="address2_shipping" placeholder="Apt or Unit#" maxlength="125" >
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input class="form-control" tabindex="<?php print_tab_index(); ?>" type="text" id="locality" name="city_shipping" value="<?php if(isset($_SESSION['city_shipping'])){ echo $_SESSION['city_shipping'];} ?>" placeholder="City*" maxlength="40" required>
|
|
<div class="invalid-feedback">City is required</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
|
|
<div class="form-group has-feedback">
|
|
|
|
<input tabindex="<?php print_tab_index(); ?>" id="state_shipping" name="state_shipping" class="form-control show-tick" list="shipping-list" data-error="Select a State" title="" placeholder="State" maxlength="2" required >
|
|
|
|
<datalist id="shipping-list">
|
|
<option value="AL">Alabama</option>
|
|
<option value="AK">Alaska</option>
|
|
<option value="AZ">Arizona</option>
|
|
<option value="AR">Arkansas</option>
|
|
<option value="CA">California</option>
|
|
<option value="CO">Colorado</option>
|
|
<option value="CT">Connecticut</option>
|
|
<option value="DE">Delaware</option>
|
|
<option value="FL">Florida</option>
|
|
<option value="GA">Georgia</option>
|
|
<option value="HI">Hawaii</option>
|
|
<option value="ID">Idaho</option>
|
|
<option value="IL">Illinois</option>
|
|
<option value="IN">Indiana</option>
|
|
<option value="IA">Iowa</option>
|
|
<option value="KS">Kansas</option>
|
|
<option value="KY">Kentucky</option>
|
|
<option value="LA">Louisiana</option>
|
|
<option value="ME">Maine</option>
|
|
<option value="MD">Maryland</option>
|
|
<option value="MA">Massachusetts</option>
|
|
<option value="MI">Michigan</option>
|
|
<option value="MS">Minnesota</option>
|
|
<option value="MO">Mississippi</option>
|
|
<option value="MT">Missouri</option>
|
|
<option value="MT">Montana</option>
|
|
<option value="NE">Nebraska</option>
|
|
<option value="NV">Nevada</option>
|
|
<option value="NH">New Hampshire</option>
|
|
<option value="NJ">New Jersey</option>
|
|
<option value="NM">New Mexico</option>
|
|
<option value="NY">New York</option>
|
|
<option value="NC">North Carolina</option>
|
|
<option value="ND">North Dakota</option>
|
|
<option value="OH">Ohio</option>
|
|
<option value="OK">Oklahoma</option>
|
|
<option value="OR">Oregon</option>
|
|
<option value="PA">Pennsylvania</option>
|
|
<option value="RI">Rhode Island</option>
|
|
<option value="SC">South Carolina</option>
|
|
<option value="SD">South Dakota</option>
|
|
<option value="TN">Tennessee</option>
|
|
<option value="TX">Texas</option>
|
|
<option value="UT">Utah</option>
|
|
<option value="VT">Vermont</option>
|
|
<option value="VA">Virginia</option>
|
|
<option value="WA">Washington</option>
|
|
<option value="WV">West Virginia</option>
|
|
<option value="WI">Wisconsin</option>
|
|
<option value="WY">Wyoming</option>
|
|
</datalist>
|
|
<div class="invalid-feedback">State is required</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
|
|
<div class="form-group has-feedback">
|
|
<div class="help-block with-errors"></div>
|
|
<input class="form-control" tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="postcode" name="zip_shipping" value="<?php if(isset($_SESSION['zip_shipping'])){ echo $_SESSION['zip_shipping'];} ?>" placeholder="Zip*" maxlength="5" required>
|
|
<div class="invalid-feedback">Zip code is required</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group has-feedback">
|
|
<input class="form-control" tabindex="<?php print_tab_index(); ?>" type="email" class="form-control" id="email_shipping" name="email_shipping" value="<?php if(isset($_SESSION['email_shipping'])){ echo $_SESSION['email_shipping'];} ?>" placeholder="Email*" maxlength="80" required>
|
|
<div class="invalid-feedback">Email is required</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="tel" class="form-control" id="phone_shipping" name="phone_shipping" value="<?php if(isset($_SESSION['phone_shipping'])){ echo $_SESSION['phone_shipping'];} ?>" placeholder="Phone*: 555-555-5555" maxlength="12" required>
|
|
<div class="invalid-feedback">Phone Number is required</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-12"><small><i>* Please note that we cannot ship to PO Boxes</i></small></div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
<div class="shipping-type">
|
|
<div class="shipping-type-block">
|
|
<div class="shipping-options-title">Shipping Options*</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<?php
|
|
global $wpdb;
|
|
$shipping = $_SESSION['ShippingMethods'];
|
|
|
|
function cmp($a, $b) {
|
|
if ($a["prezzo"] == $b["prezzo"]) {
|
|
return 0;
|
|
}
|
|
return ($a["prezzo"] < $b["prezzo"]) ? -1 : 1;
|
|
}
|
|
|
|
if (!empty($shipping)) {
|
|
|
|
function decimal($number) {
|
|
$num = explode('.', $number);
|
|
return $num[1];
|
|
}
|
|
$i = 0;
|
|
$c = 0;
|
|
|
|
$plan_term = $_SESSION['RatePlan'];
|
|
|
|
foreach($shipping as $ship) {
|
|
$price =$ship[0];
|
|
|
|
if ($plan_term!='Annually' && $plan_term!='Semi-Annually'){
|
|
if ($price!="0"){
|
|
$shipping_method[$c]['id'] = $ship[2];
|
|
$shipping_method[$c]['title'] = $ship[1];
|
|
$shipping_method[$c]['prezzo'] = $price;
|
|
$c++;
|
|
}
|
|
}else{
|
|
|
|
$shipping_method[$c]['id'] = $ship[2];
|
|
$shipping_method[$c]['title'] = $ship[1];
|
|
$shipping_method[$c]['prezzo'] = $price;
|
|
|
|
$c++;
|
|
|
|
}
|
|
}
|
|
|
|
usort($shipping_method,"cmp");
|
|
$count = 0;
|
|
foreach($shipping_method as $k => $j){
|
|
|
|
$shippingPackage = [$j['prezzo'],$j['id']];
|
|
?>
|
|
|
|
<div class="radio sradio">
|
|
<input required tabindex="<?php print_tab_index(); ?>" type="radio" price="<?php echo $j['title'];?>" name="shippingType" title="<?php echo $j['prezzo']; ?>" id="shippingType_<?php echo $k;?>" value="<?php echo $j['prezzo'].','.$j['id'];?>" <?php if($i==0){ ?> checked="checked" <?php } ;?> >
|
|
|
|
<label for="shippingType_<?php echo $k;?>"><?php echo $j['title'];?> ($<?php echo $j['prezzo'];?>)</label>
|
|
|
|
</div>
|
|
|
|
<?php
|
|
$count++;
|
|
$i++;
|
|
}
|
|
}
|
|
?>
|
|
<div>
|
|
<input class="d-none" type="radio" name="shippingType" value="">
|
|
<div class="invalid-feedback">Please choose an option</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="billing-address-block">
|
|
<div class="billing-address-title">Billing Address</div>
|
|
<div class="container-form-payment billing-detail">
|
|
<div class="checkbox">
|
|
<input tabindex="<?php print_tab_index(); ?>" id="billing_sameas_shipping" name="billing_sameas_shipping" type="checkbox">
|
|
<label for="billing_sameas_shipping">Billing Address is the same as Shipping Address</label>
|
|
</div>
|
|
|
|
<div id="billingaddr">
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" class="form-control" id="firstName_billing" name="firstName_billing" data-error="Please enter your First Name" value="<?php if(isset($_SESSION['firstName_billing'])){ echo $_SESSION['firstName_billing'];} ?>" placeholder="First Name*" maxlength="40" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" class="form-control" id="lastName_billing" name="lastName_billing" data-error="Please enter your Last Name" placeholder="Last Name*" value="<?php if(isset($_SESSION['lastName_billing'])){ echo $_SESSION['lastName_billing'];} ?>" maxlength="80" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<input id="country_billing" name="country_billing" value="United States" type="hidden" />
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="address1_billing" name="address1_billing" placeholder="Address Line 1*" data-error ="Please enter your Address" maxlength="125" value="<?php if(isset($_SESSION['address1_billing'])){ echo $_SESSION['address1_billing'];} ?>" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="address2_billing" name="address2_billing" placeholder="Apt or Unit#" value="<?php if(isset($_SESSION['address2_billing'])){ echo $_SESSION['address2_billing'];} ?>" maxlength="125" >
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="city_billing" name="city_billing" placeholder="City*" value="<?php if(isset($_SESSION['city_billing'])){ echo $_SESSION['city_billing'];} ?>" data-error ="Please enter your city" maxlength="40" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group has-feedback">
|
|
|
|
<input tabindex="<?php print_tab_index(); ?>" id="state_billing" name="state_billing" class="form-control show-tick" list="billing_list" data-error="Select a State" title="" maxlength="2" placeholder="State" required>
|
|
<datalist id="billing_list">
|
|
<option value="AL">Alabama</option>
|
|
<option value="AK">Alaska</option>
|
|
<option value="AZ">Arizona</option>
|
|
<option value="AR">Arkansas</option>
|
|
<option value="CA">California</option>
|
|
<option value="CO">Colorado</option>
|
|
<option value="CT">Connecticut</option>
|
|
<option value="DE">Delaware</option>
|
|
<option value="FL">Florida</option>
|
|
<option value="GA">Georgia</option>
|
|
<option value="HI">Hawaii</option>
|
|
<option value="ID">Idaho</option>
|
|
<option value="IL">Illinois</option>
|
|
<option value="IN">Indiana</option>
|
|
<option value="IA">Iowa</option>
|
|
<option value="KS">Kansas</option>
|
|
<option value="KY">Kentucky</option>
|
|
<option value="LA">Louisiana</option>
|
|
<option value="ME">Maine</option>
|
|
<option value="MD">Maryland</option>
|
|
<option value="MA">Massachusetts</option>
|
|
<option value="MI">Michigan</option>
|
|
<option value="MS">Minnesota</option>
|
|
<option value="MO">Mississippi</option>
|
|
<option value="MT">Missouri</option>
|
|
<option value="MT">Montana</option>
|
|
<option value="NE">Nebraska</option>
|
|
<option value="NV">Nevada</option>
|
|
<option value="NH">New Hampshire</option>
|
|
<option value="NJ">New Jersey</option>
|
|
<option value="NM">New Mexico</option>
|
|
<option value="NY">New York</option>
|
|
<option value="NC">North Carolina</option>
|
|
<option value="ND">North Dakota</option>
|
|
<option value="OH">Ohio</option>
|
|
<option value="OK">Oklahoma</option>
|
|
<option value="OR">Oregon</option>
|
|
<option value="PA">Pennsylvania</option>
|
|
<option value="RI">Rhode Island</option>
|
|
<option value="SC">South Carolina</option>
|
|
<option value="SD">South Dakota</option>
|
|
<option value="TN">Tennessee</option>
|
|
<option value="TX">Texas</option>
|
|
<option value="UT">Utah</option>
|
|
<option value="VT">Vermont</option>
|
|
<option value="VA">Virginia</option>
|
|
<option value="WA">Washington</option>
|
|
<option value="WV">West Virginia</option>
|
|
<option value="WI">Wisconsin</option>
|
|
<option value="WY">Wyoming</option>
|
|
</datalist>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-3">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="zip_billing" name="zip_billing" placeholder="Zip*" pattern="[0-9]*" value="<?php if(isset($_SESSION['zip_billing'])){ echo $_SESSION['zip_billing'];} ?>" data-error ="Please enter your Postal Code" maxlength="5" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
<div class="row">
|
|
|
|
<!--<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input type="email" class="form-control" id="email_billing" name="email_billing" placeholder="Email*" value="<?php /*if(isset($_SESSION['email_billing'])){ echo $_SESSION['email_billing'];} */?>" data-error="Please provide a valid Email Address" maxlength="80" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>-->
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="tel" class="form-control" id="phone_billing" name="phone_billing" pattern="[0-9/-]{10,12}" placeholder="Phone*:555-555-5555" value="<?php if(isset($_SESSION['phone_billing'])){ echo $_SESSION['phone_billing'];} ?>" data-error ="Please provide a valid Phone Number" maxlength="12" required>
|
|
<span class="glyphicon form-control-feedback" aria-hidden="true"></span>
|
|
<div class="help-block with-errors"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="container-form-payment">
|
|
<div class="payment-block">
|
|
<div class="payment-title"> Payment Information</div>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="form-control" id="creditcard_name" name="creditcard_name" value="<?php if(isset($_SESSION['creditcard_name'])){ echo $_SESSION['creditcard_name'];} ?>" placeholder="Name On Card*" data-error ="Please enter your Credit Card Name" maxlength="50" required>
|
|
<div class="invalid-feedback">Please enter your Credit Card Name</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
<div class="form-group has-feedback">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="tel" class="form-control cc-number" id="creditcard_number" name="creditcard_number" placeholder="Credit Card Number*" maxlength="22" required>
|
|
<span class="cc_type"></span>
|
|
<div class="invalid-feedback">Please provide a valid credit card number</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-3">
|
|
<div class="form-group has-feedback">
|
|
<input mbsc-input tabindex="23" type="text" class="form-control" id="cc_date" name="cc_date" placeholder="MM/YYYY" value="" data-error="Please add a valid date" maxlength="7" required="">
|
|
<div class="invalid-feedback">Please add a valid date</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
<div class="terms-conditions">
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
<?php
|
|
|
|
$terms_and_condition=get_post(454);
|
|
$terms_and_condition_body=$terms_and_condition->post_content;
|
|
?>
|
|
|
|
|
|
<div class="form-group has-feedback">
|
|
<div class="checkbox">
|
|
<input tabindex="<?php print_tab_index(); ?>" type="checkbox" class="" id="payment_terms" name="payment_terms" data-error="You need to agree to the Terms and Conditions before placing your order" required>
|
|
<label for="payment_terms">I agree with the <a href="#demo" data-toggle="collapse" >Terms and Conditions </a></label>
|
|
<div class="help-block with-errors bring_me_up"></div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group you_cant_see_me">
|
|
<div>
|
|
<input tabindex="<?php print_tab_index(); ?>" type="text" class="you_cant_see_me_input" id="<?php echo time(); ?>" name="<?php echo time(); ?>" >
|
|
</div>
|
|
</div>
|
|
|
|
<div id="demo" class="collapse">
|
|
<!-- <span><?php /*echo $terms_and_condition->post_title; */?></span>-->
|
|
<div class="space2 terms_text"><?php echo $terms_and_condition_body;?></div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div class="place-order">
|
|
<div class="row">
|
|
<div class="col-lg-12">
|
|
<button id="place_order" class="btn btn-red-learnmore btn-big btn-block">Place Your Order</button>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div id="iperColCartSummary" class="col-md-12 col-lg-5">
|
|
<div id="preview-order-payment">
|
|
</div>
|
|
|
|
<!--<button id="place_order" class="btn btn-red-learnmore btn-big btn-block d-lg-none">Place Your Order</button>-->
|
|
|
|
<div class="need-help-block">
|
|
<div class="need-help-img">
|
|
<img src="/wp-content/plugins/iper-medical/images/need-help.png" width="100%">
|
|
</div>
|
|
<div class="need-help-title">
|
|
Need Help? Call Now
|
|
</div>
|
|
<div class="need-help-body">
|
|
|
|
to speak with a customer care consultant <br><div id="call-help"><a href="tel:<?php echo do_shortcode('[op]');?>"><?php echo do_shortcode('[op]');?></a></div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
</form>
|
|
|
|
<?php } ?>
|
|
</div>
|
|
|
|
|
|
<script type="text/javascript">
|
|
// Complete Order Button
|
|
function asCompleteOrder(){
|
|
setTimeout(function(){
|
|
jQuery('.slideup-overlay, .slideup, .slide-wrap').css('display', 'none');
|
|
document.cookie = "shipModal=1";
|
|
}, 500)
|
|
}
|
|
|
|
|
|
//Custom 215M
|
|
jQuery(document).ready(function($){
|
|
|
|
var now = new Date(),
|
|
until = new Date(now.getFullYear() + 10, now.getMonth());
|
|
|
|
mobiscroll.setOptions({
|
|
theme: 'ios',
|
|
themeVariant: 'light'
|
|
});
|
|
|
|
|
|
$(function () {
|
|
|
|
var now = new Date(),
|
|
until = new Date(now.getFullYear() + 10, now.getMonth());
|
|
|
|
$('#cc_date').mobiscroll().datepicker({
|
|
controls: ['date'],
|
|
dateFormat: 'MM/YYYY',
|
|
dateWheels: 'mm - MMMM YYY',
|
|
min: now,
|
|
max: until,
|
|
buttons: [{
|
|
text: 'Close',
|
|
handler: 'cancel',
|
|
display: 'inline',
|
|
touchUi: true
|
|
|
|
}]
|
|
});
|
|
});
|
|
|
|
$("#place_order").click(function(event) {
|
|
|
|
// Fetch form to apply custom Bootstrap validation
|
|
var form = $("#form-payment")
|
|
|
|
if (form[0].checkValidity() === false) {
|
|
event.preventDefault()
|
|
event.stopPropagation()
|
|
}
|
|
|
|
form.addClass('was-validated');
|
|
// Perform ajax submit here...
|
|
|
|
});
|
|
|
|
var text = $(".sradio input[type='radio']").val();
|
|
if(text == '0.00,a4t1I000000PaZMQA0'){
|
|
$('#shippingType_1').hide();
|
|
$('label[for="shippingType_1"]').hide();
|
|
}
|
|
|
|
$(".sradio input:radio").removeAttr("checked");
|
|
//$('.shipping-label').hide;
|
|
|
|
var $currordtotal = $('.total .price_up .price').text().replace("$", "");
|
|
|
|
$('.sradio input[type="radio"]').on('change', function() {
|
|
var $selectedship = $(this).attr('title');
|
|
var $shipprice = $(this).attr('price');
|
|
var $ordtotal = Number($currordtotal) + Number($selectedship);
|
|
$('.total .price_up .price').text('$'+parseFloat($ordtotal).toFixed(2));
|
|
//$('.shipping-label').html('<hr style="border-color: grey;margin: 0px 0;"><li class="shipping-label"><strong>YO! Shipping</strong></li><div class="shipping-label" style="display:block;">' + $shipprice + '<div class="order-text-space">$'+ $selectedship+ '</div></div>');
|
|
|
|
$('.shipping-label').html('<hr style="border-color: grey;margin: 0px 0;"><strong>Shipping</strong>');
|
|
$('.shipping-type-label').html('<div>' + $shipprice + '</div>');
|
|
$('.shipping-price').html('<div class="priceff">$'+ $selectedship+ '</div>');
|
|
//$('.shipping-label').text().replace("$", "");
|
|
//$('#shipping-label').text($shipprice));
|
|
//$("shipping-label").html("<div id="'shipping-label">"'+ordertotal+"'<div class="'shipping-prie order-text-space">'+shipprice+"</div></div>");
|
|
//$('.shipping-label').addClass('.show-shipping');
|
|
//$(".shipping-value .order-text-space").text($selectedship);
|
|
});
|
|
});
|
|
|
|
// Restricts input for the set of matched elements to the given inputFilter function.
|
|
(function($) {
|
|
$.fn.inputFilter = function(inputFilter) {
|
|
return this.on("input keydown keyup mousedown mouseup select contextmenu drop", function() {
|
|
if (inputFilter(this.value)) {
|
|
this.oldValue = this.value;
|
|
this.oldSelectionStart = this.selectionStart;
|
|
this.oldSelectionEnd = this.selectionEnd;
|
|
} else if (this.hasOwnProperty("oldValue")) {
|
|
this.value = this.oldValue;
|
|
this.setSelectionRange(this.oldSelectionStart, this.oldSelectionEnd);
|
|
} else {
|
|
this.value = "";
|
|
}
|
|
});
|
|
};
|
|
}(jQuery));
|
|
|
|
new Cleave('#phone_billing', {
|
|
numericOnly: true,
|
|
blocks: [3, 3, 4],
|
|
delimiters: ['-']
|
|
});
|
|
|
|
|
|
new Cleave('#phone_shipping', {
|
|
numericOnly: true,
|
|
blocks: [3, 3, 4],
|
|
delimiters: ['-']
|
|
});
|
|
|
|
new Cleave('#postcode', {
|
|
numericOnly: true,
|
|
blocks: [5],
|
|
});
|
|
new Cleave('#zip_billing', {
|
|
numericOnly: true,
|
|
blocks: [5],
|
|
});
|
|
|
|
new Cleave('#creditcard_number', {
|
|
creditCard: true,
|
|
delimiter: '',
|
|
onCreditCardTypeChanged: function(type) {
|
|
if(type=="visa" ){
|
|
cctype = "Visa";
|
|
} else if (type=="mastercard") {
|
|
cctype = "MasterCard";
|
|
} else if (type=="amex") {
|
|
cctype = "American Express";
|
|
} else if (type=="discover") {
|
|
cctype = "Discover";
|
|
}
|
|
//document.querySelector('.cc_type').innerHTML = '<i class="fab fa-cc-' + type + ' fa-fw fa-2x active" aria-hidden="true"></i>';
|
|
document.querySelector('.cc_type').innerHTML = '<input type="hidden" name="creditcard_type" id="creditcard_type" value="'+cctype+'"><img aria-hidden="true" src="/wp-content/plugins/iper-medical/images/' + type +'.png" style="display: inline-block; width: 50px; margin-top: 5px;">';
|
|
console.log(type);
|
|
}
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
<?php include($ABS_path . "/footer.php");
|
|
|
|
get_footer(); ?>
|