diff --git a/.github/workflows/translations.yml b/.github/workflows/translations.yml new file mode 100644 index 00000000..1e4a4bb5 --- /dev/null +++ b/.github/workflows/translations.yml @@ -0,0 +1,26 @@ +name: Check translations + +on: + push: + branches: + - master + - '*.x' + pull_request: + +jobs: + translations: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick + coverage: none + - name: Install dependencies + run: composer install --prefer-dist --no-interaction + - name: Check translations + uses: rapidez/laravel-translation-checker@master diff --git a/README.md b/README.md index 9c73214d..7e22e50a 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,8 @@ php artisan vendor:publish --tag=payment-icons ## Customizations +It is recommended to edit the `config/rapidez/frontend.php` and remove the `login` step. This will enable two step checkout. + If you want you *could* publish the views. But it's recommended to only publish and change the views you need so when there is an update you don't have to compare all views with the new version. Also keep in mind this is an opinionated theme, if you want/need to change a lot it's better to build your own in terms of upgradability. ``` php artisan vendor:publish --provider="Rapidez\CheckoutTheme\ServiceProvider" --tag=views diff --git a/composer.json b/composer.json index 5c805237..98d19a9b 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,7 @@ "require": { "php": "^8.0|^8.1|^8.2", "blade-ui-kit/blade-heroicons": "^2.0", - "rapidez/core": "^2.0" + "rapidez/core": "^3.0" }, "autoload": { "psr-4": { diff --git a/lang/nl.json b/lang/nl.json index 2b189d9e..426fb8c9 100644 --- a/lang/nl.json +++ b/lang/nl.json @@ -15,6 +15,7 @@ "and use a different e-mail address.": "en gebruik een ander e-mailadres.", "Back to account": "Terug naar account", "Back to cart": "Terug naar winkelwagen", + "This product it out of stock, remove it to continue your order.": "Dit product is niet op voorraad, verwijder het om verder te gaan met je bestelling.", "Back to credentials": "Terug naar inloggegevens", "Back to dashboard": "Terug naar dashboard", "Back to login": "Terug naar inloggen", @@ -72,7 +73,6 @@ "Select as billing": "Selecteer als factuuradres", "Select as shipping": "Selecteer als verzendadres", "Send": "Versturen", - "Step 1 of 4": "Stap 1 van 4", "Step :step out of :total": "Stap :step van :total", "Subscribe to newsletter": "Inschrijven voor nieuwsbrief", "Thank you for subscribing": "Bedankt voor uw inschrijving", diff --git a/resources/core-overwrites/checkout/overview.blade.php b/resources/core-overwrites/checkout/overview.blade.php deleted file mode 100644 index 08ed49ac..00000000 --- a/resources/core-overwrites/checkout/overview.blade.php +++ /dev/null @@ -1 +0,0 @@ -@include('rapidez-ct::checkout.overview') diff --git a/resources/core-overwrites/checkout/pages/credentials.blade.php b/resources/core-overwrites/checkout/pages/credentials.blade.php new file mode 100644 index 00000000..514f804a --- /dev/null +++ b/resources/core-overwrites/checkout/pages/credentials.blade.php @@ -0,0 +1 @@ +@include('rapidez-ct::checkout.pages.credentials') diff --git a/resources/core-overwrites/checkout/pages/login.blade.php b/resources/core-overwrites/checkout/pages/login.blade.php new file mode 100644 index 00000000..7da99067 --- /dev/null +++ b/resources/core-overwrites/checkout/pages/login.blade.php @@ -0,0 +1 @@ +@include('rapidez-ct::checkout.pages.login') diff --git a/resources/core-overwrites/checkout/pages/payment.blade.php b/resources/core-overwrites/checkout/pages/payment.blade.php new file mode 100644 index 00000000..cb13cdd3 --- /dev/null +++ b/resources/core-overwrites/checkout/pages/payment.blade.php @@ -0,0 +1 @@ +@include('rapidez-ct::checkout.pages.payment') diff --git a/resources/core-overwrites/checkout/steps/payment_method.blade.php b/resources/core-overwrites/checkout/steps/payment_method.blade.php new file mode 100644 index 00000000..d2c21dc1 --- /dev/null +++ b/resources/core-overwrites/checkout/steps/payment_method.blade.php @@ -0,0 +1 @@ +@include('rapidez-ct::checkout.steps.payment_method') \ No newline at end of file diff --git a/resources/js/components/CheckoutAddress.vue b/resources/js/components/CheckoutAddress.vue index 69454e52..34d4d469 100644 --- a/resources/js/components/CheckoutAddress.vue +++ b/resources/js/components/CheckoutAddress.vue @@ -13,26 +13,6 @@ methods: { toggleEdit() { this.editing = !this.editing - - if (this.editing) { - this.$root.checkout['billing_address'].customer_address_id = null - this.$root.checkout['shipping_address'].customer_address_id = null - } - }, - - isType(type, address) { - let check = this.$root.checkout[`${type}_address`] - - if (!check) { - return false - } - - return check.id == address.id || check.customer_address_id == address.id - }, - - select(type, address) { - this.$root.checkout[`${type}_address`] = address - this.$root.checkout[`${type}_address`].customer_address_id = address.id }, }, diff --git a/resources/js/components/CheckoutSuccessAddresses.vue b/resources/js/components/CheckoutSuccessAddresses.vue index 3b6202c6..b1a3b9a6 100644 --- a/resources/js/components/CheckoutSuccessAddresses.vue +++ b/resources/js/components/CheckoutSuccessAddresses.vue @@ -32,30 +32,15 @@ }, shipping() { - if(!this.order?.sales_order_addresses) { - return null; - } - - let shipping = this.order.sales_order_addresses.filter(e => e.address_type == 'shipping') - return shipping.length > 1 ? null : shipping.at(-1) + return this.order.shipping_address }, billing() { - if(!this.order?.sales_order_addresses) { - return null; - } - - let billing = this.order.sales_order_addresses.filter(e => e.address_type == 'billing') - return billing.at(-1) + return this.order.billing_address }, pickup() { - if(!this.order?.sales_order_addresses) { - return null; - } - - let shipping = this.order.sales_order_addresses.filter(e => e.address_type == 'shipping') - return shipping.length > 1 ? shipping[0] : null + return this.shipping } } } diff --git a/resources/js/package.js b/resources/js/package.js index 5d61ae20..dc88cc91 100644 --- a/resources/js/package.js +++ b/resources/js/package.js @@ -1,15 +1,3 @@ Vue.component('checkout-address', () => import('./components/CheckoutAddress.vue')) Vue.component('checkout-success-addresses', () => import('./components/CheckoutSuccessAddresses.vue')) -Vue.component('address-card', () => import('./components/AddressCard.vue')) - -Vue.mixin({ - computed: { - billingAndShippingAreTheSame() { - if (this.$root.checkout.shipping_address?.customer_address_id) { - this.$root.checkout.hide_billing = this.$root.checkout.shipping_address?.customer_address_id == this.$root.checkout.billing_address?.customer_address_id - } - - return this.$root.checkout.hide_billing - } - } -}) +Vue.component('address-card', () => import('./components/AddressCard.vue')) \ No newline at end of file diff --git a/resources/views/account/order.blade.php b/resources/views/account/order.blade.php index 44758972..ec75d012 100644 --- a/resources/views/account/order.blade.php +++ b/resources/views/account/order.blade.php @@ -20,8 +20,9 @@ -
+
@include('rapidez-ct::account.partials.order.products') @include('rapidez-ct::account.partials.order.order-info') @@ -31,7 +32,7 @@ @lang('Back to my orders') - @lang('Order date'): @{{ (new Date(data.customer.orders.items[0].order_date)).toLocaleDateString() }} + @lang('Order date'): @{{ (new Date(order.order_date)).toLocaleDateString() }}
diff --git a/resources/views/account/partials/address-cards.blade.php b/resources/views/account/partials/address-cards.blade.php index ab2d70c2..4d17f1a3 100644 --- a/resources/views/account/partials/address-cards.blade.php +++ b/resources/views/account/partials/address-cards.blade.php @@ -1,7 +1,7 @@ @lang('My addresses') -
+
-
+
@lang('Add a new address') diff --git a/resources/views/account/partials/login.blade.php b/resources/views/account/partials/login.blade.php index 94d3dd46..b6353eda 100644 --- a/resources/views/account/partials/login.blade.php +++ b/resources/views/account/partials/login.blade.php @@ -1,19 +1,17 @@ - + -
+
diff --git a/resources/views/account/partials/order/order-info.blade.php b/resources/views/account/partials/order/order-info.blade.php index 1d9ed1f2..e25b6b12 100644 --- a/resources/views/account/partials/order/order-info.blade.php +++ b/resources/views/account/partials/order/order-info.blade.php @@ -1,9 +1,9 @@
-