@extends('layouts/front') @section('title', __('store.checkout.title')) @section('scripts') @endsection @section('content')
@if (theme_metadata('enable_pagetitle', 'false') == 'false')

{{ __('store.checkout.title') }}

@endif @include("shared.alerts")
@if (Auth::check())
{{ __('auth.signed_in_as') }} {{ Auth::user()->FullName }} ({{ Auth::user()->email }})
@if (Auth::check() && !Auth::user()->hasVerifiedEmail() && setting('checkout.customermustbeconfirmed', false)) @endif @else @endif @if (Auth::check())
@csrf @php $checkoutCustomer = auth('web')->user(); $fiscalStatus = app(\App\Services\Billing\FiscalProfileService::class)->status($checkoutCustomer); @endphp

{{ __('einvoicing.profile.title') }}

{{ __('einvoicing.profile.description') }}

{{ __('einvoicing.status.'.$fiscalStatus) }}
@include('shared.select', [ 'name' => 'customer_type', 'label' => __('einvoicing.profile.type'), 'options' => [ 'individual' => __('einvoicing.profile.individual'), 'business' => __('einvoicing.profile.business'), 'association' => __('einvoicing.profile.association'), ], 'value' => old('customer_type', $checkoutCustomer->customer_type), ])
@foreach(app(\App\Services\Billing\FiscalProfileExtensionRegistry::class)->views() as $extensionView) @include($extensionView, ['customer' => $checkoutCustomer, 'context' => 'checkout']) @endforeach
@include('shared.input', ['name' => 'legal_name', 'label' => __('einvoicing.profile.legal_name'), 'value' => old('legal_name', $checkoutCustomer->legal_name), 'optional' => true])
@include('shared.select', ['name' => 'tax_subject_status', 'label' => __('einvoicing.profile.tax_subject_status'), 'options' => ['unknown' => __('einvoicing.profile.tax_status_unknown'), 'non_taxable' => __('einvoicing.profile.tax_status_non_taxable'), 'taxable_not_vat_liable' => __('einvoicing.profile.tax_status_taxable_not_vat_liable'), 'vat_liable' => __('einvoicing.profile.tax_status_vat_liable')], 'value' => old('tax_subject_status', $checkoutCustomer->tax_subject_status ?? 'unknown'), 'help' => __('einvoicing.profile.tax_subject_status_help')])
@include('shared.input', ['name' => 'rna_number', 'label' => __('einvoicing.profile.rna_number'), 'value' => old('rna_number', $checkoutCustomer->rna_number), 'optional' => true])
@include('shared.input', ['name' => 'vat_number', 'label' => __('einvoicing.profile.vat_number'), 'value' => old('vat_number', $checkoutCustomer->vat_number), 'optional' => true])
@include('shared.input', ['name' => 'siren', 'label' => __('einvoicing.profile.siren'), 'value' => old('siren', $checkoutCustomer->siren), 'optional' => true])
@include('shared.input', ['name' => 'siret', 'label' => __('einvoicing.profile.siret'), 'value' => old('siret', $checkoutCustomer->siret), 'optional' => true])
@include('shared.input', ['name' => 'tax_registration_number', 'label' => __('einvoicing.profile.tax_registration_number'), 'value' => old('tax_registration_number', $checkoutCustomer->tax_registration_number), 'optional' => true])
@include('shared.textarea', ['name' => 'billing_details', 'label' => __('einvoicing.profile.additional_details'), 'value' => old('billing_details', $checkoutCustomer->billing_details), 'help' => __('einvoicing.profile.additional_details_help'), 'optional' => true])
@include("shared.input", ["name" => "firstname", "label" => __('global.firstname'), "value" => auth('web')->user()->firstname ?? old("firstname")])
@include("shared.input", ["name" => "lastname", "label" => __('global.lastname'), "value" => auth('web')->user()->lastname ?? old("lastname")])
@include("shared.input", ["name" => "address", "label" => __('global.address'), "value" => auth('web')->user()->address ?? old("address")])
@include("shared.input", ["name" => "address2", "label" => __('global.address2'), "value" => auth('web')->user()->address2 ?? old("address2")])
@include("shared.input", ["name" => "zipcode", "label" => __('global.zip'), "value" => auth('web')->user()->zipcode ?? old("zipcode")])
@include("shared.input", ["name" => "email", "label" => __('global.email'), "type" => "email", "value" => auth('web')->user()->email ?? old("email"), "disabled"=> true])
@include('shared.phone-intl', [ 'name' => 'phone', 'label' => __('global.phone'), 'value' => auth('web')->user()->phone ?? old('phone'), 'country' => auth('web')->user()->country ?? old('country', 'FR'), ])
@include("shared.select", ["name" => "country", "label" => __('global.country'), "options" => $countries,"value" => auth('web')->user()->country ?? old("country")])
@include("shared.input", ["name" => "city", "label" => __('global.city'), "value" => auth('web')->user()->city ?? old("city")])
@include("shared.input", ["name" => "region", "label" => __('global.region'), "value" => auth('web')->user()->region ?? old("region")])
@if (setting('checkout.toslink'))
@endif @include('shared/captcha', ['center' => false]) @if ($basket->total() != 0)

