generated from rapidez/package-template
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c2f690d
commit 84f5d52
Showing
42 changed files
with
554 additions
and
329 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
@extends('rapidez::layouts.app') | ||
|
||
@section('title', __('Checkout')) | ||
|
||
@section('robots', 'NOINDEX,NOFOLLOW') | ||
|
||
@section('content') | ||
<div class="overflow-clip"> | ||
<div class="container"> | ||
<x-rapidez-ct::layout.checkout> | ||
<x-slot:header> | ||
@include('rapidez-ct::checkout.partials.header', ['href' => route('cart')]) | ||
</x-slot:header> | ||
<x-rapidez-ct::title-progress-bar :$checkoutSteps :$currentStep :$currentStepKey> | ||
@lang('Credentials') | ||
</x-rapidez-ct::title-progress-bar> | ||
|
||
<form | ||
class="contents" | ||
v-on:submit.prevent="(e) => { | ||
submitPartials(e.target?.form ?? e.target) | ||
.then((result) => | ||
window.app.$emit('checkout-credentials-saved') | ||
&& window.Turbo.visit(window.url('{{ route('checkout', ['step' => 'payment']) }}')) | ||
).catch(); | ||
}" | ||
> | ||
@include('rapidez-ct::checkout.steps.credentials') | ||
<x-rapidez-ct::toolbar> | ||
<x-rapidez-ct::button.outline :href="route('cart')"> | ||
@lang('Back to cart') | ||
</x-rapidez-ct::button.outline> | ||
|
||
<x-rapidez-ct::button.enhanced loader> | ||
@lang('Next') | ||
</x-rapidez-ct::button.enhanced> | ||
</x-rapidez-ct::toolbar> | ||
</form> | ||
<x-slot:sidebar> | ||
@include('rapidez-ct::checkout.partials.sidebar.sidebar') | ||
</x-slot:sidebar> | ||
</x-rapidez-ct::layout.checkout> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
@extends('rapidez::layouts.app') | ||
|
||
@section('title', __('Checkout')) | ||
|
||
@section('robots', 'NOINDEX,NOFOLLOW') | ||
|
||
@section('content') | ||
<div class="overflow-clip"> | ||
<div class="container"> | ||
<x-rapidez-ct::layout.checkout> | ||
<x-slot:header> | ||
@include('rapidez-ct::checkout.partials.header', ['href' => route('cart')]) | ||
</x-slot:header> | ||
|
||
<x-rapidez-ct::title-progress-bar :$checkoutSteps :$currentStep :$currentStepKey> | ||
@lang('Credentials') | ||
</x-rapidez-ct::title-progress-bar> | ||
|
||
<form | ||
v-if="hasCart" | ||
v-on:submit.prevent="(e) => { | ||
submitPartials(e.target?.form ?? e.target) | ||
.then((result) => | ||
window.Turbo.visit(window.url('{{ route('checkout', ['step' => 'credentials']) }}')) | ||
).catch(); | ||
}" | ||
class="max-w-md mx-auto" | ||
v-cloak | ||
> | ||
@include('rapidez-ct::checkout.steps.login') | ||
<x-rapidez-ct::toolbar> | ||
<x-rapidez-ct::button.outline :href="route('cart')"> | ||
@lang('Back to cart') | ||
</x-rapidez-ct::button.outline> | ||
|
||
<x-rapidez-ct::button.enhanced loader type="submit" dusk="continue" > | ||
@lang('Next') | ||
</x-rapidez-ct::button.enhanced> | ||
</x-rapidez-ct::toolbar> | ||
</form> | ||
</x-rapidez-ct::layout.checkout> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
@extends('rapidez::layouts.app') | ||
|
||
@section('title', __('Checkout')) | ||
|
||
@section('robots', 'NOINDEX,NOFOLLOW') | ||
|
||
@section('content') | ||
<div class="overflow-clip"> | ||
<div class="container"> | ||
<x-rapidez-ct::layout.checkout> | ||
<x-slot:header> | ||
@include('rapidez-ct::checkout.partials.header', ['href' => route('cart')]) | ||
</x-slot:header> | ||
|
||
<x-rapidez-ct::title-progress-bar :$checkoutSteps :$currentStep :$currentStepKey> | ||
@lang('Payment') | ||
</x-rapidez-ct::title-progress-bar> | ||
|
||
<form | ||
class="contents" | ||
v-on:submit.prevent="(e) => { | ||
submitPartials(e.target?.form ?? e.target) | ||
.then((result) => | ||
window.app.$emit('checkout-payment-saved') | ||
&& window.app.$emit('placeOrder') | ||
).catch(); | ||
}" | ||
> | ||
@include('rapidez::checkout.steps.payment_method') | ||
<x-rapidez-ct::toolbar> | ||
<x-rapidez-ct::button.outline :href="route('checkout', ['step' => 'credentials'])"> | ||
@lang('Back to credentials') | ||
</x-rapidez-ct::button.outline> | ||
<graphql-mutation | ||
:query="config.queries.placeOrder" | ||
:variables="{ cart_id: mask }" | ||
:before-request="handleBeforePlaceOrderHandlers" | ||
:callback="handlePlaceOrder" | ||
mutate-event="placeOrder" | ||
redirect="{{ route('checkout.success') }}" | ||
v-slot="{ mutate, variables }" | ||
> | ||
<fieldset> | ||
<x-rapidez-ct::button.enhanced class="relative" type="submit" dusk="continue" loader> | ||
@lang('Place order') | ||
</x-rapidez-ct::button.enhanced> | ||
</fieldset> | ||
</graphql-mutation> | ||
</x-rapidez-ct::toolbar> | ||
</form> | ||
<x-slot:sidebar> | ||
@include('rapidez-ct::checkout.partials.sidebar.sidebar') | ||
</x-slot:sidebar> | ||
</x-rapidez-ct::layout.checkout> | ||
</div> | ||
</div> | ||
@endsection |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
60 changes: 49 additions & 11 deletions
60
resources/views/checkout/partials/sections/address.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,52 @@ | ||
<checkout-address v-slot="{ useCards, editing, toggleEdit, isType, select }"> | ||
<x-rapidez-ct::card.inactive v-if="useCards && !editing"> | ||
@include('rapidez-ct::checkout.partials.address-cards') | ||
@include('rapidez-ct::checkout.partials.buttons.address') | ||
</x-rapidez-ct::card.inactive> | ||
<checkout-address v-slot="{ useCards, editing, toggleEdit }"> | ||
<div class="contents"> | ||
<template v-if="useCards && !editing"> | ||
@include('rapidez-ct::checkout.partials.address-cards') | ||
@include('rapidez-ct::checkout.partials.buttons.address') | ||
</template> | ||
|
||
<x-rapidez-ct::card.inactive v-else> | ||
@include('rapidez-ct::checkout.partials.shipping-billing-fields', ['type' => 'shipping']) | ||
<template v-else> | ||
<graphql-mutation | ||
:query="config.queries.setNewShippingAddressesOnCart" | ||
:variables="{ | ||
cart_id: mask, | ||
...window.address_defaults, | ||
...cart.shipping_addresses[0], | ||
country_code: cart.shipping_addresses[0]?.country.code || window.address_defaults.country_code | ||
}" | ||
group="shipping" | ||
:callback="updateCart" | ||
:error-callback="checkResponseForExpiredCart" | ||
:watch="false" | ||
mutate-event="setShippingAddressesOnCart" | ||
v-slot="{ mutate, variables }" | ||
v-if="!cart.is_virtual" | ||
> | ||
<fieldset partial-submit="mutate" v-on:change="function (e) {e.target.closest('fieldset').querySelector(':invalid') === null && mutate().then(() => (cart?.billing_address?.same_as_shipping ?? true) && window.app.$emit('setBillingAddressOnCart'))}"> | ||
@include('rapidez-ct::checkout.partials.shipping-billing-fields', ['type' => 'shipping']) | ||
</fieldset> | ||
</graphql-mutation> | ||
|
||
<div class="mt-9 pt-7 border-t border-dashed" v-if="!checkout.hide_billing"> | ||
@include('rapidez-ct::checkout.partials.shipping-billing-fields', ['type' => 'billing']) | ||
</div> | ||
</x-rapidez-ct::card.inactive> | ||
<graphql-mutation | ||
:query="config.queries.setNewBillingAddressOnCart" | ||
:variables="JSON.parse(JSON.stringify({ | ||
cart_id: mask, | ||
...window.address_defaults, | ||
...cart.billing_address, | ||
same_as_shipping: !cart.is_virtual && (cart?.billing_address?.same_as_shipping ?? true), | ||
country_code: cart.billing_address?.country.code || window.address_defaults.country_code | ||
}))" | ||
:callback="updateCart" | ||
:error-callback="checkResponseForExpiredCart" | ||
:watch="false" | ||
group="billing" | ||
mutate-event="setBillingAddressOnCart" | ||
v-slot="{ mutate, variables }" | ||
> | ||
<fieldset partial-submit="mutate" v-on:change="function (e) {e.target.closest('fieldset').querySelector(':invalid') === null && mutate().then(() => (cart?.billing_address?.same_as_shipping ?? true) && window.app.$emit('setBillingAddressOnCart'))}"> | ||
@include('rapidez-ct::checkout.partials.shipping-billing-fields', ['type' => 'billing']) | ||
</fieldset> | ||
</graphql-mutation> | ||
</template> | ||
</div> | ||
</checkout-address> |
Oops, something went wrong.