{{-- Mobile app promotion (homepage). Headline and text: Admin > Settings > Homepage (a blank headline hides the section). Store links: Admin > Settings > Social links; each QR code opens its store, or the website until the app is published. The two tilted phones are an HTML mock-up of the app with real product images. --}} @php $appTitle = \App\Modules\Settings\Support\HomeContent::text('app_title'); @endphp @if ($appTitle) @php $appText = \App\Modules\Settings\Support\HomeContent::text('app_text'); $stores = ['play' => settings('social.play_store'), 'apple' => settings('social.app_store')]; $qr = fn (string $url) => \Illuminate\Support\Facades\Cache::rememberForever('home.app-qr.'.md5($url), fn () => preg_replace('/^<\?xml[^>]*>\s*/', '', (new \BaconQrCode\Writer(new \BaconQrCode\Renderer\ImageRenderer(new \BaconQrCode\Renderer\RendererStyle\RendererStyle(160, 1), new \BaconQrCode\Renderer\Image\SvgImageBackEnd)))->writeString($url))); $badges = [ 'play' => ['top' => 'GET IT ON', 'name' => 'Google Play', 'os' => 'Android'], 'apple' => ['top' => 'Download on the', 'name' => 'App Store', 'os' => 'iPhone'], ]; $img = fn (string $file) => asset('images/products/'.$file.'.webp'); $cart = [['hathi-opc-53-grade-cement-50kg', 'OPC 53 Cement', '20 × ₹599'], ['ats-gold-tmt-bar-fe550d', 'TMT Fe 550D', '10 × ₹2,199'], ['sarwinplast-polytek-hs-polyurethane-leak-shield', 'Polytek HS', '2 × ₹6,900']]; @endphp
{{-- Left phone: order tracking --}}

{!! nl2br(e($appTitle)) !!}

@if ($appText)

{{ $appText }}

@endif
@foreach ($badges as $key => $badge) @php $link = $stores[$key]; @endphp
{!! $qr($link ?: route('home')) !!} <{{ $link ? 'a' : 'span' }} @if ($link) href="{{ $link }}" target="_blank" rel="noopener" @endif class="ap-badge" aria-label="{{ $badge['top'].' '.$badge['name'] }}"> @if ($key === 'play') @else @endif {{ $badge['top'] }}{{ $badge['name'] }} {{ $link ? $badge['os'] : 'Scan to open' }}
@endforeach
{{-- Right phone: cart and payment --}}
@endif