Compare commits

2 Commits
Author SHA1 Message Date
Hamza-Ayed 7bcfed3ce1 Update: 2026-07-06 02:17:53 2026-07-06 02:17:53 +03:00
Hamza-Ayed 6dccb63178 Update: 2026-07-06 02:13:27 2026-07-06 02:13:28 +03:00
+22 -4
View File
@@ -48,11 +48,13 @@ switch ($country) {
$promoMaxDiscount = 30.0;
break;
case 'Egypt':
case 'EG':
$minFare = 20.0;
$promoMaxDiscount = 25.0;
break;
case 'Jordan':
$minFare = 1.0;
case 'JO':
$minFare = 1.1;
$promoMaxDiscount = 0.30;
break;
default:
@@ -215,9 +217,24 @@ function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanR
$totalMinutes = floor($duration / 60);
$airportCtx = (stripos($startNameAddress, 'airport') !== false || stripos($startNameAddress, 'مطار') !== false || stripos($endNameAddress, 'airport') !== false || stripos($endNameAddress, 'مطار') !== false);
// === Queen Alia Airport (Amman) Bounding Box ===
$ammNorthLat = 31.745;
$ammSouthLat = 31.700;
$ammEastLng = 36.015;
$ammWestLng = 35.970;
$airportCtx = false;
$clubCtx = (stripos($startNameAddress, 'club') !== false || stripos($startNameAddress, 'ديسكو') !== false || stripos($endNameAddress, 'club') !== false || stripos($endNameAddress, 'ديسكو') !== false);
if ($isJordan) {
if (($destLat <= $ammNorthLat && $destLat >= $ammSouthLat && $destLng <= $ammEastLng && $destLng >= $ammWestLng) ||
($passengerLat <= $ammNorthLat && $passengerLat >= $ammSouthLat && $passengerLng <= $ammEastLng && $passengerLng >= $ammWestLng)) {
$airportCtx = true;
}
} else if ($isEgypt) {
$airportCtx = (stripos($startNameAddress, 'airport') !== false || stripos($startNameAddress, 'مطار') !== false || stripos($endNameAddress, 'airport') !== false || stripos($endNameAddress, 'مطار') !== false);
}
$northLat = 33.415313;
$southLat = 33.400265;
$eastLng = 36.531505;
@@ -285,8 +302,9 @@ function calculateDynamicPrice($country, $minFare, $distance, $duration, $kazanR
$price = max($fare, $minFare);
// Apply competitor-linked regional pricing overrides (undercut by 8%)
// Skip if it's an airport trip, as airport pricing is highly specific and should rely on our base + addon logic
$competitorTarget = null;
if (isset($con) && $con !== null) {
if (isset($con) && $con !== null && !$airportCtx && !$damascusAirportBoundCtx && !$isInDamascusAirportBoundCtx) {
try {
$countryCodeMap = [
'Syria' => 'SY',