// source --> http://travel.ketrintours.com/wp-content/plugins/woocommerce/assets/js/frontend/add-to-cart.min.js?ver=3.4.8 jQuery(function(e){if("undefined"==typeof wc_add_to_cart_params)return!1;var t=function(){e(document.body).on("click",".add_to_cart_button",this.onAddToCart).on("click",".remove_from_cart_button",this.onRemoveFromCart).on("added_to_cart",this.updateButton).on("added_to_cart",this.updateCartPage).on("added_to_cart removed_from_cart",this.updateFragments)};t.prototype.onAddToCart=function(t){var a=e(this);if(a.is(".ajax_add_to_cart")){if(!a.attr("data-product_id"))return!0;t.preventDefault(),a.removeClass("added"),a.addClass("loading");var o={};e.each(a.data(),function(t,a){o[t]=a}),e(document.body).trigger("adding_to_cart",[a,o]),e.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","add_to_cart"),o,function(t){t&&(t.error&&t.product_url?window.location=t.product_url:"yes"!==wc_add_to_cart_params.cart_redirect_after_add?e(document.body).trigger("added_to_cart",[t.fragments,t.cart_hash,a]):window.location=wc_add_to_cart_params.cart_url)})}},t.prototype.onRemoveFromCart=function(t){var a=e(this),o=a.closest(".woocommerce-mini-cart-item");t.preventDefault(),o.block({message:null,overlayCSS:{opacity:.6}}),e.post(wc_add_to_cart_params.wc_ajax_url.toString().replace("%%endpoint%%","remove_from_cart"),{cart_item_key:a.data("cart_item_key")},function(t){t&&t.fragments?e(document.body).trigger("removed_from_cart",[t.fragments,t.cart_hash]):window.location=a.attr("href")}).fail(function(){window.location=a.attr("href")})},t.prototype.updateButton=function(t,a,o,r){(r=void 0!==r&&r)&&(r.removeClass("loading"),r.addClass("added"),wc_add_to_cart_params.is_cart||0!==r.parent().find(".added_to_cart").length||r.after(' '+wc_add_to_cart_params.i18n_view_cart+""),e(document.body).trigger("wc_cart_button_updated",[r]))},t.prototype.updateCartPage=function(){var t=window.location.toString().replace("add-to-cart","added-to-cart");e(".shop_table.cart").load(t+" .shop_table.cart:eq(0) > *",function(){e(".shop_table.cart").stop(!0).css("opacity","1").unblock(),e(document.body).trigger("cart_page_refreshed")}),e(".cart_totals").load(t+" .cart_totals:eq(0) > *",function(){e(".cart_totals").stop(!0).css("opacity","1").unblock(),e(document.body).trigger("cart_totals_refreshed")})},t.prototype.updateFragments=function(t,a){a&&(e.each(a,function(t){e(t).addClass("updating").fadeTo("400","0.6").block({message:null,overlayCSS:{opacity:.6}})}),e.each(a,function(t,a){e(t).replaceWith(a),e(t).stop(!0).css("opacity","1").unblock()}),e(document.body).trigger("wc_fragments_loaded"))},new t}); // source --> http://travel.ketrintours.com/wp-content/plugins/js_composer/assets/js/vendors/woocommerce-add-to-cart.js?ver=7.9 (function ( $ ) { 'use strict'; $( document ).ready( function () { $( 'body' ).on( 'adding_to_cart', function ( event, $button, data ) { if ( $button && $button.hasClass( 'vc_gitem-link' ) ) { $button .addClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .addClass( 'vc-woocommerce-add-to-cart-loading' ) .append( $( '
' ) ); } } ).on( 'added_to_cart', function ( event, fragments, cart_hash, $button ) { if ( 'undefined' === typeof ($button) ) { $button = $( '.vc-gitem-add-to-cart-loading-btn' ); } if ( $button && $button.hasClass( 'vc_gitem-link' ) ) { $button .removeClass( 'vc-gitem-add-to-cart-loading-btn' ) .parents( '.vc_grid-item-mini' ) .removeClass( 'vc-woocommerce-add-to-cart-loading' ) .find( '.vc_wc-load-add-to-loader-wrapper' ).remove(); } } ); } ); })( window.jQuery ); // source --> http://travel.ketrintours.com/wp-content/themes/traveler/js/init/single-car.js?ver=4.9.26 /** * Created by me664 on 3/2/15. */ jQuery(document).ready(function($){ var message_box = $('.car_booking_form .message_box'); var car_booking_form = $('.car_booking_form'); $('.car_booking_form input[type=submit]').click(function(){ if(validate_car_booking()){ car_booking_form.submit(); }else { return false; } }); $('.car_booking_form .btn_booking_modal').click(function(){ if(validate_car_booking()){ var tar_get=$(this).data('target'); $.magnificPopup.open({ items: { type: 'inline', src: tar_get } }); } }); function validate_car_booking() { var form_validate=true; message_box.html(''); message_box.removeClass('alert'); try{ if(typeof st_car_booking_validate!="undefined"){ for(i = 0; i < st_car_booking_validate.required.length; i++){ var field_name=st_car_booking_validate.required[i]; console.log(car_booking_form.find('[name='+field_name+']').val()); if(!car_booking_form.find('[name='+field_name+']').val()){ form_validate = false; } } } if(!form_validate){ form_validate=false; $('.popup-text[href=#search-dialog]').trigger('click'); } }catch(e){ console.log(e); } return form_validate; } }); jQuery(document).ready(function($) { booking_period = $('#search-dialog').data('booking-period'); if(typeof booking_period != 'undefined' && parseInt(booking_period) > 0){ var data = { booking_period : booking_period, action: 'st_getBookingPeriod' }; $.post(st_params.ajax_url, data, function(respon) { if(respon != ''){ $('input.car_pick-up-date, input.car_drop-off-date').datepicker('setRefresh',true); $('input.car_pick-up-date, input.car_drop-off-date').datepicker('setDatesDisabled',respon); } },'json'); $( document ).ajaxStop(function() { $('.overlay-form').fadeOut(500); }); }else{ $('.overlay-form').fadeOut(500); } });