// Define base prices for each service const basePrices = { 'serviceType1': 500, // Example service 1 price 'serviceType2': 1000, // Example service 2 price 'serviceType3': 1500, // Example service 3 price }; // Prices for extra services const extraServicesPrices = { transport: 50, accommodation: 100, food: 30, }; // Function to calculate the estimated cost function calculateEstimatedCost() { let estimatedCost = 0; // Get the selected service type and base price const selectedService = $w('#serviceTypeDropdown').value; estimatedCost += basePrices[selectedService] || 0; // Get the duration of the treatment and number of travelers const treatmentDuration = $w('#treatmentDurationSlider').value; const numberOfTravelers = $w('#travelerNumberSlider').value; // Example: Add cost per day of treatment and per traveler estimatedCost += treatmentDuration * 50; // Add €50 per day of treatment estimatedCost += numberOfTravelers * 100; // Add €100 per traveler // Check extra services (transport, accommodation, food) if ($w('#transportToggle').checked) { estimatedCost += extraServicesPrices.transport; } if ($w('#accommodationToggle').checked) { estimatedCost += extraServicesPrices.accommodation * treatmentDuration; // Accommodation is based on days } if ($w('#foodToggle').checked) { estimatedCost += extraServicesPrices.food * numberOfTravelers; // Food is based on travelers } // Display the calculated cost $w('#estimatedCostText').text = `Estimated Cost: €${estimatedCost}`; } // Attach event handlers to update the cost in real time $w.onReady(function () { // When sliders or toggles are changed, recalculate the cost $w('#treatmentDurationSlider').onChange(calculateEstimatedCost); $w('#travelerNumberSlider').onChange(calculateEstimatedCost); $w('#transportToggle').onChange(calculateEstimatedCost); $w('#accommodationToggle').onChange(calculateEstimatedCost); $w('#foodToggle').onChange(calculateEstimatedCost); $w('#serviceTypeDropdown').onChange(calculateEstimatedCost); });
top of page

Profile

Join date: Jul 13, 2024

About

0 likes received
0 comments received
0 best answers

Posts (29)

Mar 30, 20265 min
Affordable Lasik Surgery Cost Turkey: Your Guide to Clear Vision
When I first considered Lasik eye surgery, the cost was a big concern. I wanted a safe, effective procedure but also needed it to be affordable. That’s when I discovered Turkey as a top destination for Lasik surgery. The combination of expert care, modern clinics, and reasonable prices made it an obvious choice. If you’re exploring options for vision correction, this guide will walk you through everything you need to know about affordable Lasik surgery cost Turkey. Understanding Lasik Surgery...

1
0
Mar 24, 20262 min
Why Izmir Is the Hidden Gem for Medical Tourism in Turkey
Discover why Izmir is becoming a top destination for medical tourism in Turkey. With modern hospitals, experienced doctors, affordable prices, and a peaceful coastal environment, Izmir offers a stress-free alternative to crowded cities like Istanbul—perfect for combining high-quality treatment with a relaxing recovery experience.

2
0
Mar 22, 20264 min
The Importance of Personalized Treatment Plans in Healthcare: Custom Healthcare Plans Benefits
When it comes to healthcare, one size does not fit all. Every patient is unique, with different medical histories, lifestyles, and needs. That’s why personalized treatment plans are so important. They tailor medical care specifically to the individual, improving outcomes and patient satisfaction. In this post, I will share why personalized treatment plans matter, especially for those seeking medical treatments abroad, and how custom healthcare plans benefits can make a real difference in your...

1
0

Mario Lucas

Admin
More actions
bottom of page