diff --git a/app/Http/Controllers/Checkout/CheckoutController.php b/app/Http/Controllers/Checkout/CheckoutController.php index af227e9..ee058be 100644 --- a/app/Http/Controllers/Checkout/CheckoutController.php +++ b/app/Http/Controllers/Checkout/CheckoutController.php @@ -62,7 +62,13 @@ public function show(string $locale): View if ($cart?->shippingAddress) { $shippingOptions = $this->syncShipping($cart); - $cart->refresh(); + + // Cart's CachesProperties::refresh() explicitly nulls total/ + // subTotal/shippingTotal/etc. back to their defaults — every + // Lunar call site pairs it with recalculate() for exactly that + // reason. Bare refresh() here was leaving $cart->total null on + // reload, which fed a 0 amount straight into the Stripe Element. + $cart->refresh()->recalculate(); } return view('checkout::page', [ @@ -180,13 +186,22 @@ public function saveAddress(string $locale, Request $request): JsonResponse $this->checkout->setRecoveryConsent($request->boolean('recovery_consent')); $rateKeyAfter = $cart->shippingAddress?->only(['postcode', 'state', 'country_id']); + $rateChanged = $rateKeyAfter != $rateKeyBefore; - // Nothing rate-relevant moved — persist and acknowledge, no re-render. - if ($rateKeyAfter == $rateKeyBefore) { + // setShippingAddress() above always deletes and recreates the + // CartAddress row (Lunar's AddAddress action), which drops whatever + // shipping_option was previously selected — regardless of whether the + // rate-determining fields actually changed. So this always has to run + // to restore/re-validate it, even on a save that only touched e.g. the + // phone number. Only the fragment RE-RENDER is skippable when nothing + // rate-relevant moved — the re-select itself is not optional. + $options = $this->syncShipping($cart); + + if (! $rateChanged) { return $this->fragments($cart, null, $errors); } - return $this->fragments($cart, $this->syncShipping($cart), $errors); + return $this->fragments($cart, $options, $errors); } public function selectShippingOption(string $locale, Request $request): JsonResponse diff --git a/composer.lock b/composer.lock index 052d543..fe937f9 100644 --- a/composer.lock +++ b/composer.lock @@ -515,11 +515,11 @@ }, { "name": "boboko/core", - "version": "0.16.3", + "version": "0.17.0", "source": { "type": "git", "url": "https://code.radical-elements.com/boboko/core.git", - "reference": "8f4c1a22eace56f0e184b8a1e946252302d9baad" + "reference": "57fc28ca0680841fddc222be4a5a936b43247883" }, "require": { "laravel/framework": "^12.0", @@ -568,7 +568,7 @@ } }, "description": "Core module — authentication and shared panel behaviour", - "time": "2026-09-09T21:14:57+00:00" + "time": "2026-09-14T17:18:26+00:00" }, { "name": "brick/math", @@ -8802,16 +8802,16 @@ }, { "name": "spatie/laravel-medialibrary", - "version": "11.23.7", + "version": "11.23.8", "source": { "type": "git", "url": "https://github.com/spatie/laravel-medialibrary.git", - "reference": "94b11766ea5e10b1e2a88159b24937eae89a5d5f" + "reference": "32bd3926b1065c4dc154789b9c6b17567acaaa15" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/94b11766ea5e10b1e2a88159b24937eae89a5d5f", - "reference": "94b11766ea5e10b1e2a88159b24937eae89a5d5f", + "url": "https://api.github.com/repos/spatie/laravel-medialibrary/zipball/32bd3926b1065c4dc154789b9c6b17567acaaa15", + "reference": "32bd3926b1065c4dc154789b9c6b17567acaaa15", "shasum": "" }, "require": { @@ -8896,7 +8896,7 @@ ], "support": { "issues": "https://github.com/spatie/laravel-medialibrary/issues", - "source": "https://github.com/spatie/laravel-medialibrary/tree/11.23.7" + "source": "https://github.com/spatie/laravel-medialibrary/tree/11.23.8" }, "funding": [ { @@ -8908,7 +8908,7 @@ "type": "github" } ], - "time": "2026-09-03T13:52:57+00:00" + "time": "2026-09-14T11:54:24+00:00" }, { "name": "spatie/laravel-package-tools", diff --git a/resources/views/vendor/core/order/notifications/completed.blade.php b/resources/views/vendor/core/order/notifications/completed.blade.php new file mode 100644 index 0000000..d5df044 --- /dev/null +++ b/resources/views/vendor/core/order/notifications/completed.blade.php @@ -0,0 +1,3 @@ +
Hi,
+ +Your order {{ $reference }} is complete. Thanks for shopping with us!
diff --git a/resources/views/vendor/core/order/notifications/dispatched.blade.php b/resources/views/vendor/core/order/notifications/dispatched.blade.php new file mode 100644 index 0000000..b89cf17 --- /dev/null +++ b/resources/views/vendor/core/order/notifications/dispatched.blade.php @@ -0,0 +1,3 @@ +Hi,
+ +Your order {{ $reference }} is on its way.
diff --git a/resources/views/vendor/core/order/notifications/pickup-ready.blade.php b/resources/views/vendor/core/order/notifications/pickup-ready.blade.php new file mode 100644 index 0000000..0fefc06 --- /dev/null +++ b/resources/views/vendor/core/order/notifications/pickup-ready.blade.php @@ -0,0 +1,3 @@ +Hi,
+ +Your order {{ $reference }} is ready for pickup in store.
diff --git a/resources/views/vendor/core/order/notifications/placed.blade.php b/resources/views/vendor/core/order/notifications/placed.blade.php new file mode 100644 index 0000000..0e1b7aa --- /dev/null +++ b/resources/views/vendor/core/order/notifications/placed.blade.php @@ -0,0 +1,11 @@ +Hi,
+ +Thanks for your order! Your order {{ $reference }} is confirmed.
+ +Total: {{ $total }}