Update: 2026-07-09 03:41:48
This commit is contained in:
@@ -66,26 +66,20 @@ if ($avgPricePerKm <= 0) {
|
||||
}
|
||||
|
||||
// Calculate the competitor's total price based on distance and average market per-km rate
|
||||
// 🔥 لا يوجد أي تعديل صناعي على سعر المنافس هنا — الرقم المعروض للراكب
|
||||
// يجب أن يعكس بيانات السوق الحقيقية فقط، حتى لو لم نكن أرخص فعلياً في هذه الرحلة.
|
||||
$competitorTotalPrice = round($distance * $avgPricePerKm, 2);
|
||||
|
||||
// Make sure competitor is slightly higher than us for psychological effect
|
||||
// if their raw math somehow ended up lower due to straight per-km multiplication
|
||||
if ($siroPrice > 0 && $competitorTotalPrice <= $siroPrice) {
|
||||
// Force a dynamic difference based on country
|
||||
$multiplier = ($countryCode === 'JO') ? 1.15 : 1.10;
|
||||
$competitorTotalPrice = round($siroPrice * $multiplier, 2);
|
||||
}
|
||||
|
||||
// Calculate savings
|
||||
$savingsPct = 0;
|
||||
if ($competitorTotalPrice > 0 && $siroPrice < $competitorTotalPrice) {
|
||||
$savingsPct = (($competitorTotalPrice - $siroPrice) / $competitorTotalPrice) * 100;
|
||||
}
|
||||
|
||||
// Format the labels
|
||||
$compNameAr = 'التطبيقات الأخرى';
|
||||
|
||||
$savingsLabel = "أوفر بـ " . number_format($savingsPct, 1) . "% من $compNameAr ⚡";
|
||||
// نعرض شارة "أوفر" فقط إذا كنا أرخص فعلياً حسب البيانات الحقيقية — لا تلاعب بالأرقام
|
||||
$savingsPct = 0;
|
||||
$savingsLabel = null;
|
||||
if ($competitorTotalPrice > 0 && $siroPrice > 0 && $siroPrice < $competitorTotalPrice) {
|
||||
$savingsPct = (($competitorTotalPrice - $siroPrice) / $competitorTotalPrice) * 100;
|
||||
$savingsLabel = "أوفر بـ " . number_format($savingsPct, 1) . "% من $compNameAr ⚡";
|
||||
}
|
||||
|
||||
$siroCommissionRate = 0.14; // Default 14% commission
|
||||
if ($countryCode === 'JO') $siroCommissionRate = 0.14;
|
||||
|
||||
Reference in New Issue
Block a user