@extends('plugins/ecommerce::orders.master') @section('title') {{ __('Checkout') }} @stop @section('content') @if (Cart::instance('cart')->count() > 0) @php $rawTotal = Cart::instance('cart')->rawTotal(); $orderAmount = max($rawTotal - $promotionDiscountAmount - $couponDiscountAmount, 0); $orderAmount += (float)$shippingAmount; @endphp @if (is_plugin_active('payment')) @include('plugins/payment::partials.header') @endif {!! Form::open(['route' => ['public.checkout.process', $token], 'class' => 'checkout-form payment-checkout-form', 'id' => 'checkout-form']) !!}
@include('plugins/ecommerce::orders.partials.logo')
{!! apply_filters(RENDER_PRODUCTS_IN_CHECKOUT_PAGE, $products) !!}

{{ __('Subtotal') }}:

{{ format_price(Cart::instance('cart')->rawSubTotal()) }}

@if (EcommerceHelper::isTaxEnabled())

{{ __('Tax') }}:

{{ format_price(Cart::instance('cart')->rawTax()) }}

@endif @if (session('applied_coupon_code'))

{{ __('Coupon code') }}:

{{ session('applied_coupon_code') }}

@endif @if ($couponDiscountAmount > 0)

{{ __('Coupon code discount amount') }}:

{{ format_price($couponDiscountAmount) }}

@endif @if ($promotionDiscountAmount > 0)

{{ __('Promotion discount amount') }}:

{{ format_price($promotionDiscountAmount) }}

@endif @if (!empty($shipping) && Arr::get($sessionCheckoutData, 'is_available_shipping', true))

{{ __('Shipping fee') }}:

{{ format_price($shippingAmount) }}

@endif

{{ __('Total') }}:

{{ format_price($orderAmount) }}


@include('plugins/ecommerce::themes.discounts.partials.form')
@include('plugins/ecommerce::orders.partials.logo')
{!! apply_filters('ecommerce_checkout_form_before', null, $products) !!} @if ($isShowAddressForm)
{{ __('Shipping information') }}
@include('plugins/ecommerce::orders.partials.address-form', compact('sessionCheckoutData'))

{!! apply_filters('ecommerce_checkout_form_after_shipping_address_form', null, $products) !!} @endif @if (EcommerceHelper::isBillingAddressEnabled())
{{ __('Billing information') }}
@include('plugins/ecommerce::orders.partials.billing-address-form', compact('sessionCheckoutData'))

{!! apply_filters('ecommerce_checkout_form_after_billing_address_form', null, $products) !!} @endif @if (! is_plugin_active('marketplace')) @if (Arr::get($sessionCheckoutData, 'is_available_shipping', true))
{{ __('Shipping method') }}
@if (!empty($shipping))
    @foreach ($shipping as $shippingKey => $shippingItems) @foreach($shippingItems as $shippingOption => $shippingItem) @include('plugins/ecommerce::orders.partials.shipping-option', [ 'shippingItem' => $shippingItem, 'attributes' =>[ 'id' => 'shipping-method-' . $shippingKey . '-' . $shippingOption, 'name' => 'shipping_method', 'class' => 'magic-radio shipping_method_input', 'checked' => old('shipping_method', $defaultShippingMethod) == $shippingKey && old('shipping_option', $defaultShippingOption) == $shippingOption, 'disabled' => Arr::get($shippingItem, 'disabled'), 'data-option' => $shippingOption, ], ]) @endforeach @endforeach
@else

{{ __('No shipping methods available!') }}

@endif

{!! apply_filters('ecommerce_checkout_form_after_shipping_address_form', null, $products) !!} @endif @endif {!! apply_filters('ecommerce_checkout_form_before_payment_form', null, $products) !!} @if (is_plugin_active('payment'))
{{ __('Payment method') }}
@if (is_plugin_active('payment')) {!! apply_filters(PAYMENT_FILTER_PAYMENT_PARAMETERS, null) !!} @endif
    @if ($orderAmount) {!! apply_filters(PAYMENT_FILTER_ADDITIONAL_PAYMENT_METHODS, null, [ 'amount' => format_price($orderAmount, null, true), 'currency' => strtoupper(get_application_currency()->title), 'name' => null, 'selected' => PaymentMethods::getSelectedMethod(), 'default' => PaymentMethods::getDefaultMethod(), 'selecting' => PaymentMethods::getSelectingMethod(), ]) !!} {!! PaymentMethods::render() !!} @endif

@else @endif {!! apply_filters('ecommerce_checkout_form_after_payment_form', null, $products) !!}

{!! Form::error('description', $errors) !!}
@if (EcommerceHelper::getMinimumOrderAmount() > Cart::instance('cart')->rawSubTotal())
{{ __('Minimum order amount is :amount, you need to buy more :more to place an order!', ['amount' => format_price(EcommerceHelper::getMinimumOrderAmount()), 'more' => format_price(EcommerceHelper::getMinimumOrderAmount() - Cart::instance('cart')->rawSubTotal())]) }}
@endif @if(EcommerceHelper::isDisplayTaxFieldsAtCheckoutPage()) @include('plugins/ecommerce::orders.partials.tax-information', compact('sessionCheckoutData')) {!! apply_filters('ecommerce_checkout_form_after_tax_information_form', null, $products) !!} @endif {!! apply_filters('ecommerce_checkout_form_after', null, $products) !!}
@if (EcommerceHelper::isValidToProcessCheckout()) @else {{ __('Checkout') }} @endif
{!! Form::close() !!} @if (is_plugin_active('payment')) @include('plugins/payment::partials.footer') @endif @else
{!! __('No products in cart. :link!', ['link' => Html::link(route('public.index'), __('Back to shopping'))]) !!}
@endif @stop @push('footer') {!! JsValidator::formRequest(\Botble\Ecommerce\Http\Requests\SaveCheckoutInformationRequest::class, '#checkout-form'); !!} @endpush