diff --git a/app/Http/Controllers/ProductController.php b/app/Http/Controllers/ProductController.php index 7d45019..4f05fbe 100644 --- a/app/Http/Controllers/ProductController.php +++ b/app/Http/Controllers/ProductController.php @@ -74,8 +74,8 @@ class ProductController extends Controller return view($product->view_template, compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta')); } - // Use landing page template if landing_page_data exists and product type is 'product' - if ($product->type === 'product' && !empty($product->landing_page_data)) { + // Use landing page template if landing_page_data exists + if (!empty($product->landing_page_data)) { return view('front.products.landing', compact('product', 'settings', 'renderedHeader', 'renderedFooter', 'meta')); } diff --git a/resources/views/front/products/landing.blade.php b/resources/views/front/products/landing.blade.php index 098cc14..60bad3d 100644 --- a/resources/views/front/products/landing.blade.php +++ b/resources/views/front/products/landing.blade.php @@ -18,8 +18,7 @@ use Illuminate\Support\Facades\Storage; $currentLang = app()->getLocale(); // Helper function to get translated value with fallback - $getTranslated = function($item, $key, $default = '') { - global $currentLang; + $getTranslated = function($item, $key, $default = '') use ($currentLang) { if (isset($item["{$key}_{$currentLang}"])) { return $item["{$key}_{$currentLang}"]; } @@ -34,13 +33,13 @@ use Illuminate\Support\Facades\Storage;
- @if(!empty($hero['slogan'])) + @if($slogan = $getTranslated($hero, 'slogan'))

- {!! nl2br(e($hero['slogan'])) !!} + {!! nl2br(e($slogan)) !!}

@endif - @if(!empty($hero['sub_slogan'])) -

{{ $hero['sub_slogan'] }}

+ @if($subSlogan = $getTranslated($hero, 'sub_slogan')) +

{{ $subSlogan }}

@endif
@if(!empty($hero['app_store_link'])) @@ -92,9 +91,9 @@ use Illuminate\Support\Facades\Storage;
-

App Features

+

{{ t('Özellikler') }}

- {{ $product->translate('title') }} makes your experience better for you to have the perfect control. + {{ $product->translate('title') }} {{ t('deneyiminizi mükemmelleştirmek için buradayız.') }}

@@ -104,17 +103,20 @@ use Illuminate\Support\Facades\Storage;
@foreach($features as $index => $feature) + @php + $featureTitle = $getTranslated($feature, 'title'); + @endphp
@if(!empty($feature['icon']))
@php - $iconPath = public_path('docs/styleguide/_/assets/img/icons/solid/' . $feature['icon'] . '.svg'); + $iconPath = public_path('assets/img/icons/solid/' . $feature['icon'] . '.svg'); $iconUrl = file_exists($iconPath) - ? asset('docs/styleguide/_/assets/img/icons/solid/' . $feature['icon'] . '.svg') + ? asset('assets/img/icons/solid/' . $feature['icon'] . '.svg') : null; @endphp @if($iconUrl) - {{ $feature['title'] ?? '' }} + {{ $featureTitle }} @else
{{ substr($feature['icon'], 0, 2) }} @@ -122,8 +124,8 @@ use Illuminate\Support\Facades\Storage; @endif
@endif - @if(!empty($feature['title'])) -

{{ $feature['title'] }}

+ @if($featureTitle) +

{{ $featureTitle }}

@endif
@@ -140,15 +142,23 @@ use Illuminate\Support\Facades\Storage; @endif + {{-- Description Section --}} + @php + $productContent = $product->translate('content'); + @endphp + @if(!empty($productContent)) + {!! $productContent !!} + @endif + {{-- How It Works Section --}} @if(!empty($howItWorks) && !empty($steps))
- @if(!empty($howItWorks['download_form_label'])) + @if($howItWorksLabel = $getTranslated($howItWorks, 'download_form_label'))

- {{ $howItWorks['download_form_label'] }} + {{ $howItWorksLabel }}

@endif
@@ -172,11 +182,11 @@ use Illuminate\Support\Facades\Storage; @if($index < 2)
{{ str_pad($step['number'] ?? ($index + 1), 2, '0', STR_PAD_LEFT) }} - @if(!empty($step['title'])) -

{{ $step['title'] }}

+ @if($stepTitle = $getTranslated($step, 'title')) +

{{ $stepTitle }}

@endif - @if(!empty($step['description'])) -

{{ $step['description'] }}

+ @if($stepDescription = $getTranslated($step, 'description')) +

{{ $stepDescription }}

@endif
@@ -189,11 +199,11 @@ use Illuminate\Support\Facades\Storage; @if($index >= 2)
{{ str_pad($step['number'] ?? ($index + 1), 2, '0', STR_PAD_LEFT) }} - @if(!empty($step['title'])) -

{{ $step['title'] }}

+ @if($stepTitle = $getTranslated($step, 'title')) +

{{ $stepTitle }}

@endif - @if(!empty($step['description'])) -

{{ $step['description'] }}

+ @if($stepDescription = $getTranslated($step, 'description')) +

{{ $stepDescription }}

@endif
@@ -271,7 +281,7 @@ use Illuminate\Support\Facades\Storage; data-bs-target="#accordion-collapse-faq-{{ $index }}" aria-expanded="false" aria-controls="accordion-collapse-faq-{{ $index }}"> - {{ $faq['question'] ?? '' }} + {{ $getTranslated($faq, 'question') }}
@@ -280,7 +290,7 @@ use Illuminate\Support\Facades\Storage; aria-labelledby="accordion-heading-faq-{{ $index }}" data-bs-target="#accordion-faq">
-

{!! nl2br(e($faq['answer'] ?? '')) !!}

+

{!! nl2br(e($getTranslated($faq, 'answer'))) !!}

diff --git a/routes/web.php b/routes/web.php index 8474074..9adf699 100644 --- a/routes/web.php +++ b/routes/web.php @@ -103,6 +103,7 @@ Route::prefix('admin/api')->middleware(['auth', \App\Http\Middleware\SuperAdminM }); // Products & Services +Route::redirect('/urun-hizmet/Yazılım Danışmanlık', '/urun-hizmet/yazilim-danismanlik', 301); Route::get('/urun-hizmet/{slug}', [\App\Http\Controllers\ProductController::class, 'show'])->name('products.show'); // Career