{{-- Template Name: Blagajna (Elit Gastro) Custom-branded WooCommerce checkout page. Handles four states out of the same template: 1. Empty cart → friendly empty hero with link back to catalog. 2. Active checkout → the standard form (billing, shipping, payment). 3. Pay page → paying for a previously placed order. 4. Order received → the thank-you / order-confirmation page. Like template-cart.blade.php, this template renders the *classic* [woocommerce_checkout] shortcode so theme overrides under woocommerce/checkout/* run. --}} @extends('layouts.app') @section('content') @php $cart = function_exists('WC') ? WC()->cart : null; $cartCountLive = $cart ? $cart->get_cart_contents_count() : 0; $cartIsEmpty = $cartCountLive < 1; $isOrderReceived = function_exists('is_order_received_page') && is_order_received_page(); $isPayPage = function_exists('is_checkout_pay_page') && is_checkout_pay_page(); // Pull order details when applicable $order = null; $orderId = (int) get_query_var('order-received'); if (! $orderId && $isPayPage) { $orderId = (int) get_query_var('order-pay'); } if ($orderId && function_exists('wc_get_order')) { $order = wc_get_order($orderId); } @endphp
@if ($isOrderReceived)
{{ __('Narudžba zaprimljena', 'elit-gastro') }} @if ($order) · #{{ $order->get_order_number() }} @endif

{{ __('Hvala na narudžbi!', 'elit-gastro') }}

{{ __('Tvoja narudžba je zaprimljena i u obradi je. Detalje smo poslali na tvoj email.', 'elit-gastro') }}

@elseif ($isPayPage)
{{ __('Plaćanje', 'elit-gastro') }} @if ($order) · #{{ $order->get_order_number() }} @endif

{{ __('Završi plaćanje', 'elit-gastro') }}

{{ __('Pregledaj iznos i odaberi način plaćanja kako bi dovršio narudžbu.', 'elit-gastro') }}

@elseif ($cartIsEmpty)
{{ __('Blagajna', 'elit-gastro') }}

{{ __('Tvoja košarica je prazna.', 'elit-gastro') }}

{{ __('Dodaj proizvod u košaricu kako bi nastavio na blagajnu.', 'elit-gastro') }}

@else
{{ __('Blagajna', 'elit-gastro') }} · {{ sprintf(_n('%d artikl', '%d artikla', $cartCountLive, 'elit-gastro'), $cartCountLive) }}

{{ __('Završi narudžbu', 'elit-gastro') }}

{{ __('Posljednji korak: unesi podatke za dostavu i odaberi način plaćanja. Tvoji podaci su zaštićeni i koriste se isključivo za obradu narudžbe.', 'elit-gastro') }}

@endif
@if ($cartIsEmpty && ! $isOrderReceived && ! $isPayPage) {{-- Empty cart, not on thank-you / pay page → branded empty state --}}

{{ __('Nema artikala za naplatu', 'elit-gastro') }}

{{ __('Vrati se u katalog i odaberi proizvode prije nego nastaviš na blagajnu.', 'elit-gastro') }}

@if (function_exists('wc_get_page_id') && wc_get_page_id('shop') > 0) {{ __('U katalog', 'elit-gastro') }} @endif @if (function_exists('wc_get_page_id') && wc_get_page_id('cart') > 0) {{ __('Pogledaj košaricu', 'elit-gastro') }} @endif
@else {{-- Trust strip (hidden on the thank-you page; not relevant after purchase) --}} @unless ($isOrderReceived) @include('partials.trust-strip') @endunless
{{-- Always render the classic checkout so woocommerce/checkout/* overrides run --}} {!! do_shortcode('[woocommerce_checkout]') !!}
{{-- After thank-you, show CTAs to keep shopping or jump to account --}} @if ($isOrderReceived)

{{ __('Što dalje?', 'elit-gastro') }}

{{ __('Pratit ćemo isporuku i obavijestiti te emailom kada krene. Do tada, slobodno pregledaj druge proizvode iz našeg kataloga.', 'elit-gastro') }}

@if (function_exists('wc_get_page_id') && wc_get_page_id('shop') > 0) {{ __('Nastavi kupovinu', 'elit-gastro') }} @endif @if (function_exists('wc_get_page_id') && wc_get_page_id('myaccount') > 0) {{ __('Moj račun', 'elit-gastro') }} @endif
@endif {{-- Render any extra page editor content (intro copy, FAQ blocks etc.) below --}} @php $extra = ''; if (have_posts()) { while (have_posts()) { the_post(); $raw = get_the_content(); $raw = preg_replace('#.*?#s', '', $raw); $raw = preg_replace('##', '', $raw); $raw = str_ireplace('[woocommerce_checkout]', '', (string) $raw); $extra = trim((string) $raw); } wp_reset_postdata(); } @endphp @if (! empty($extra))
{!! apply_filters('the_content', $extra) !!}
@endif @endif
@endsection