{"id":45,"date":"2025-06-04T07:35:08","date_gmt":"2025-06-04T07:35:08","guid":{"rendered":"https:\/\/caralliancerentals.com\/?page_id=45"},"modified":"2025-06-04T07:35:08","modified_gmt":"2025-06-04T07:35:08","slug":"cart","status":"publish","type":"page","link":"https:\/\/caralliancerentals.com\/it\/cart\/","title":{"rendered":"Cart"},"content":{"rendered":"        <div class=\"caralliance-cart-page\">\n            <!-- Enhanced Page Header -->\n            <div class=\"services-page-header\">\n                <div class=\"page-header-content\">\n                    <h2 class=\"page-title\">Il Tuo Carrello<\/h2>\n                    <p class=\"page-subtitle\">Rivedi la tua selezione prima di procedere<\/p>\n                <\/div>\n                <div class=\"progress-indicator\">\n                    <div class=\"progress-steps\">\n                        <div class=\"step completed\">\n                            <span class=\"step-number\">1<\/span>\n                            <span class=\"step-label\">Ricerca<\/span>\n                        <\/div>\n                        <div class=\"step completed\">\n                            <span class=\"step-number\">2<\/span>\n                            <span class=\"step-label\">Auto<\/span>\n                        <\/div>\n                        <div class=\"step completed\">\n                            <span class=\"step-number\">3<\/span>\n                            <span class=\"step-label\">Servizi<\/span>\n                        <\/div>\n                        <div class=\"step active\">\n                            <span class=\"step-number\">4<\/span>\n                            <span class=\"step-label\">Carrello<\/span>\n                        <\/div>\n                    <\/div>\n                <\/div>\n            <\/div>\n            \n            <!-- Cart Content -->\n            <div id=\"cart-content\" class=\"cart-content\">\n                <div class=\"loading\">Loading cart contents...<\/div>\n            <\/div>\n            \n            <!-- Car Details Section -->\n            <div id=\"cart-car-section\" class=\"cart-section\">\n                <h4>Auto Selezionata<\/h4>\n                <div id=\"cart-car-details\">\n                    <div class=\"loading\">Loading car details...<\/div>\n                <\/div>\n                                <div class=\"modification-actions\">\n                    <button type=\"button\" id=\"modify-car-selection\" class=\"btn btn-secondary btn-sm\">\n                        Cambia Auto                    <\/button>\n                <\/div>\n                            <\/div>\n            \n            <!-- Services Summary Section -->\n            <div id=\"cart-services-section\" class=\"cart-section\">\n                <h4>Servizi Selezionati<\/h4>\n                <div id=\"cart-services-details\">\n                    <div class=\"loading\">Loading services...<\/div>\n                <\/div>\n                                <div class=\"modification-actions\">\n                    <button type=\"button\" id=\"modify-services-selection\" class=\"btn btn-secondary btn-sm\">\n                        Cambia Servizi                    <\/button>\n                <\/div>\n                            <\/div>\n            \n            <!-- Total Price Section -->\n            <div id=\"cart-price-section\" class=\"cart-section price-summary\">\n                <h4>Costo Totale<\/h4>\n                <div id=\"cart-price-breakdown\">\n                    <div class=\"loading\">Calculating total...<\/div>\n                <\/div>\n            <\/div>\n            \n            <!-- Action Buttons -->\n            <div class=\"cart-actions\">\n                <button type=\"button\" id=\"back-to-services-from-cart\" class=\"btn btn-secondary\">\n                    \u2190 Torna ai Servizi                <\/button>\n                <button type=\"button\" id=\"proceed-to-checkout-from-cart\" class=\"btn btn-primary\">\n                    Procedi al Checkout \u2192                <\/button>\n            <\/div>\n        <\/div>\n        \n        <script type=\"text\/javascript\">\n        jQuery(document).ready(function($) {\n            console.log('CarAlliance: Cart page initializing...');\n            \n            \/\/ Load booking data from localStorage\n            var bookingData = localStorage.getItem('caralliance_booking_data');\n            \n            if (!bookingData) {\n                console.error('No booking data found in localStorage');\n                window.caralliance.showAlert(caralliance_i18n.no_booking_data_found, 'error');\n                window.location.href = '\/'; \/\/ Redirect to home\n                return;\n            }\n            \n            try {\n                bookingData = JSON.parse(bookingData);\n                console.log('Loaded cart booking data:', bookingData);\n                \n                \/\/ DEBUG: Show the exact selectedCar object and its properties for cart page\n                var selectedCar = bookingData.selected_car;\n                if (selectedCar) {\n                    console.log('CART - FULL selectedCar object:', selectedCar);\n                    console.log('CART - selectedCar.DaysForPayment type:', typeof selectedCar.DaysForPayment);\n                    console.log('CART - selectedCar.DaysForPayment value:', selectedCar.DaysForPayment);\n                    console.log('CART - All selectedCar keys:', Object.keys(selectedCar));\n                \n                    \/\/ Force recalculation and clear any old pricing data for cart page\n                    var totalPrice = parseFloat(selectedCar.Amount || 0);\n                    var daysForPayment = parseInt(selectedCar.DaysForPayment || 1);\n                    var dailyRate = daysForPayment > 0 ? (totalPrice \/ daysForPayment) : totalPrice;\n                    var carTotalPrice = totalPrice;\n                    \n                    console.log('PRICING DEBUG - Cart Page BEFORE fix:', {\n                        dailyRate: dailyRate,\n                        daysForPayment: daysForPayment,\n                        carTotalPrice: carTotalPrice,\n                        oldPricing: bookingData.pricing\n                    });\n                    \n                    \/\/ If DaysForPayment is missing or wrong, try to get it from pricing object\n                    if (!selectedCar.DaysForPayment || selectedCar.DaysForPayment == 1) {\n                        console.log('CART - DaysForPayment missing or incorrect, checking pricing object...');\n                        if (bookingData.pricing && bookingData.pricing.days_for_payment && bookingData.pricing.days_for_payment > 1) {\n                            daysForPayment = parseInt(bookingData.pricing.days_for_payment);\n                            dailyRate = daysForPayment > 0 ? (totalPrice \/ daysForPayment) : totalPrice;\n                            carTotalPrice = totalPrice;\n                            console.log('CART - Using DaysForPayment from pricing:', daysForPayment);\n                        }\n                    }\n                    \n                    console.log('PRICING DEBUG - Cart Page AFTER fix:', {\n                        dailyRate: dailyRate,\n                        daysForPayment: daysForPayment,\n                        carTotalPrice: carTotalPrice\n                    });\n                    \n                    \/\/ Force initialize pricing object with correct calculations\n                    bookingData.pricing = {\n                        car_price: carTotalPrice,\n                        daily_rate: dailyRate,\n                        days_for_payment: daysForPayment,\n                        services_price: bookingData.pricing?.services_price || 0,\n                        total_price: carTotalPrice + (bookingData.pricing?.services_price || 0),\n                        currency: selectedCar.Currency || 'EUR'\n                    };\n                    \n                    \/\/ Force save updated booking data\n                    localStorage.setItem('caralliance_booking_data', JSON.stringify(bookingData));\n                    \n                    console.log('FORCED UPDATE - Cart pricing data:', bookingData.pricing);\n                }\n                \n                \/\/ Display cart contents\n                displayCartSummary(bookingData);\n                \n            } catch (e) {\n                console.error('Error parsing booking data:', e);\n                window.caralliance.showAlert(caralliance_i18n.booking_data_error, 'error');\n                window.location.href = '\/';\n                return;\n            }\n            \n            \/\/ Handle navigation buttons\n            $('#back-to-services-from-cart').on('click', function() {\n                findAndRedirectToServicesPage();\n            });\n            \n            $('#proceed-to-checkout-from-cart').on('click', function() {\n                findAndRedirectToCheckoutPage();\n            });\n            \n            $('#modify-car-selection').on('click', function() {\n                \/\/ Redirect back to search results\n                var searchParams = bookingData.search_params;\n                if (searchParams) {\n                    var resultsUrl = constructSearchResultsUrl(searchParams);\n                    if (resultsUrl) {\n                        window.location.href = resultsUrl;\n                    } else {\n                        window.caralliance.showAlert(caralliance_i18n.page_not_found, 'error');\n                    }\n                } else {\n                    window.location.href = '\/'; \/\/ Fallback to home\n                }\n            });\n            \n            $('#modify-services-selection').on('click', function() {\n                findAndRedirectToServicesPage();\n            });\n            \n            \/**\n             * Display cart summary\n             *\/\n            function displayCartSummary(data) {\n                console.log('Full booking data in cart:', data);\n                \n                \/\/ Display car details\n                if (data.selected_car && data.search_params) {\n                    displayCartCarDetails(data.selected_car, data.search_params);\n                } else {\n                    $('#cart-car-details').html('<div class=\"error\">' + caralliance_i18n.car_data_not_found + '<\/div>');\n                }\n                \n                \/\/ Display services - check various possible data structures\n                var selectedServices = data.selected_services || [];\n                var servicesData = data.services_data || data.selected_car.AvailableServices || null;\n                \n                console.log('Selected services for cart:', selectedServices);\n                console.log('Available services data:', servicesData);\n                \n                displayCartServicesDetails(selectedServices, servicesData);\n                \n                \/\/ Display pricing\n                if (data.pricing) {\n                    displayCartPricing(data.pricing);\n                } else {\n                    $('#cart-price-breakdown').html('<div class=\"error\">' + caralliance_i18n.pricing_data_not_found + '<\/div>');\n                }\n                \n                $('#cart-content .loading').hide();\n            }\n            \n            \/**\n             * Display car details in cart\n             *\/\n            function displayCartCarDetails(car, searchParams) {\n                console.log('Displaying car details:', car);\n                \n                \/\/ Handle different possible property names for car name\n                var carName = car.ModelName || car.name || car.Name || car.model || car.title || 'Car Selected';\n                var carCategory = car.CarCategory || car.CategoryName || car.category || car.Category || car.type || 'N\/A';\n                var carImage = car.CarModelImageURL || car.imageUrl || car.image_url || car.ImageUrl || car.Image || null;\n                var carPrice = car.Amount || car.Price || car.price || car.amount || 0;\n                var currency = car.Currency || car.CurrencyCode || 'EUR';\n                \n                \/\/ Calculate total price: daily rate \u00d7 number of days\n                var totalPrice = parseFloat(carPrice);\n                var daysForPayment = parseInt(car.DaysForPayment || 1);\n                var dailyRate = daysForPayment > 0 ? (totalPrice \/ daysForPayment) : totalPrice;\n                var totalCarPrice = totalPrice;\n                \n                var html = '<div class=\"cart-car-result\">';\n                if (carImage) {\n                    html += '<div class=\"car-image\">';\n                    html += '<img decoding=\"async\" src=\"' + carImage + '\" alt=\"' + carName + '\" onerror=\"this.style.display=\\'none\\'\">';\n                    html += '<\/div>';\n                }\n                html += '<div class=\"car-content\">';\n                html += '<div class=\"car-header\">';\n                html += '<div class=\"car-info\">';\n                html += '<h4>' + carName + '<\/h4>';\n                html += '<span class=\"car-category\">' + carCategory + '<\/span>';\n                html += '<\/div>';\n                \n                html += '<div class=\"car-price\">';\n                html += '<div class=\"price-display\">';\n                html += '<span class=\"amount\">' + dailyRate.toFixed(2) + '<\/span>';\n                html += '<span class=\"price-period\">' + caralliance_i18n.per_day + '<\/span>';\n                html += '<span class=\"currency\"> ' + currency + '<\/span>';\n                html += '<\/div>';\n                html += '<div class=\"tax-included\">' + caralliance_i18n.vat_included + '<\/div>';\n                if (daysForPayment > 1) {\n                    html += '<div class=\"total-price\">' + caralliance_i18n.total + ' ' + daysForPayment + ' ' + caralliance_i18n.days + ': <strong>' + totalCarPrice.toFixed(2) + ' ' + currency + '<\/strong><\/div>';\n                }\n                html += '<\/div>';\n                \n                html += '<\/div>';\n                html += '<div class=\"booking-details\">';\n                if (searchParams.pickup_date && searchParams.dropoff_date) {\n                    html += '<p><strong>' + caralliance_i18n.from + ':<\/strong> ' + searchParams.pickup_date + ' ' + (searchParams.pickup_time || '10:00') + '<\/p>';\n                    html += '<p><strong>' + caralliance_i18n.to + ':<\/strong> ' + searchParams.dropoff_date + ' ' + (searchParams.dropoff_time || '10:00') + '<\/p>';\n                }\n                if (searchParams.pickup_location_name) {\n                    html += '<p><strong>' + caralliance_i18n.pickup + ':<\/strong> ' + searchParams.pickup_location_name + '<\/p>';\n                }\n                if (searchParams.dropoff_location_name) {\n                    html += '<p><strong>' + caralliance_i18n.dropoff + ':<\/strong> ' + searchParams.dropoff_location_name + '<\/p>';\n                }\n                html += '<\/div>';\n                html += '<\/div>';\n                html += '<\/div>';\n                \n                $('#cart-car-details').html(html);\n                \n                \/\/ Update total calculation for cart\n                updateCartTotal(totalCarPrice, currency);\n            }\n            \n            \/**\n             * Display services details in cart\n             *\/\n            function displayCartServicesDetails(selectedServices, servicesData) {\n                console.log('Displaying services:', selectedServices, servicesData);\n                \n                if (!selectedServices || selectedServices.length === 0) {\n                    $('#cart-services-details').html('<p class=\"no-services\">' + caralliance_i18n.no_service_selected + '<\/p>');\n                    return;\n                }\n                \n                var html = '<div class=\"cart-services-list\">';\n                \n                selectedServices.forEach(function(service) {\n                    \/\/ Handle both object format and string format\n                    var serviceName, servicePrice, serviceCurrency, serviceDescription, serviceQuantity, serviceTotalPrice;\n                    \n                    if (typeof service === 'object') {\n                        \/\/ Service is an object with details\n                        serviceName = service.name || service.Name || service.title || service.code || 'Service';\n                        servicePrice = service.price || service.Price || service.amount || 0;\n                        serviceCurrency = service.currency || service.Currency || 'EUR';\n                        serviceDescription = service.description || service.Description || '';\n                        serviceQuantity = service.quantity || 1;\n                        serviceTotalPrice = service.total_price || (servicePrice * serviceQuantity);\n                        \n                        \/\/ Override service names for specific service codes\n                        var serviceCode = service.Code || service.code || service.ServiceCode || '';\n                        var additionalCode = service.AdditionalCode || service.additionalCode || '';\n                        if (additionalCode === 'OHND' || additionalCode === 'OHN') {\n                            serviceName = 'Out Of Hours - Night';\n                        } else if (additionalCode === 'OHD' || additionalCode === 'OHDD') {\n                            serviceName = 'Out Of Hours - Day';\n                        }\n                    } else {\n                        \/\/ Service is just a code, try to find it in servicesData\n                        var foundService = findServiceByCode(service, servicesData);\n                        if (foundService) {\n                            serviceName = foundService.name || foundService.Name || foundService.title || service;\n                            servicePrice = foundService.price || foundService.Price || 0;\n                            serviceCurrency = foundService.currency || foundService.Currency || 'EUR';\n                            serviceDescription = foundService.description || foundService.Description || '';\n                            serviceQuantity = 1;\n                            serviceTotalPrice = servicePrice;\n                            \n                            \/\/ Override service names for specific service codes\n                            var serviceCode = foundService.Code || foundService.code || foundService.ServiceCode || service;\n                            var additionalCode = foundService.AdditionalCode || foundService.additionalCode || '';\n                            if (additionalCode === 'OHND' || additionalCode === 'OHN') {\n                                serviceName = 'Out Of Hours - Night';\n                            } else if (additionalCode === 'OHD' || additionalCode === 'OHDD') {\n                                serviceName = 'Out Of Hours - Day';\n                            }\n                        } else {\n                            serviceName = service;\n                            servicePrice = 0;\n                            serviceCurrency = 'EUR';\n                            serviceDescription = '';\n                            serviceQuantity = 1;\n                            serviceTotalPrice = 0;\n                        }\n                    }\n                    \n                    var quantityText = serviceQuantity > 1 ? ` (x${serviceQuantity})` : '';\n                    var priceDisplay = serviceTotalPrice > 0 ? parseFloat(serviceTotalPrice).toFixed(2) + ' ' + serviceCurrency : caralliance_i18n.included;\n                    var calculationText = serviceQuantity > 1 ? `<small>${parseFloat(servicePrice).toFixed(2)} ${serviceCurrency} each \u00d7 ${serviceQuantity}<\/small>` : '';\n                    \n                    html += `\n                        <div class=\"cart-service-item\">\n                            <div class=\"service-info\">\n                                <h5>${serviceName}${quantityText}<\/h5>\n                                ${serviceDescription ? `<p>${serviceDescription}<\/p>` : ''}\n                                ${calculationText ? `<p>${calculationText}<\/p>` : ''}\n                            <\/div>\n                            <div class=\"service-price\">\n                                ${priceDisplay}\n                            <\/div>\n                        <\/div>\n                    `;\n                });\n                \n                html += '<\/div>';\n                $('#cart-services-details').html(html);\n            }\n            \n            \/**\n             * Display pricing breakdown in cart\n             *\/\n            function displayCartPricing(pricing) {\n                var html = `\n                    <div class=\"cart-price-breakdown\">\n                        <div class=\"price-item\">\n                            <span>Auto:<\/span>\n                            <span>${parseFloat(pricing.car_price || 0).toFixed(2)} ${pricing.currency || 'EUR'}<\/span>\n                        <\/div>\n                        ${pricing.services_price > 0 ? `\n                        <div class=\"price-item\">\n                            <span>Servizi Aggiuntivi:<\/span>\n                            <span>${parseFloat(pricing.services_price).toFixed(2)} ${pricing.currency || 'EUR'}<\/span>\n                        <\/div>\n                        ` : ''}\n                        <div class=\"price-total\">\n                            <span><strong>Totale:<\/strong><\/span>\n                            <span class=\"total-amount\"><strong>${parseFloat(pricing.total_price || 0).toFixed(2)} ${pricing.currency || 'EUR'}<\/strong><\/span>\n                        <\/div>\n                    <\/div>\n                `;\n                \n                $('#cart-price-breakdown').html(html);\n            }\n            \n            \/**\n             * Update cart total calculation\n             *\/\n            function updateCartTotal(carPrice, currency) {\n                var bookingData = JSON.parse(localStorage.getItem('caralliance_booking_data') || '{}');\n                var selectedServices = bookingData.selected_services || [];\n                var servicesTotal = 0;\n                \n                \/\/ Calculate services total with quantity\n                selectedServices.forEach(function(service) {\n                    var servicePrice = parseFloat(service.price || 0);\n                    var serviceQuantity = parseInt(service.quantity || 1);\n                    var serviceTotalPrice = service.total_price || (servicePrice * serviceQuantity);\n                    servicesTotal += parseFloat(serviceTotalPrice);\n                });\n                \n                var totalAmount = carPrice + servicesTotal;\n                \n                \/\/ Update cart pricing breakdown\n                var pricingHtml = '<div class=\"cart-price-breakdown\">';\n                pricingHtml += '<div class=\"price-item\">';\n                pricingHtml += '<span>' + caralliance_i18n.car_rental + ':<\/span>';\n                pricingHtml += '<span>' + carPrice.toFixed(2) + ' ' + currency + '<\/span>';\n                pricingHtml += '<\/div>';\n                \n                if (servicesTotal > 0) {\n                    pricingHtml += '<div class=\"price-item\">';\n                    pricingHtml += '<span>' + caralliance_i18n.additional_services + ':<\/span>';\n                    pricingHtml += '<span>' + servicesTotal.toFixed(2) + ' ' + currency + '<\/span>';\n                    pricingHtml += '<\/div>';\n                }\n                \n                pricingHtml += '<div class=\"price-item price-total\">';\n                pricingHtml += '<span><strong>' + caralliance_i18n.total + ':<\/strong><\/span>';\n                pricingHtml += '<span class=\"total-amount\"><strong>' + totalAmount.toFixed(2) + ' ' + currency + '<\/strong><\/span>';\n                pricingHtml += '<\/div>';\n                pricingHtml += '<\/div>';\n                \n                $('#cart-price-breakdown').html(pricingHtml);\n                \n                \/\/ Update booking data\n                bookingData.pricing = bookingData.pricing || {};\n                bookingData.pricing.car_price = carPrice;\n                bookingData.pricing.services_price = servicesTotal;\n                bookingData.pricing.total_price = totalAmount;\n                bookingData.pricing.currency = currency;\n                localStorage.setItem('caralliance_booking_data', JSON.stringify(bookingData));\n            }\n            \n            \/**\n             * Helper functions\n             *\/\n            function findServiceByCode(serviceCode, servicesData) {\n                console.log('Looking for service code:', serviceCode, 'in services data:', servicesData);\n                \n                if (!servicesData) {\n                    console.log('No services data available');\n                    return null;\n                }\n                \n                \/\/ Check if servicesData has different possible structures\n                var servicesToSearch = [];\n                \n                \/\/ If servicesData is an array, search it directly\n                if (Array.isArray(servicesData)) {\n                    servicesToSearch = servicesData;\n                } else if (typeof servicesData === 'object') {\n                    \/\/ If servicesData is an object with categories, search all categories\n                    for (var category in servicesData) {\n                        if (servicesData[category] && Array.isArray(servicesData[category])) {\n                            servicesToSearch = servicesToSearch.concat(servicesData[category]);\n                        }\n                    }\n                }\n                \n                \/\/ Search through all services\n                for (var i = 0; i < servicesToSearch.length; i++) {\n                    var service = servicesToSearch[i];\n                    var code = service.code || service.Code || service.id || service.Id;\n                    \n                    if (code === serviceCode) {\n                        console.log('Found service:', service);\n                        return service;\n                    }\n                }\n                \n                console.log('Service not found for code:', serviceCode);\n                return null;\n            }\n            \n            function getLocationName(locationCode) {\n                \/\/ Try to get from global locations if available\n                if (window.allLocations && Array.isArray(window.allLocations)) {\n                    var location = window.allLocations.find(function(loc) {\n                        return loc.code === locationCode;\n                    });\n                    if (location) {\n                        return location.name;\n                    }\n                }\n                return locationCode; \/\/ Fallback to code\n            }\n            \n            function constructSearchResultsUrl(searchParams) {\n                \/\/ Try to find search results page\n                var baseUrl = window.location.origin;\n                var possibleUrls = [\n                    baseUrl + '\/search-results\/',\n                    baseUrl + '\/car-search\/',\n                    baseUrl + '\/results\/',\n                    baseUrl + '\/search\/'\n                ];\n                \n                \/\/ Return the first URL that exists (simplified for now)\n                return possibleUrls[0] + '?' + $.param(searchParams);\n            }\n            \n            function findAndRedirectToServicesPage() {\n                \/\/ Try to get services page URL from WordPress\n                $.ajax({\n                    url: caralliance_ajax.ajax_url,\n                    type: 'POST',\n                    data: {\n                        action: 'caralliance_get_services_page_url',\n                        nonce: caralliance_ajax.nonce\n                    },\n                    success: function(response) {\n                        if (response.success && response.data.url) {\n                            console.log('Redirecting to services page:', response.data.url);\n                            window.location.href = response.data.url;\n                        } else {\n                            tryCommonServicesUrls();\n                        }\n                    },\n                    error: function() {\n                        console.log('AJAX failed, trying common URLs...');\n                        tryCommonServicesUrls();\n                    }\n                });\n            }\n            \n            function tryCommonServicesUrls() {\n                var currentUrl = window.location.href;\n                var baseUrl = currentUrl.split('?')[0].replace(\/\\\/$\/, '');\n                \n                var commonPaths = [\n                    '\/services',\n                    '\/car-services', \n                    '\/additional-services',\n                    '\/extras'\n                ];\n                \n                \/\/ Try first common URL\n                window.location.href = baseUrl.replace(\/\\\/[^\\\/]*$\/, '') + commonPaths[0];\n            }\n            \n            function findAndRedirectToCheckoutPage() {\n                $.ajax({\n                    url: caralliance_ajax.ajax_url,\n                    type: 'POST',\n                    data: {\n                        action: 'caralliance_get_checkout_page_url',\n                        nonce: caralliance_ajax.nonce\n                    },\n                    success: function(response) {\n                        if (response.success && response.data.url) {\n                            console.log('Redirecting to checkout page:', response.data.url);\n                            window.location.href = response.data.url;\n                        } else {\n                            tryCommonCheckoutUrls();\n                        }\n                    },\n                    error: function() {\n                        console.log('AJAX failed, trying common URLs...');\n                        tryCommonCheckoutUrls();\n                    }\n                });\n            }\n            \n            function tryCommonCheckoutUrls() {\n                var currentUrl = window.location.href;\n                var baseUrl = currentUrl.split('?')[0].replace(\/\\\/$\/, '');\n                \n                var commonPaths = [\n                    '\/checkout',\n                    '\/car-checkout', \n                    '\/booking-checkout',\n                    '\/payment'\n                ];\n                \n                \/\/ Try first common URL\n                window.location.href = baseUrl.replace(\/\\\/[^\\\/]*$\/, '') + commonPaths[0];\n            }\n        });\n        <\/script>\n        \n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":6,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-45","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/pages\/45","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/comments?post=45"}],"version-history":[{"count":0,"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/pages\/45\/revisions"}],"wp:attachment":[{"href":"https:\/\/caralliancerentals.com\/it\/wp-json\/wp\/v2\/media?parent=45"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}