-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use checkout form builder and add preview mode to fulfilmen…
…t components Signed-off-by: Sam Poyigi <[email protected]>
- Loading branch information
Showing
28 changed files
with
394 additions
and
487 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
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,74 @@ | ||
<?php | ||
|
||
use Igniter\User\Facades\Auth; | ||
use Illuminate\Validation\Rule; | ||
|
||
return [ | ||
'fields' => [ | ||
'first_name' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_first_name', | ||
'tab' => 'details', | ||
'type' => 'text', | ||
], | ||
'last_name' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_last_name', | ||
'tab' => 'details', | ||
'type' => 'text', | ||
], | ||
'email' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_email', | ||
'tab' => 'details', | ||
'type' => 'email', | ||
], | ||
'telephone' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_telephone', | ||
'tab' => 'details', | ||
'type' => 'telephone', | ||
], | ||
'comment' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_comment', | ||
'tab' => 'comments', | ||
'type' => 'textarea', | ||
'cssClass' => 'col-sm-12', | ||
], | ||
'delivery_comment' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_delivery_comment', | ||
'tab' => 'comments', | ||
'type' => 'textarea', | ||
'cssClass' => 'col-sm-12', | ||
], | ||
'payment' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.label_payment_method', | ||
'tab' => 'payments', | ||
'type' => 'payments', | ||
'cssClass' => 'col-sm-12', | ||
], | ||
'termsAgreed' => [ | ||
'label' => 'lang:igniter.cart::default.checkout.text_checkout_terms', | ||
'tab' => 'terms', | ||
'type' => 'checkbox', | ||
'cssClass' => 'col-sm-12', | ||
'options' => [], | ||
], | ||
], | ||
'rules' => [ | ||
'first_name' => ['required', 'between:1,48'], | ||
'last_name' => ['required', 'between:1,48'], | ||
'email' => ['sometimes', 'required', 'email:filter', 'max:96', | ||
Rule::unique('customers', 'email')->ignore(Auth::customer()?->getKey(), 'customer_id') | ||
Check failure on line 58 in resources/models/checkoutfields.php GitHub Actions / PHP 8.2 - Static Analysis
|
||
], | ||
'telephone' => ['sometimes', 'required_if:telephoneIsRequired,true', 'regex:/^([0-9\s\-\+\(\)]*)$/i'], | ||
'comment' => ['max:500'], | ||
'delivery_comment' => ['max:500'], | ||
'payment' => ['sometimes', 'nullable', 'alpha_dash'], | ||
'termsAgreed' => ['sometimes', 'accepted'], | ||
'payment_fields' => ['sometimes', 'array'], | ||
'payment_fields.*' => ['sometimes'], | ||
'payment_fields.pay_from_profile' => ['sometimes', 'integer'], | ||
'payment_fields.create_payment_profile' => ['sometimes', 'integer'], | ||
], | ||
'messages' => [ | ||
'telephone.required_if' => lang('igniter.orange::default.error_telephone_required'), | ||
'telephone.regex' => lang('igniter.orange::default.error_telephone_invalid'), | ||
], | ||
]; |
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
129 changes: 0 additions & 129 deletions
129
resources/views/includes/checkout/address-fields.blade.php
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
resources/views/includes/checkout/customer-fields.blade.php
This file was deleted.
Oops, something went wrong.
14 changes: 14 additions & 0 deletions
14
resources/views/includes/checkout/delivery-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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<div class="mt-2 pt-2 border-top fs-6"> | ||
@php($deliveryAddress = array_filter(array_only($fields, ['address_1', 'city', 'state', 'postcode']))) | ||
<i class="fas fa-location-dot me-2"></i> | ||
@if($deliveryAddress) | ||
{{ html(format_address($deliveryAddress, false)) }} | ||
@else | ||
@lang('igniter.orange::default.text_no_delivery_address') | ||
@endif | ||
</div> | ||
<x-igniter-orange::forms.error | ||
field="delivery_address" | ||
id="delivery-address-feedback" | ||
class="text-danger" | ||
/> |
15 changes: 0 additions & 15 deletions
15
resources/views/includes/checkout/delivery-comment-field.blade.php
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.