Compare commits
2
Commits
ac50598ee0
...
7bcfed3ce1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7bcfed3ce1 | ||
|
|
6dccb63178 |
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user