var _____WB$wombat$assign$function_____=function(name){return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name))||self[name];};if(!self.__WB_pmw){self.__WB_pmw=function(obj){this.__WB_source=obj;return this;}}{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opens = _____WB$wombat$assign$function_____("opens");
jQuery( function($) {
//Remove loading from modal
$( '#rpressModal' ).removeClass('loading');
//Remove service options from modal
$( '#rpressModal' ).removeClass( 'show-service-options' );
$( '#rpressModal' ).removeClass( 'minimum-order-notice' );
$( '#rpressModal' ).on('hidden.bs.modal', function () {
$( '#rpressModal' ).removeClass( 'show-service-options' );
$( '#rpressModal' ).removeClass( 'minimum-order-notice' );
});
var ServiceType = rp_scripts.service_options;
if ( ServiceType == 'delivery_and_pickup' ) {
ServiceType = 'delivery';
}
// Add to Cart
$('.rpress-add-to-cart').click(function(e) {
e.preventDefault();
var rp_get_delivery_data = rp_get_storage_data();
$( '#rpressModal' ).hide();
$( '#rpressModal' ).addClass('loading');
$( '#rpressModal .modal-body' ).html('' + rp_scripts.please_wait + '');
$( '#rpressModal' ).removeClass( 'rpress-delivery-options rpress-food-options checkout-error' );
$( '#rpressModal .qty' ).val('1');
$( '#rpressModal' ).find( '.cart-action-text' ).html( rp_scripts.add_to_cart );
if ( ! rp_get_delivery_data ) {
var action = 'rpress_show_delivery_options';
var security = rp_scripts.service_type_nonce;
$( '#rpressModal' ).addClass( 'show-service-options' );
} else {
var action = 'rpress_show_products';
var security = rp_scripts.show_products_nonce;
}
var _self = $(this);
var fooditem_id = _self.attr( 'data-fooditem-id' );
var price = _self.attr( 'data-price' );
var variable_price = _self.attr('data-variable-price');
var data = {
action : action,
fooditem_id : fooditem_id,
security : security,
};
$( '#rpressModal' ).modal();
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
xhrFields: {
withCredentials: true
},
success : function( response ) {
$( '#rpressModal' ).removeClass('loading');
$( '#rpressModal .modal-title' ).html( response.data.html_title );
$( '#rpressModal .modal-body' ).html( response.data.html );
$( '#rpressModal .rpress-prices').html(response.data.price);
if ( $( '.rpress-tabs-wrapper' ).length ) {
$( '#rpressdeliveryTab > li:first-child > a' )[0].click();
}
// Trigger event so themes can refresh other areas.
$( document.body ).trigger( 'opened_service_options', [ response.data ] );
$( '#rpressModal' ).find( '.submit-fooditem-button' ).attr( 'data-cart-action', 'add-cart' );
$( '#rpressModal' ).find( '.cart-action-text' ).html( rp_scripts.add_to_cart );
if ( fooditem_id !== '' && price !== '' ) {
$('#rpressModal').find('.submit-fooditem-button').attr('data-item-id', fooditem_id); //setter
$('#rpressModal').find('.submit-fooditem-button').attr('data-item-price', price);
$('#rpressModal').find('.submit-fooditem-button').attr('data-item-qty', 1);
}
}
});
});
//Update cart item
$( '.rpress-sidebar-cart' ).on( 'click', 'a.rpress-edit-from-cart', function(e) {
e.preventDefault();
var _self = $(this);
_self.parents( '.rpress-cart-item' ).addClass( 'edited' );
var CartItemId = _self.attr( 'data-remove-item' );
var FoodItemId = _self.attr( 'data-item-id' );
var FoodItemName = _self.attr( 'data-item-name' );
var FoodQuantity = _self.parents( '.rpress-cart-item' ).find( '.cart-item-quantity-wrap' ).children( '.rpress-cart-item-qty' ).text();
var action = 'rpress_edit_cart_fooditem';
var security = rp_scripts.edit_cart_fooditem_nonce;
$( '#rpressModal' ).modal();
$( '#rpressModal' ).addClass('loading');
$( '#rpressModal .modal-body' ).html('' + rp_scripts.please_wait + '');
var data = {
action : action,
cartitem_id : CartItemId,
fooditem_id : FoodItemId,
fooditem_name : FoodItemName,
security : security,
};
if( CartItemId !== '' ) {
$.ajax({
type: "POST",
data: data,
dataType: "json",
url: rp_scripts.ajaxurl,
xhrFields: {
withCredentials: true
},
success: function(response) {
$( '#rpressModal' ).removeClass('checkout-error');
$( '#rpressModal' ).removeClass('show-service-options');
$( '#rpressModal' ).removeClass('loading');
$( '#rpressModal .modal-title' ).html( response.data.html_title );
$( '#rpressModal .rpress-prices').html(response.data.price);
$( '#rpressModal' ).find( ".qty" ).val(FoodQuantity);
$( '#rpressModal' ).find( '.submit-fooditem-button' ).attr( 'data-item-id', FoodItemId );
$( '#rpressModal' ).find( '.submit-fooditem-button' ).attr( 'data-cart-key', CartItemId );
$( '#rpressModal' ).find( '.submit-fooditem-button' ).attr( 'data-cart-action', 'update-cart' );
$( '#rpressModal' ).find( '.submit-fooditem-button' ).text( rp_scripts.update_cart );
$( '#rpressModal .modal-body' ).html( response.data.html );
}
});
}
});
// Add to Cart / Update Cart Button From Popup
$( document ).on( 'click', '.submit-fooditem-button', function(e) {
e.preventDefault();
var self = $(this);
var RP_Modal = self.parents( '#rp-modal' );
var cartAction = self.attr( 'data-cart-action' );
var text = self.text();
self.text( rp_scripts.please_wait );
if( cartAction == 'add-cart' ) {
self.addClass('disable_click');
var Form = $(this).parents('.modal').find('form#fooditem-details');
var itemId = $(this).attr('data-item-id');
var action = 'rpress_add_to_cart';
var itemQty = $(this).attr('data-item-qty');
var FormData = Form.serializeArray();
var SpecialInstruction = $(this).parents('.modal').find('textarea.special-instructions').val();
var data = {
action : action,
fooditem_id : itemId,
fooditem_qty : itemQty,
special_instruction: SpecialInstruction,
post_data : Form.serializeArray(),
security : rp_scripts.add_to_cart_nonce
};
if( itemId !== '' ) {
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
xhrFields : {
withCredentials: true
},
success: function(response) {
if( response ) {
self.removeClass('disable_click');
self.text(text);
var serviceType = rp_getCookie('service_type');
var serviceTime = rp_getCookie('service_time');
var serviceDate = rp_getCookie('delivery_date');
$('ul.rpress-cart').find('li.cart_item.empty').remove();
$('ul.rpress-cart').find('li.cart_item.rpress_subtotal').remove();
$('ul.rpress-cart').find('li.cart_item.cart-sub-total').remove();
$('ul.rpress-cart').find('li.cart_item.rpress_cart_tax').remove();
$('ul.rpress-cart').find('li.cart_item.rpress-cart-meta.rpress-delivery-fee').remove();
$('ul.rpress-cart').find('li.cart_item.rpress-cart-meta.rpress_subtotal').remove();
$(response.cart_item).insertBefore('ul.rpress-cart li.cart_item.rpress_total');
if( $('.rpress-cart').find('.rpress-cart-meta.rpress_subtotal').is(':first-child') ) {
$(this).hide();
}
$('.rpress-cart-quantity').show().text(response.cart_quantity);
$('.cart_item.rpress-cart-meta.rpress_total').find('.cart-total').text(response.total);
$('.cart_item.rpress-cart-meta.rpress_subtotal').find('.subtotal').text(response.total);
$('.cart_item.rpress-cart-meta.rpress_total').css('display', 'block');
$('.cart_item.rpress-cart-meta.rpress_subtotal').css('display', 'block');
$('.cart_item.rpress_checkout').addClass(rp_scripts.button_color);
$('.cart_item.rpress_checkout').css('display', 'block');
if( serviceType !== undefined ) {
serviceLabel = window.localStorage.getItem('serviceLabel');
var orderInfo = ''+ serviceLabel + ', ' + serviceDate + '';
if( serviceTime !== undefined ) {
orderInfo += ', '+ serviceTime + '';
}
$('.delivery-items-options').find('.delivery-opts').html( orderInfo );
if( $('.delivery-wrap .delivery-change').length == 0 ) {
$( ""+ rp_scripts.change_txt +"" ).insertAfter( ".delivery-opts" );
}
}
$('.delivery-items-options').css('display', 'block');
var subTotal = '
'+rp_scripts.total_text+''+response.subtotal+'';
if( response.taxes ) {
var taxHtml = ''+rp_scripts.estimated_tax+''+response.taxes+'';
$(taxHtml).insertBefore('ul.rpress-cart li.cart_item.rpress_total');
$(subTotal).insertBefore('ul.rpress-cart li.cart_item.rpress_cart_tax');
}
if( response.taxes === undefined ) {
$('ul.rpress-cart').find('.cart_item.rpress-cart-meta.rpress_subtotal').remove();
var cartLastChild = $('ul.rpress-cart>li.rpress-cart-item:last');
$(subTotal).insertAfter(cartLastChild);
}
$(document.body).trigger('rpress_added_to_cart', [ response ]);
$('ul.rpress-cart').find('.cart-total').html(response.total);
$('ul.rpress-cart').find('.cart-subtotal').html(response.subtotal);
if ( $( 'li.rpress-cart-item' ).length > 0 ){
$( 'a.rpress-clear-cart' ).show();
}else {
$( 'a.rpress-clear-cart' ).hide();
}
$('#rpressModal').modal('hide');
$('#rpressModal').css('display', 'none');
self.text( rp_scripts.add_to_cart );
$(document.body).trigger('rpress_added_to_cart', [ response ]);
}
}
})
}
}
if ( cartAction == 'update-cart' ) {
var itemId = self.attr( 'data-item-id' );
var itemPrice = self.attr( 'data-item-price' );
var cartKey = self.attr( 'data-cart-key' );
var itemQty = self.attr( 'data-item-qty' );
var FormData = self.parents('.modal').find( '#fooditem-update-details' ).serializeArray();
var SpecialInstruction = self.parents('.modal').find( 'textarea.special-instructions' ).val();
var action = 'rpress_update_cart_items';
var data = {
action : action,
fooditem_id : itemId,
fooditem_qty : itemQty,
fooditem_cartkey : cartKey,
special_instruction : SpecialInstruction,
post_data : FormData,
security : rp_scripts.update_cart_item_nonce
};
if ( itemId !== '' ) {
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
xhrFields : {
withCredentials: true
},
success: function( response ) {
self.text(text);
if ( response ) {
Html = response.cart_item;
$('ul.rpress-cart').find('li.rpress_total .cart-total').text(response.total);
$('ul.rpress-cart').find('li.cart_item.empty').remove();
$('.rpress-cart >li.rpress-cart-item').each( function( index, item ) {
$(this).find("[data-cart-item]").attr('data-cart-item', index);
$(this).attr('data-cart-key', index);
$(this).attr('data-remove-item', index);
});
$( 'ul.rpress-cart' ).find( 'li.edited' ).replaceWith( function() {
let obj = $(Html);
obj.attr('data-cart-key', response.cart_key);
obj.find("a.rpress-edit-from-cart").attr("data-cart-item", response.cart_key);
obj.find("a.rpress-edit-from-cart").attr("data-remove-item", response.cart_key);
obj.find("a.rpress_remove_from_cart").attr("data-cart-item", response.cart_key);
obj.find("a.rpress_remove_from_cart").attr("data-remove-item", response.cart_key);
return obj;
} );
$('ul.rpress-cart').find('.cart-total').html(response.total);
$('ul.rpress-cart').find('.subtotal').html(response.subtotal);
$('ul.rpress-cart').find('.cart-tax').html(response.tax);
$(document.body).trigger('rpress_items_updated', [ response ]);
$('#rpressModal').modal('hide');
$('#rpressModal').css('display', 'none');
}
}
});
}
}
});
//Update service options
$( 'body' ).on( 'click', '.rpress-delivery-opt-update', function( e ) {
e.preventDefault();
var _self = $(this);
var foodItemId = _self.attr('data-food-id');
if ( $('.rpress-tabs-wrapper').find('.nav-item.active a').length > 0 ) {
var serviceType = $('.rpress-tabs-wrapper').find('.nav-item.active a').attr('data-service-type');
var serviceLabel = $('.rpress-tabs-wrapper').find('.nav-item.active a').text().trim();
//Store the service label for later use
window.localStorage.setItem( 'serviceLabel', serviceLabel );
}
var serviceTime = _self.parents('.rpress-tabs-wrapper').find('.delivery-settings-wrapper.active .rpress-hrs').val();
var serviceDate = _self.parents('.rpress-tabs-wrapper').find('.delivery-settings-wrapper.active .rpress_get_delivery_dates').val();
if ( serviceTime === undefined && ( rpress_scripts.pickup_time_enabled == 1 && serviceType == 'pickup' || rpress_scripts.delivery_time_enabled == 1 && serviceType == 'delivery' )) {
_self.parents('.rpress-delivery-wrap').find('.rpress-errors-wrap').text('Please select time for ' + serviceLabel);
_self.parents('.rpress-delivery-wrap').find('.rpress-errors-wrap').removeClass('disabled').addClass('enable');
return false;
}
var sDate = serviceDate === undefined ? rpress_scripts.current_date : serviceDate;
_self.parents('.rpress-delivery-wrap').find('.rpress-errors-wrap').removeClass('enable').addClass('disabled');
_self.text(rpress_scripts.please_wait);
var action = 'rpress_check_service_slot';
var data = {
action: action,
serviceType: serviceType,
serviceTime: serviceTime,
service_date: sDate
};
$.ajax({
type: "POST",
data: data,
dataType: "json",
url: rpress_scripts.ajaxurl,
xhrFields: {
withCredentials: true
},
success: function( response ) {
if ( response.status == 'error' ) {
_self.text(rpress_scripts.update);
_self.parents('#rpressModal').find('.rpress-errors-wrap').html(response.msg).removeClass('disabled');
return false;
} else {
rp_setCookie( 'service_type', serviceType, 1 );
if ( serviceDate === undefined ) {
rp_setCookie( 'service_date', rpress_scripts.current_date, 1 );
rp_setCookie( 'delivery_date', rpress_scripts.display_date, 1 );
} else {
var delivery_date = $('.delivery-settings-wrapper.active .rpress_get_delivery_dates option:selected').text();
rp_setCookie( 'service_date', serviceDate, 1 );
rp_setCookie( 'delivery_date', delivery_date, 1 );
}
if( serviceTime === undefined ) {
rp_setCookie( 'service_time', '', 1 );
} else {
rp_setCookie( 'service_time', serviceTime, 1 );
}
$('#rpressModal').removeClass( 'show-service-options' );
$('#rpressModal').modal('hide');
$('.modal-backdrop').remove();
if ( foodItemId ) {
setTimeout(function(){ $('#rpress_fooditem_'+foodItemId).find('.rpress-add-to-cart').trigger('click'); }, 600);
} else {
if ( typeof serviceType !== 'undefined' && typeof serviceTime !== 'undefined' ) {
$('.delivery-wrap .delivery-opts').html('' + serviceLabel + ', ' + Cookies.get( 'delivery_date' ) + ', ' + serviceTime + '');
} else if( typeof serviceTime == 'undefined' ) {
$('.delivery-items-options').find('.delivery-opts').html('' + serviceLabel + ', ' + Cookies.get( 'delivery_date' ) + '' );
}
}
//Trigger checked slot event so that it can be used by theme/plugins
$( document.body ).trigger( 'rpress_checked_slots', [response] );
//If it's checkout page then refresh the page to reflect the updated changes.
if( rpress_scripts.is_checkout == '1' )
window.location.reload();
}
}
});
});
//Update service type and service time
$( document ).on( 'click', '.delivery-change', function(e) {
e.preventDefault();
var self = $( this );
var action = 'rpress_show_delivery_options';
var ServiceType = rp_getCookie( 'service_type' );
var ServiceTime = rp_getCookie( 'service_time' );
var text = self.text();
self.text(rp_scripts.please_wait);
var data = {
action : action,
security : rp_scripts.service_type_nonce
}
$( '#rpressModal' ).addClass( 'show-service-options' );
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
success: function( response ) {
self.text(text);
$('#rpressModal .modal-title').html(response.data.html_title);
$('#rpressModal .modal-body').html(response.data.html);
$('#rpressModal').modal();
if ( $( '.rpress-tabs-wrapper' ).length ) {
if( ServiceTime !== '' ) {
$('.rpress-delivery-wrap').find('select#rpress-'+ServiceType+'-hours').val(ServiceTime);
}
$('.rpress-delivery-wrap').find('a#nav-'+ ServiceType + '-tab').trigger('click');
}
// Trigger event so themes can refresh other areas.
$( document.body ).trigger( 'opened_service_options', [ response.data ] );
}
})
});
// Remove an item from cart.
$('.rpress-cart').on('click', '.rpress-remove-from-cart', function(event) {
var $this = $(this),
item = $this.data( 'cart-item' ),
action = $this.data( 'action' ),
id = $this.data( 'fooditem-id' ),
data = {
action: action,
cart_item: item
};
$.ajax({
type: "POST",
data: data,
dataType: "json",
url: rpress_scripts.ajaxurl,
xhrFields: {
withCredentials: true
},
success: function(response) {
if ( response.removed ) {
// Remove the $this cart item
$('.rpress-cart .rpress-cart-item').each(function() {
$(this).find("[data-cart-item='" + item + "']").parents('.rpress-cart-item').remove();
});
// Check to see if the purchase form(s) for this fooditem is present on this page
if ($('[id^=rpress_purchase_' + id + ']').length) {
$('[id^=rpress_purchase_' + id + '] .rpress_go_to_checkout').hide();
$('[id^=rpress_purchase_' + id + '] a.rpress-add-to-cart').show().removeAttr('data-rpress-loading');
if (rpress_scripts.quantities_enabled == '1') {
$('[id^=rpress_purchase_' + id + '] .rpress_fooditem_quantity_wrapper').show();
}
}
$('span.rpress-cart-quantity').text(response.cart_quantity);
$(document.body).trigger('rpress_quantity_updated', [response.cart_quantity]);
if ( rpress_scripts.taxes_enabled ) {
$('.cart_item.rpress_subtotal span').html(response.subtotal);
$('.cart_item.rpress_cart_tax span').html(response.tax);
}
$('.cart_item.rpress_total span.rpress-cart-quantity').html(response.cart_quantity);
$('.cart_item.rpress_total span.cart-total').html(response.total);
if ( response.cart_quantity == 0 ) {
$('.cart_item.rpress_subtotal,.rpress-cart-number-of-items,.cart_item.rpress_checkout,.cart_item.rpress_cart_tax,.cart_item.rpress_total').hide();
$('.rpress-cart').each(function() {
var cart_wrapper = $(this).parent();
if ( cart_wrapper ) {
cart_wrapper.addClass('cart-empty')
cart_wrapper.removeClass('cart-not-empty');
}
$(this).append('' + rpress_scripts.empty_cart_message + '');
});
}
$(document.body).trigger('rpress_cart_item_removed', [response]);
$('.rpress-cart >li.rpress-cart-item').each( function( index, item ) {
$(this).find("[data-cart-item]").attr('data-cart-item', index);
});
// check if no item in cart left
if ($('li.rpress-cart-item').length == 0) {
$('a.rpress-clear-cart').trigger('click');
$('li.delivery-items-options').hide();
$('a.rpress-clear-cart').hide();
}
}
}
});
return false;
});
//Clear fooditems from cart
$( document ).on('click', 'a.rpress-clear-cart', function(e) {
e.preventDefault();
var self = $( this );
var OldText = self.html();
var action = 'rpress_clear_cart';
var data = {
security : rp_scripts.clear_cart_nonce,
action : action
}
self.text( rp_scripts.please_wait );
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
xhrFields : {
withCredentials: true
},
success : function(response) {
if( response.status == 'success' ) {
$('ul.rpress-cart').find('li.cart_item.rpress_total').css('display','none');
$('ul.rpress-cart').find('li.cart_item.rpress_checkout').css('display','none');
$('ul.rpress-cart').find('li.rpress-cart-item').remove();
$('ul.rpress-cart').find('li.cart_item.empty').remove();
$('ul.rpress-cart').find('li.rpress_subtotal').remove();
$('ul.rpress-cart').find('li.rpress_cart_tax').remove();
$('ul.rpress-cart').find('li.rpress-delivery-fee').remove();
$('ul.rpress-cart').append(response.response);
$('.rpress-cart-number-of-items').css('display','none');
$('.delivery-items-options').css('display', 'none');
self.html( OldText );
self.hide();
}
}
});
});
//Proceed Checkout
$( document ).on( 'click', '.cart_item.rpress_checkout a', function(e) {
e.preventDefault();
var CheckoutUrl = rp_scripts.checkout_page;
var _self = $(this);
var OrderText = _self.text();
var action = 'rpress_proceed_checkout';
var data = {
action : action,
security : rp_scripts.proceed_checkout_nonce,
}
$.ajax({
type : "POST",
data : data,
dataType : "json",
url : rp_scripts.ajaxurl,
beforeSend : function(){
_self.text( rp_scripts.please_wait );
},
success : function( response ) {
if ( response.status == 'error' ) {
if( response.error_msg ) {
errorString = response.error_msg;
}
$( '#rpressModal' ).addClass( 'checkout-error' );
$( '#rpressModal').find('.modal-title').html( rp_scripts.error );
$( '#rpressModal .modal-body' ).html(errorString);
$( '#rpressModal' ).modal();
_self.text( OrderText );
}
else {
window.location.replace( rp_scripts.checkout_page );
}
}
})
})
$(document).on('click', 'a.special-instructions-link', function(e) {
e.preventDefault();
$(this).parent('div').find('.special-instructions').toggleClass('hide');
});
$('body').on('click', '.rpress-filter-toggle', function() {
$('div.rpress-filter-wrapper').toggleClass('active');
});
/* Show hide cutlery icon on smaller devices */
$( ".rpress-mobile-cart-icons" ).click(function(){
$( ".rpress-sidebar-main-wrap" ).css( "left", "0%" );
});
$( ".close-cart-ic" ).click(function(){
$( ".rpress-sidebar-main-wrap" ).css( "left", "100%" );
});
//Show Image on Modal
$(".rpress-thumbnail-popup").fancybox({
openEffect : 'elastic',
closeEffect : 'elastic',
helpers : {
title : {
type : 'inside'
}
}
});
if ($(window).width() > 991) {
var totalHeight = $('header:eq(0)').length > 0 ? $('header:eq(0)').height() + 30 : 120;
if ($(".sticky-sidebar").length != '') {
$('.sticky-sidebar').rpressStickySidebar({
additionalMarginTop: totalHeight
});
}
}
else {
var totalHeight = $('header:eq(0)').length > 0 ? $('header:eq(0)').height() + 30 : 70;
}
});
}
/*
FILE ARCHIVED ON 03:59:46 Oct 15, 2021 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 20:55:40 Apr 15, 2026.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/*
playback timings (ms):
capture_cache.get: 7.492
load_resource: 92.227
PetaboxLoader3.resolve: 44.687
PetaboxLoader3.datanode: 41.581 (2)
loaddict: 33.054
*/