{{ __('store.checkout.choose_payment') }}

@if (auth('web')->user()->paymentMethods()->isNotEmpty())

{{ __('store.checkout.choose_payment_method') }}

{{ __('store.checkout.choose_payment_method_description') }}

@include('shared/select', [ 'name' => 'paymentmethod', 'options' => auth('web')->user()->getPaymentMethodsArray()->merge(['none' => __('store.checkout.not_use_payment_method')]), 'value' => 'none' ])
@endif
@foreach ($gateways as $gateway) @endforeach
@endif @endif

{{ __('store.config.summary') }}

@foreach($basket->items as $row)
{{ $row->product->trans('name') }} {{ formatted_price($row->subtotalWithoutCoupon(), $row->currency) }}
@if (!empty($row->getOptions()))
@foreach ($row->getOptions() as $option)
{{ $option->formattedName() }} {{ formatted_price($option->subtotal($row->currency, $row->billing), $row->currency) }}
@endforeach @endif @endforeach @if ($basket->coupon)
{{ __('coupon.coupon') }} {{ $basket->coupon->code }}
@endif

@if ($basket->coupon)
@if ($basket->discount(\App\Models\Store\Basket\BasketRow::PRICE))
{{ __('coupon.discount_price') }} -{{ formatted_price($basket->discount(\App\Models\Store\Basket\BasketRow::PRICE), $basket->currency()) }}
@endif @if ($basket->coupon->free_setup == 0 && $basket->discount(\App\Models\Store\Basket\BasketRow::SETUP_FEES) > 0)
{{ __('coupon.discount_setup') }} -{{ formatted_price($basket->discount(\App\Models\Store\Basket\BasketRow::SETUP_FEES), $basket->currency()) }}
@endif
{{ __('store.config.recurring_payment') }} {{ formatted_price($basket->recurringPayment(), $basket->currency()) }}
{{ __('store.fees') }} {{ formatted_price($basket->setup(), $basket->currency()) }}
@if ($basket->coupon->free_setup == 1 && $basket->discount(\App\Models\Store\Basket\BasketRow::SETUP_FEES) > 0)
{{ __('coupon.free_setup') }} -{{ formatted_price($basket->discount(\App\Models\Store\Basket\BasketRow::SETUP_FEES), $basket->currency()) }}
@endif
{{ $basket->coupon ? __('coupon.subtotal_without_coupon') : __('store.subtotal') }} {{ formatted_price($basket->subtotalWithoutCoupon(), $basket->currency()) }}
{{ __('store.vat') }} {{ formatted_price($basket->tax(), $basket->currency()) }}

{{ __('coupon.subtotal_with_coupon') }} {{ formatted_price($basket->subtotal(), $basket->currency()) }}
@endif
{{ __('store.config.recurring_payment') }} {{ formatted_price($basket->recurringPayment(), $basket->currency()) }}
{{ __('store.vat') }} {{ formatted_price($basket->tax(), $basket->currency()) }}
{{ __('store.fees') }} {{ formatted_price($basket->setup(), $basket->currency()) }}

{{ __('store.basket.paytoday') }} {{ formatted_price($basket->total(), $basket->currency()) }}
{!! render_theme_sections() !!} @endsection