From 06fc3631afec3a1829040af8381082dde92c0fdb Mon Sep 17 00:00:00 2001 From: Azim Kordpour Date: Tue, 30 Jun 2026 14:23:39 +0200 Subject: [PATCH 1/2] MLZ-4139: Refactor `getUrlToTripBuilder` in `BaseCheckoutComponent` to handle `origin` comparison case-insensitively and streamline URL building logic. --- src/Livewire/BaseCheckoutComponent.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Livewire/BaseCheckoutComponent.php b/src/Livewire/BaseCheckoutComponent.php index 8b23ed3..8b6749d 100644 --- a/src/Livewire/BaseCheckoutComponent.php +++ b/src/Livewire/BaseCheckoutComponent.php @@ -291,12 +291,19 @@ public function nezasaPlannerUrl(): string #[Computed] public function getUrlToTripBuilder(): string { - $baseUrl = $this->origin === 'IBE' - ? config('checkout.nezasa.ibe_base_url') - : config('checkout.nezasa.base_url'); + if (strtolower($this->origin) === 'ibe') { + $baseUrl = config('checkout.nezasa.ibe_base_url'); - return $this->goTo === 'smartplanner' - ? $baseUrl.'?nz-url='.urlencode("/itinerary-apps/smartplanner/{$this->itineraryId}?nz-lang={$this->lang}") - : $baseUrl.'/itineraries/'.$this->itineraryId; + return $this->goTo === 'smartplanner' + ? $baseUrl.'?nz-url='.urlencode("/itinerary-apps/smartplanner/{$this->itineraryId}?nz-lang={$this->lang}") + : $baseUrl.'?nz-url='.urlencode('/itineraries/'.$this->itineraryId.'?nz-lang='.$this->lang); + + } else { + $baseUrl = config('checkout.nezasa.base_url'); + + return $this->goTo === 'smartplanner' + ? $baseUrl.'/itinerary-apps/smartplanner/'.$this->itineraryId + : $baseUrl.'/itineraries/'.$this->itineraryId; + } } } From 96791661b345627cfcbf52e61fddddb2231a5318 Mon Sep 17 00:00:00 2001 From: Azim Kordpour Date: Tue, 30 Jun 2026 16:47:40 +0200 Subject: [PATCH 2/2] MLZ-5139: Refactor `TripSummary::getUrlToDrawer` to handle `origin` comparison case-insensitively and improve URL generation consistency. --- src/Livewire/TripSummary.php | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/src/Livewire/TripSummary.php b/src/Livewire/TripSummary.php index 806bc57..4587913 100644 --- a/src/Livewire/TripSummary.php +++ b/src/Livewire/TripSummary.php @@ -198,12 +198,19 @@ public function getUrlToReplaceComponent(NezasaComponentDtoContract $componentDt { $type = $componentDto->getType()->isTransport() ? 'flight' : $componentDto->getType()->toLower(); - $baseUrl = $this->origin === 'IBE' - ? config('checkout.nezasa.ibe_base_url') - : config('checkout.nezasa.base_url'); + if (strtolower($this->origin) === 'ibe') { + $baseUrl = config('checkout.nezasa.ibe_base_url'); - return $this->goTo === 'smartplanner' - ? $baseUrl.'?nz-url='.urlencode("/itinerary-apps/smartplanner/$this->itineraryId?nz-lang=$this->lang&openDrawer=$type&componentId=".$componentDto->getId()) - : $baseUrl.'/itineraries/'.$this->itineraryId; + return $this->goTo === 'smartplanner' + ? $baseUrl.'?nz-url='.urlencode("/itinerary-apps/smartplanner/{$this->itineraryId}?nz-lang=$this->lang&openDrawer=$type&componentId=".$componentDto->getId()) + : $baseUrl.'?nz-url='.urlencode("/itineraries/$this->itineraryId?nz-lang=$this->lang&openDrawer=$type&componentId=".$componentDto->getId()); + + } else { + $baseUrl = config('checkout.nezasa.base_url'); + + return $this->goTo === 'smartplanner' + ? $baseUrl.'/itinerary-apps/smartplanner/'.$this->itineraryId + : $baseUrl.'/itineraries/'.$this->itineraryId; + } } }