Da Ponte
Hindenburgstraße 18
28717 Bremen
E-mail-Adresse
daponte@hotmail.de
Telefon
0421-6366090
`);$('#mobile-unseen-notifications-list').html(`Loading...
`);$.ajax({url: 'https://www.dapontepizza.de/notifications/index',method: "GET",dataType: "JSON",success:function(res){console.log(res.notifications);html = `No notifications yet!`;if(res.notifications.length > 0){html = ``;}for (let i = 0; i < res.notifications.length; i++) {html += `${res.notifications[i].title}${res.notifications[i].description}${res.notifications[i].time}
`;}// $("#overlay").fadeIn(300);$('#unseen-notifications-list').html(html);$('#mobile-unseen-notifications-list').html(html);}});}function initOrderInLocalStorage(){tomundpooleeOrder = JSON.parse(localStorage.getItem('tomundpooleeOrder'));if(tomundpooleeOrder == null){tomundpooleeOrder = {id: 0};localStorage.setItem('tomundpooleeOrder', JSON.stringify(tomundpooleeOrder));}}function getOrderId(){tomundpooleeOrder = JSON.parse(localStorage.getItem('tomundpooleeOrder'));return tomundpooleeOrder.id;}function checkOrderIdInLocalStorage(){let orderID = 0;tomundpooleeOrder = JSON.parse(localStorage.getItem('tomundpooleeOrder'));if(tomundpooleeOrder != null && tomundpooleeOrder !== ''){orderID = tomundpooleeOrder.id;}if(orderID > 0){$.ajax({url: `https://www.dapontepizza.de/order/check-order-state`,method: `GET`,data:{orderID},success: res => {if(res.success){setOrderStateMessage(res.orderState, res.orderType);}}})}}function setOrderStateMessage(state, orderType){const takeawayOrderStatusMessages = {'1' : 'Bestellt', '3' : 'Bestellt', '5' : 'In bearbeitung', '7' : 'Ready To Pickup', '9' : 'Abgeschlossen'};const deliveryOrderStatusMessages = {'1' : 'Bestellt', '3' : 'Bestellt', '5' : 'In bearbeitung', '7' : 'Bereit zum liefern', '9' : 'Abgeschlossen'};if(state == 1 || state == 3 || state == 5 ||state == 7 || state == 9){orderType=='takeaway' ? $('#order-status-message').text(takeawayOrderStatusMessages[state]) : $('#order-status-message').text(deliveryOrderStatusMessages[state]);$('#order-status-div').show();orderType=='takeaway' ? $('#mob-order-status-message').text(takeawayOrderStatusMessages[state]) : $('#mob-order-status-message').text(deliveryOrderStatusMessages[state]);$('#mob-order-status-div').show();if(state == 9){tomundpooleeOrder['id'] = 0;localStorage.setItem('tomundpooleeOrder', JSON.stringify(tomundpooleeOrder));}}else{tomundpooleeOrder['id'] = 0;localStorage.setItem('tomundpooleeOrder', JSON.stringify(tomundpooleeOrder));$('#mob-order-status-div').hide();$('#order-status-div').hide();}}function checkTableIdInLocalStorage(){let tableID = 0;tomundpooleeTableBooking = JSON.parse(localStorage.getItem('tomundpooleeTableBooking'));if(tomundpooleeTableBooking != null && tomundpooleeTableBooking !== ''){tableID = tomundpooleeTableBooking.id;}if(tableID > 0){$.ajax({url: `https://www.dapontepizza.de/pages/check-table-state`,method: `GET`,data:{tableID},success: res => {if(res.success){setTableStateMessage(res.tableState);}}})}}function setTableStateMessage(state){$('#table-status-message').text(state);$('#table-status-div').show();$('#mob-table-status-message').text(state);$('#mob-table-status-div').show();if(state == 'Abgelehnt' || state == 'Bestätigt' || state == 'Storniert'){tomundpooleeTableBooking = {id:0};localStorage.setItem('tomundpooleeTableBooking', JSON.stringify(tomundpooleeTableBooking));}}// function initPageRightSideDataInLocalStorage()// {// pageRightSideData = JSON.parse(localStorage.getItem('pageRightSideData'));// if(pageRightSideData == null)// {// pageRightSideData = {// orderType: null// };// localStorage.setItem('pageRightSideData', JSON.stringify(pageRightSideData));// }// }// function storePageRightSideDataInLocalStorage(key, value)// {// pageRightSideData[key] = value;// localStorage.setItem('pageRightSideData', JSON.stringify(pageRightSideData));// }// function setPageRightSideDataFromLocalStorage()// {// pageRightSideData = JSON.parse(localStorage.getItem('pageRightSideData'));// if(pageRightSideData.orderType)// {// $("input[name=orderType][value="+pageRightSideData.orderType+"]").prop('checked', true)// }// }window.mobileAndTabletCheck = function() {if("ontouchstart" in window){check = true;}else{check = false;}return check;// (function(a){if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))) check = true;})(navigator.userAgent||navigator.vendor||window.opera);// return check;};function orderDetailPopup(){const shopID = "1";const isMobile = window.mobileAndTabletCheck();$.ajax({url: `https://www.dapontepizza.de/cart/orderdetail-popup`,method: `GET`,data:{shopID, isMobile},success: res => {if(res.success){$('#genral-lg-modal-content').html(res.modalContent);if(typeof window.currentLocationAddressHtml == 'string'){$('#current-location-address-div').prepend(window.currentLocationAddressHtml);}if(!$('#genrnal-lg-modal-content').is(':visible')){ (function (jQuery, $) {$('#genral-lg-modal').modal('toggle')})(window._$, window._$);}}else{if(res.message){Swal.fire(res.message, '', 'error');}else{Swal.fire('', '', 'error');}}}})}function prePaymentValidation(){return new Promise((resolve,reject) => {const shopID = "1";let orderDetail = (null) ? null:{orderType:'takeawayPrice'} ;orderType = orderDetail.orderType;const preOrSoonSelect = orderDetail.preOrSoon;let date = '';let time = '';const couponCode = $('#couponCode').val();if(preOrSoonSelect == 'pre-order'){date = orderDetail.date;time = orderDetail.time;}let data = {};$($('#guest-or-register-form').serializeArray()).each(function(index, obj){data[obj.name] = obj.value;});data['shopID'] = shopID;data['orderType'] = orderType;data['preOrSoonSelect'] = preOrSoonSelect;data['date'] = date;data['time'] = time;data['guestOrRegisterAddress'] = orderDetail.guestOrRegisterAddress;data['guestOrRegisterLat'] = orderDetail.guestOrRegisterLat;data['guestOrRegisterCity'] = orderDetail.guestOrRegisterCity;data['guestOrRegisterCountry'] = orderDetail.guestOrRegisterCountry;data['guestOrRegisterHouse'] = orderDetail.guestOrRegisterHouse;data['guestOrRegisterLat'] = orderDetail.guestOrRegisterLat;data['guestOrRegisterLng'] = orderDetail.guestOrRegisterLng;data['guestOrRegisterPostCode'] = orderDetail.guestOrRegisterPostCode;data['guestOrRegisterSublocality'] = orderDetail.guestOrRegisterSublocality;data['guestOrRegisterStreet'] = orderDetail.guestOrRegisterStreet;if(!$('#sameAddressCheckbox').is(':checked')){data['guestOrRegisterBillingAddress'] = $('#guestOrRegisterBillingAddress').val();data['guestOrRegisterBillingLat'] = $('#guestOrRegisterBillingLat').val();data['guestOrRegisterBillingCity'] = $('#guestOrRegisterBillingCity').val();data['guestOrRegisterBillingCountry'] = $('#guestOrRegisterBillingCountry').val();data['guestOrRegisterBillingHouse'] = $('#guestOrRegisterBillingHouse').val();data['guestOrRegisterBillingLng'] = $('#guestOrRegisterBillingLng').val();data['guestOrRegisterBillingPostCode'] = $('#guestOrRegisterBillingPostCode').val();data['guestOrRegisterBillingStreet'] = $('#guestOrRegisterBillingStreet').val();}data['couponCode'] = couponCode;$.ajax({url: `https://www.dapontepizza.de/order/pre-payment-validation`,method: `POST`,data:{data},headers: {'X-CSRF-TOKEN': 'yipbkSa3Ezqti0TnT3ZL0hA8NiCWSTPagYrQRAiW'},success: res => {if(res.success){//var complex = null;//console.log('grandTotal is ', complex);return resolve(res.grandTotal);}else{endSpinnerInButton('checkoutBtn','checkout-button');$('#checkoutBtn').data('clicked', false);if(res.errors){errorsMessage = `${Object.values(res.errors)[0][0]}
`;if(res.focusElement){$('html, body').animate({scrollTop: $('#couponCode').offset().top}, 'slow');}if(res.reloadCart){setTimeout(() => {updateCartPrices(false)}, 2000);}Swal.fire({icon: 'error',title:errorsMessage}).then((result) => {if(res.focusElement){setTimeout(() => {$(`#${res.focusElement}`).focus();}, 500);}});return reject();}else{Swal.fire(res.message, '', 'error');return reject();}}}})})}function applyCoupon(){let orderDetail = (null) ? null : {orderType:"takeawayPrice"};if(orderDetail && orderDetail.orderType != 'takeawayPrice'){checkDeliveryRange();}else{updateCartPrices();}}$(document).ready(function(){toastr.options = {"debug": false,"positionClass": "toast-top-center","onclick": null,"fadeIn": 300,"fadeOut": 1000,"timeOut": 5000,"extendedTimeOut": 1000}$(window).bind('scroll',function() {var navHeight = 300;// custom nav heightif(window.matchMedia("(max-width: 991px)").matches){$(window).scrollTop() > 160 ? $('#mobile-nav-header').css({"position":"fixed", "width":"100%", "top":0,"z-index":1,"height":"50px"}) : $('#mobile-nav-header').css({"position":"", "top":"","z-index":"","height":"", "background":""});$(window).scrollTop() > 160 ? $('#statuses-div').css({"position":"fixed", "width":"100%", "top":"47px","z-index":1,"height":"50px"}) : $('#statuses-div').css({"position":"", "top":"","z-index":"","height":"", "background":""});return;}$(window).scrollTop() > navHeight ? $('#navbar').css({"position":"fixed", "top":0,"z-index":1,"height":"50px", "background":"#333333"}) : $('#navbar').css({"position":"", "top":"","z-index":"","height":"", "background":""});$(window).scrollTop() > navHeight ? $('#sticky-background').css({"position":"fixed", "width" : "100%", "top":0,"z-index":1,"height":"52px", "background":"#333333"}) : $('#sticky-background').css({"position":"", "width" : "100%", "top":"","z-index":"","height":"", "background":""});});});function startSweetAlertLoader(){//Swal.fire('Bitte warten!')Swal.fire({title: 'Bitte warten!',icon: 'info',showConfirmButton: false,allowOutsideClick: false})Swal.showLoading()}function endSweetAlertLoader(){$('.swal2-container.swal2-center.swal2-backdrop-show').remove()}function openTableBookModal(){$.ajax({url:"https://www.dapontepizza.de/pages/book-table-popup",method:'get',success:res => {if(res.success){$('#genral-lg-modal-content').html(res.html);if(!$('#genral-lg-modal-content').is(':visible')){ (function (jQuery, $) {$('#genral-lg-modal').modal('toggle')})(window._$, window._$);}}else{Swal.fire('', '', 'error');}}});}function openContactUsModal(){$.ajax({url:"https://www.dapontepizza.de/pages/contact-us-popup",method:'get',success:res => {if(res.success){$('#genral-lg-modal-content').html(res.html);if(!$('#genral-lg-modal-content').is(':visible')){ (function (jQuery, $) {$('#genral-lg-modal').modal('toggle')})(window._$, window._$);}}else{Swal.fire('', '', 'error');}}});}function checkPhoneFormat(element){const id = $(element).data('type');const currentInput = $(element).val();let fixedInput = currentInput.replace(/[A-Za-z!@#$%?<>,^&*:`'"_.|;=/~()-]/g, '');$(`#${id}`).val(fixedInput);}$('#guestOrRegisterCreateAccount').on('change', function(){if($(this).is(':checked')){$('#guestOrRegisterPasswordDiv').css({'display':'block'})$('#guestOrRegisterPassword_confirmationDiv').css({'display':'block'})return;}$('#guestOrRegisterPasswordDiv').css({'display':'none'})$('#guestOrRegisterPassword_confirmationDiv').css({'display':'none'})});function rejectCouponDiscount(){Swal.fire({title: 'Do you really want to skip this discount?',// text: "Discount will be removed!",icon: 'warning',showCancelButton: true,confirmButtonColor: '#3085d6',cancelButtonColor: '#d33',confirmButtonText: 'Skip'}).then((result) => {if(result.isConfirmed){$('#couponCode').val('');applyCoupon()}});}function rejectDiscount(id){Swal.fire({title: 'Do you really want to skip this discount?',// text: "Discount will be removed!",icon: 'warning',showCancelButton: true,confirmButtonColor: '#3085d6',cancelButtonColor: '#d33',confirmButtonText: 'Skip'}).then((result) => {if(result.isConfirmed){$.ajax({url:"https://www.dapontepizza.de/cart/reject-discount",method:"post",data:{id},headers:{'X-CSRF-TOKEN':"yipbkSa3Ezqti0TnT3ZL0hA8NiCWSTPagYrQRAiW"},success:res => {if(res.success){applyCoupon()}}})}});}$('#couponCode').on('keypress',function(e) {if(e.which == 13) {e.preventDefault();applyCoupon();}});function setFixedBodyHeight(){$('body').css('max-height','100vh')}function removeFixedBodyHeight(){$('body').css('max-height','')}function getCurrentLocation(){if(JSON.parse(localStorage.getItem('currentLocationObject')) != null){currentLocationAddress = JSON.parse(localStorage.getItem('currentLocationObject'));now = new Date().getTime();if(now-currentLocationAddress.setupTime <= 2*60*60*1000){window.currentLocationAddress = currentLocationAddress;if(Object.keys(window.currentLocationAddress).length >= 9){// $('#currentLocationBtn').css('display','block')window.currentLocationAddressHtml = `
${window.currentLocationAddress.formattedAddress}
`;$('#current-location-address-div').prepend(window.currentLocationAddressHtml);}return;}}if (navigator.geolocation) {// timeout at 60000 milliseconds (60 seconds)var options = { timeout: 60000 };navigator.geolocation.getCurrentPosition(getCurrentLocationAddress, function(err){console.log(err)}, options);}}function getCurrentLocationAddress(position){let lat = position.coords.latitude;let lng = position.coords.longitude;console.log(lat, lng);let google_map_position = new google.maps.LatLng( lat, lng );let google_maps_geocoder = new google.maps.Geocoder();google_maps_geocoder.geocode({ 'latLng': google_map_position },function( results, status ) {console.log('all-results ',results);window.currentLocationAddress = {};window.currentLocationAddress.formattedAddress = results[0].formatted_address;window.currentLocationAddress.lat = position.coords.latitude;window.currentLocationAddress.lng = position.coords.longitude;window.currentLocationAddress.houseNumber = 0;results[0].address_components.forEach(address_component => {console.log(address_component);if(address_component.types[0] == 'street_number'){window.currentLocationAddress.houseNumber = address_component.short_name}if(address_component.types[0] == 'route'){window.currentLocationAddress.street = address_component.short_name}if(address_component.types[0] == 'locality' && address_component.types[1] == 'political'){window.currentLocationAddress.city = address_component.long_name}if(address_component.types[0] == 'country' && address_component.types[1] == 'political'){window.currentLocationAddress.country = address_component.long_name}if(address_component.types[0] == 'postal_code'){window.currentLocationAddress.postalCode = address_component.short_name}if(address_component.types.includes('sublocality')){window.currentLocationAddress.sublocality = address_component.long_name}});// window.currentLocationAddress.street = 'str'// window.currentLocationAddress.city = 'sahiwal'// window.currentLocationAddress.postalCode = '57000'window.currentLocationAddress.setupTime = new Date().getTime();localStorage.setItem('currentLocationObject', JSON.stringify(window.currentLocationAddress));if(Object.keys(window.currentLocationAddress).length >= 9){$('#currentLocationBtn').css('display','block')// $('#currentLocationBtn').css('display','block')window.currentLocationAddressHtml = `${window.currentLocationAddress.formattedAddress}
`;$('#current-location-address-div').prepend(window.currentLocationAddressHtml);}});}if(window.matchMedia("(min-width: 991px)").matches){$(window).scroll(function() {var window_top = $(window).scrollTop() - 0;if (window_top > $('#cart-plus-checkout-div').prop("scrollHeight")) {if (!$('#checkoutBtn').is('.checkout-btn-sticky')) {$('#checkoutBtn').addClass('checkout-btn-sticky');}} else {$('#checkoutBtn').removeClass('checkout-btn-sticky');}});}$.fn.setCursorPosition = function(pos) {this.each(function(index, elem) {if (elem.setSelectionRange) {elem.setSelectionRange(pos, pos);} else if (elem.createTextRange) {var range = elem.createTextRange();range.collapse(true);range.moveEnd('character', pos);range.moveStart('character', pos);range.select();}});return this;};function getHouseNumberFromAddressStr(address){previousWasNumber = false;arrayOfNumbers = [];number = '';for (let i = 0; i < address.length; i++) {if(/^[0-9]*$/.test(address[i])){number += address[i];}else{if(number.length > 0){arrayOfNumbers.push(number);}number = '';previousWasNumber = false;}}houseNumber = '';for (let i = 0; i < arrayOfNumbers.length; i++) {if(arrayOfNumbers[i].length > 0 && arrayOfNumbers[i].length < 5){houseNumber = arrayOfNumbers[i];break;}}return houseNumber;}function checkIfStringContainAtleastTwoWords(str){var result = (str.indexOf(' ') >= 0) && ((str.substring(str.indexOf(' ') + 1)).length > 0);var numbersInAddress = str.replace(/[^0-9]/g,"").length;return (result && numbersInAddress>0);}