@shopbite-de/storefront 1.31.2 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/.github/workflows/ci.yaml +54 -0
  2. package/.nuxtrc +1 -1
  3. package/CLAUDE.md +23 -8
  4. package/app/app.vue +10 -6
  5. package/app/assets/css/main.css +100 -61
  6. package/app/components/AddToWishlist.vue +15 -25
  7. package/app/components/Address/Card.vue +6 -11
  8. package/app/components/Address/Detail.vue +23 -23
  9. package/app/components/Address/Fields.vue +175 -73
  10. package/app/components/Address/Form.vue +107 -106
  11. package/app/components/Cart/Bar.vue +6 -9
  12. package/app/components/Cart/Item.vue +48 -63
  13. package/app/components/Cart/QuickView.vue +38 -25
  14. package/app/components/Cart/Upsell.vue +24 -62
  15. package/app/components/Category/Breadcrumb.vue +29 -3
  16. package/app/components/Category/FilterGroup.vue +20 -41
  17. package/app/components/Category/Listing.vue +100 -130
  18. package/app/components/Category/SearchInput.vue +22 -19
  19. package/app/components/Checkout/DeliveryTimeSelect.vue +55 -77
  20. package/app/components/Checkout/LoginOrRegister.vue +28 -29
  21. package/app/components/Checkout/PaymentAndDelivery.vue +114 -86
  22. package/app/components/Checkout/Summary.vue +90 -60
  23. package/app/components/Checkout/VoucherInput.vue +40 -27
  24. package/app/components/Contact/Form.vue +164 -192
  25. package/app/components/DemoBanner.vue +5 -5
  26. package/app/components/Footer/StoreStatus.vue +2 -2
  27. package/app/components/Footer.vue +125 -57
  28. package/app/components/Header.vue +283 -18
  29. package/app/components/Home/Categories.vue +116 -0
  30. package/app/components/Home/Facts.vue +71 -0
  31. package/app/components/Home/Faq.vue +34 -16
  32. package/app/components/Home/Hero.vue +172 -0
  33. package/app/components/Home/Highlights.vue +29 -37
  34. package/app/components/Home/Restaurant.vue +102 -0
  35. package/app/components/Menu/BonCard.vue +180 -0
  36. package/app/components/Menu/CartPanel.vue +24 -0
  37. package/app/components/Menu/CategoryIndex.vue +54 -0
  38. package/app/components/Menu/OrderMode.vue +20 -0
  39. package/app/components/Menu/SectionHeader.vue +38 -0
  40. package/app/components/Navigation/MobileTop.vue +23 -15
  41. package/app/components/Order/Confirmation.vue +119 -0
  42. package/app/components/Order/Detail.vue +80 -88
  43. package/app/components/Product/CardSkeleton.vue +8 -12
  44. package/app/components/Product/Configurator.vue +8 -16
  45. package/app/components/Product/CrossSelling.vue +75 -83
  46. package/app/components/Product/DeselectIngredient.vue +17 -22
  47. package/app/components/Product/Detail.vue +35 -27
  48. package/app/components/Product/QuickView.vue +80 -51
  49. package/app/components/SalesChannelSwitch.vue +14 -28
  50. package/app/components/Sb/Button.vue +70 -0
  51. package/app/components/Sb/Checkbox.vue +73 -0
  52. package/app/components/Sb/Chip.vue +51 -0
  53. package/app/components/Sb/ChoiceGroup.vue +82 -0
  54. package/app/components/Sb/ConfirmDialog.vue +60 -0
  55. package/app/components/Sb/Field.vue +77 -0
  56. package/app/components/Sb/Icon.vue +66 -0
  57. package/app/components/Sb/IconButton.vue +55 -0
  58. package/app/components/Sb/Input.vue +23 -0
  59. package/app/components/Sb/SegmentedControl.vue +34 -0
  60. package/app/components/Sb/Select.vue +49 -0
  61. package/app/components/Sb/Sheet.vue +83 -0
  62. package/app/components/Sb/Stars.vue +60 -0
  63. package/app/components/Sb/StatusPill.vue +38 -0
  64. package/app/components/Sb/Stepper.vue +72 -0
  65. package/app/components/User/AccountHeader.vue +16 -0
  66. package/app/components/User/AuthPanel.vue +41 -0
  67. package/app/components/User/Detail.vue +32 -29
  68. package/app/components/User/LoginForm.vue +92 -98
  69. package/app/components/User/RegistrationForm.vue +285 -249
  70. package/app/components/Wishlist.vue +55 -155
  71. package/app/composables/useCartMutations.ts +9 -27
  72. package/app/composables/useCheckoutMethodGuard.ts +2 -24
  73. package/app/composables/useContactForm.ts +66 -0
  74. package/app/composables/useHomeMenuCategories.ts +41 -0
  75. package/app/composables/useNavigation.ts +10 -2
  76. package/app/composables/useOrderMode.ts +65 -0
  77. package/app/composables/useRegistrationForm.ts +161 -0
  78. package/app/composables/useRestaurantSchema.ts +1 -1
  79. package/app/composables/useShareLink.ts +3 -13
  80. package/app/composables/useSortingSelection.ts +13 -0
  81. package/app/composables/useThemePreset.ts +15 -0
  82. package/app/composables/useVoucherCode.ts +7 -16
  83. package/app/composables/useWishlistActions.ts +0 -51
  84. package/app/error.vue +31 -9
  85. package/app/layouts/account.vue +45 -50
  86. package/app/layouts/default.vue +2 -3
  87. package/app/layouts/listing.vue +3 -5
  88. package/app/pages/[...all].vue +8 -4
  89. package/app/pages/account/recover/password/index.vue +113 -80
  90. package/app/pages/anmelden.vue +11 -10
  91. package/app/pages/bestellung/[id]/erfolg.vue +1 -15
  92. package/app/pages/bestellung/[id]/fehler.vue +63 -51
  93. package/app/pages/bestellung/[id]/index.vue +3 -85
  94. package/app/pages/bestellung/kasse.vue +29 -0
  95. package/app/pages/bestellung.vue +8 -60
  96. package/app/pages/index.vue +12 -52
  97. package/app/pages/kontakt.vue +27 -7
  98. package/app/pages/konto/adressen.vue +106 -102
  99. package/app/pages/konto/bestellung/[id].vue +9 -43
  100. package/app/pages/konto/bestellungen.vue +55 -33
  101. package/app/pages/konto/index.vue +47 -62
  102. package/app/pages/konto/profil.vue +162 -100
  103. package/app/pages/maintenance.vue +8 -6
  104. package/app/pages/merkliste.vue +7 -8
  105. package/app/pages/passwort-vergessen.vue +92 -75
  106. package/app/pages/registrierung/bestaetigen.vue +20 -48
  107. package/app/pages/registrierung/index.vue +16 -7
  108. package/app/pages/suche.vue +94 -95
  109. package/app/plugins/theme-preset.ts +9 -0
  110. package/app/utils/highlight.ts +25 -0
  111. package/app/utils/product.ts +9 -0
  112. package/app/validation/registrationSchema.ts +1 -1
  113. package/docs/notes/2026-10-07-issue-434-property-group-projection.md +27 -0
  114. package/docs/notes/2026-10-07-listing-payload.md +38 -0
  115. package/docs/notes/2026-10-07-nuxt-4.6-inline-error-rendering.md +31 -0
  116. package/modules/theme.ts +115 -0
  117. package/nuxt.config.ts +27 -15
  118. package/package.json +6 -8
  119. package/playwright.config.ts +11 -0
  120. package/server/api/listing/[categoryId].get.ts +10 -11
  121. package/server/api/product/[productId].get.ts +4 -2
  122. package/server/api/product/variant.get.ts +1 -2
  123. package/server/api/search.get.ts +7 -12
  124. package/shared/theme/presets.ts +303 -0
  125. package/test/a11y/presets.test.ts +225 -0
  126. package/test/nuxt/AccountPagesPreset.test.ts +191 -0
  127. package/test/nuxt/AuthPagesPreset.test.ts +87 -0
  128. package/test/nuxt/CartCheckoutPreset.test.ts +154 -0
  129. package/test/nuxt/CartItem.test.ts +18 -3
  130. package/test/nuxt/CartUpsell.test.ts +1 -2
  131. package/test/nuxt/CheckoutFormsPreset.test.ts +120 -0
  132. package/test/nuxt/CheckoutOnePage.test.ts +115 -0
  133. package/test/nuxt/CheckoutSummary.test.ts +6 -6
  134. package/test/nuxt/CheckoutVoucherInput.test.ts +20 -32
  135. package/test/nuxt/ContactFormPreset.test.ts +115 -0
  136. package/test/nuxt/FooterStoreStatus.test.ts +2 -2
  137. package/test/nuxt/HeaderFooterPreset.test.ts +134 -0
  138. package/test/nuxt/HomeFaq.test.ts +3 -2
  139. package/test/nuxt/MenuBonCard.test.ts +122 -0
  140. package/test/nuxt/OrderPagesPreset.test.ts +132 -0
  141. package/test/nuxt/PaymentAndDelivery.test.ts +0 -4
  142. package/test/nuxt/ProductCrossSelling.test.ts +2 -1
  143. package/test/nuxt/ProductDeselectIngredient.test.ts +5 -3
  144. package/test/nuxt/ProductSheetPreset.test.ts +105 -0
  145. package/test/nuxt/RegisterConfirmPage.test.ts +0 -8
  146. package/test/nuxt/RegistrationForm.test.ts +89 -270
  147. package/test/nuxt/SbBaseComponents.test.ts +170 -0
  148. package/test/nuxt/SbStars.test.ts +25 -0
  149. package/test/nuxt/useCartMutations.test.ts +3 -17
  150. package/test/nuxt/useCartUpsell.test.ts +1 -1
  151. package/test/nuxt/useCheckoutMethodGuard.test.ts +0 -27
  152. package/test/nuxt/useShareLink.test.ts +1 -9
  153. package/test/nuxt/useWishlistActions.test.ts +3 -26
  154. package/test/unit/highlight.spec.ts +31 -0
  155. package/test/unit/product.spec.ts +12 -0
  156. package/test/unit/themePresets.spec.ts +61 -0
  157. package/app/app.config.ts +0 -19
  158. package/app/components/AnimatedSection.vue +0 -74
  159. package/app/components/BottomNavi.vue +0 -70
  160. package/app/components/Category/Header.vue +0 -48
  161. package/app/components/Checkout/PaymentMethod.vue +0 -30
  162. package/app/components/Checkout/ShippingMethod.vue +0 -30
  163. package/app/components/Cta.vue +0 -30
  164. package/app/components/Feature/Card.vue +0 -121
  165. package/app/components/Features.vue +0 -42
  166. package/app/components/Footer/Contact.vue +0 -82
  167. package/app/components/Header/Body.vue +0 -82
  168. package/app/components/Header/Right.vue +0 -187
  169. package/app/components/Header/Title.vue +0 -10
  170. package/app/components/Hero.vue +0 -233
  171. package/app/components/Home/MenuCategories.vue +0 -148
  172. package/app/components/ImageGallery.vue +0 -63
  173. package/app/components/Loading.vue +0 -29
  174. package/app/components/Navigation/DesktopLeft.vue +0 -39
  175. package/app/components/Product/Card.vue +0 -177
  176. package/app/components/Product/CardCompact.vue +0 -72
  177. package/app/components/Product/CardDietBadges.vue +0 -43
  178. package/app/components/Product/CardIngredients.vue +0 -35
  179. package/app/components/Product/CardKitchen.vue +0 -34
  180. package/app/components/Product/Category.vue +0 -160
  181. package/app/components/Product/SearchBar.vue +0 -95
  182. package/app/components/PublicAnnouncement.vue +0 -17
  183. package/app/pages/bestellung/bestaetigen.vue +0 -16
  184. package/app/pages/bestellung/warenkorb.vue +0 -49
  185. package/app/pages/bestellung/zahlung-versand.vue +0 -25
  186. package/test/nuxt/AddressFields.test.ts +0 -222
  187. package/test/nuxt/AnimatedSection.test.ts +0 -67
  188. package/test/nuxt/ContactForm.test.ts +0 -207
  189. package/test/nuxt/FooterContact.test.ts +0 -102
  190. package/test/nuxt/HeaderRight.test.ts +0 -142
  191. package/test/nuxt/Hero.test.ts +0 -126
  192. package/test/nuxt/HomeMenuCategories.test.ts +0 -94
  193. package/test/nuxt/LoginForm.test.ts +0 -159
@@ -1,6 +1,5 @@
1
1
  <script setup lang="ts">
2
2
  import * as z from "zod";
3
- import type { FormSubmitEvent } from "@nuxt/ui";
4
3
 
5
4
  useHead({
6
5
  title: "Passwort zurücksetzen",
@@ -12,26 +11,11 @@ useHead({
12
11
 
13
12
  // Constants
14
13
  const MIN_PASSWORD_LENGTH = 8;
15
- const PASSWORD_MIN_LENGTH_ERROR = "Mindestens 8 Zeichen";
16
- const PASSWORD_MISMATCH_ERROR = "Passwörter stimmen nicht überein";
17
- const SUCCESS_TOAST_CONFIG = {
18
- title: "Erfolgreich zurückgesetzt!",
19
- description: "Melden Sie sich nun mit Ihrem neuen Passwort an.",
20
- icon: "i-lucide-check",
21
- color: "success" as const,
22
- duration: 0,
23
- close: true,
24
- };
25
- const ERROR_TOAST_CONFIG = {
26
- title: "Fehler beim Senden",
27
- icon: "i-lucide-x",
28
- description: "Bitte versuchen Sie es später erneut.",
29
- color: "error" as const,
30
- };
14
+ const PASSWORD_MIN_LENGTH_ERROR = "Das Passwort braucht mindestens 8 Zeichen.";
15
+ const PASSWORD_MISMATCH_ERROR = "Die Passwörter stimmen nicht überein.";
31
16
 
32
17
  const { apiClient } = useShopwareContext();
33
18
  const route = useRoute();
34
- const toast = useToast();
35
19
 
36
20
  // Schemas
37
21
  const routeValidationSchema = z.object({
@@ -66,79 +50,128 @@ function validateRouteParameters(): string {
66
50
  }
67
51
  }
68
52
 
69
- // Extract toast creation functions
70
- function showSuccessToast(): void {
71
- toast.add(SUCCESS_TOAST_CONFIG);
72
- }
73
-
74
- function showErrorToast(): void {
75
- toast.add(ERROR_TOAST_CONFIG);
76
- }
77
-
78
53
  const recoveryHash = ref<string>("");
79
54
  recoveryHash.value = validateRouteParameters();
80
55
 
81
- const formFields = [
82
- {
83
- name: "newPassword",
84
- type: "password" as const,
85
- label: "Neues Passwort",
86
- placeholder: "Neues Passwort eingeben",
87
- required: true,
88
- },
89
- {
90
- name: "newPasswordConfirm",
91
- type: "password" as const,
92
- label: "Neues Passwort wiederholen",
93
- placeholder: "Neues Passwort wiederholen",
94
- required: true,
95
- },
96
- ];
56
+ async function resetPassword(data: PasswordResetSchema) {
57
+ await apiClient.invoke(
58
+ "recoveryPassword post /account/recovery-password-confirm",
59
+ {
60
+ body: {
61
+ newPassword: data.newPassword,
62
+ newPasswordConfirm: data.newPasswordConfirm,
63
+ hash: recoveryHash.value,
64
+ },
65
+ },
66
+ );
67
+ }
97
68
 
98
- async function handlePasswordReset(
99
- payload: FormSubmitEvent<PasswordResetSchema>,
100
- ) {
69
+ // Errors and the result show in the form (#445).
70
+ const passwords = reactive({ newPassword: "", newPasswordConfirm: "" });
71
+ const errors = ref<Partial<Record<keyof PasswordResetSchema, string>>>({});
72
+ const result = ref<"done" | "failed" | null>(null);
73
+ const saving = ref(false);
74
+ const resultBox = ref<HTMLElement | null>(null);
75
+
76
+ async function onSubmit() {
77
+ result.value = null;
78
+ const parsed = passwordResetSchema.safeParse(passwords);
79
+ if (!parsed.success) {
80
+ const next: typeof errors.value = {};
81
+ for (const issue of parsed.error.issues) {
82
+ const key = issue.path[0] as keyof PasswordResetSchema;
83
+ next[key] ??= issue.message;
84
+ }
85
+ errors.value = next;
86
+ return;
87
+ }
88
+ errors.value = {};
89
+ saving.value = true;
101
90
  try {
102
- await apiClient.invoke(
103
- "recoveryPassword post /account/recovery-password-confirm",
104
- {
105
- body: {
106
- newPassword: payload.data.newPassword,
107
- newPasswordConfirm: payload.data.newPasswordConfirm,
108
- hash: recoveryHash.value,
109
- },
110
- },
111
- );
112
- showSuccessToast();
113
- navigateTo("/anmelden");
91
+ await resetPassword(parsed.data);
92
+ result.value = "done";
114
93
  } catch (error) {
115
- showErrorToast();
116
94
  console.error("Password recovery error:", error);
95
+ result.value = "failed";
96
+ } finally {
97
+ saving.value = false;
117
98
  }
99
+ await nextTick();
100
+ resultBox.value?.focus();
118
101
  }
119
102
  </script>
120
103
  <template>
121
- <UContainer class="max-w-xl mx-auto mt-18">
122
- <UAuthForm
123
- :schema="passwordResetSchema"
124
- title="Password zurücksetzten"
125
- icon="i-lucide-shield-user"
126
- :fields="formFields"
127
- :submit="{
128
- label: 'Senden',
129
- }"
130
- @submit="handlePasswordReset"
104
+ <UserAuthPanel title="Neues Passwort">
105
+ <div
106
+ v-if="result === 'done'"
107
+ ref="resultBox"
108
+ role="status"
109
+ tabindex="-1"
110
+ class="flex flex-col items-start gap-4"
131
111
  >
132
- <template #description>
133
- <p>Vergeben Sie hier Ihr neues Passwort.</p>
134
- </template>
135
- <template #footer>
136
- Beim absenden stimmst du unseren
137
- <ULink to="datenschutz" class="text-primary font-medium"
138
- >Datenschutzbestimmungen</ULink
112
+ <p>
113
+ <strong class="block">Ihr Passwort ist geändert.</strong>
114
+ Sie können sich jetzt mit dem neuen Passwort anmelden.
115
+ </p>
116
+ <SbButton to="/anmelden">Zur Anmeldung</SbButton>
117
+ </div>
118
+ <form
119
+ v-else
120
+ novalidate
121
+ class="flex flex-col gap-4"
122
+ @submit.prevent="onSubmit"
123
+ >
124
+ <div
125
+ v-if="result === 'failed'"
126
+ ref="resultBox"
127
+ role="alert"
128
+ tabindex="-1"
129
+ class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
130
+ >
131
+ <strong class="block"
132
+ >Das Passwort konnte nicht geändert werden.</strong
133
+ >
134
+ Der Link ist vielleicht abgelaufen.
135
+ <NuxtLink
136
+ to="/passwort-vergessen"
137
+ class="font-semibold text-sb-primary-ink underline underline-offset-4"
138
+ >Neuen Link anfordern</NuxtLink
139
139
  >
140
- zu.
141
- </template>
142
- </UAuthForm>
143
- </UContainer>
140
+ </div>
141
+ <SbField
142
+ v-slot="{ id, describedBy, invalid }"
143
+ label="Neues Passwort"
144
+ hint="Mindestens 8 Zeichen"
145
+ :error="errors.newPassword"
146
+ >
147
+ <SbInput
148
+ :id="id"
149
+ v-model="passwords.newPassword"
150
+ name="newPassword"
151
+ type="password"
152
+ autocomplete="new-password"
153
+ :aria-describedby="describedBy"
154
+ :invalid="invalid"
155
+ />
156
+ </SbField>
157
+ <SbField
158
+ v-slot="{ id, describedBy, invalid }"
159
+ label="Neues Passwort wiederholen"
160
+ :error="errors.newPasswordConfirm"
161
+ >
162
+ <SbInput
163
+ :id="id"
164
+ v-model="passwords.newPasswordConfirm"
165
+ name="newPasswordConfirm"
166
+ type="password"
167
+ autocomplete="new-password"
168
+ :aria-describedby="describedBy"
169
+ :invalid="invalid"
170
+ />
171
+ </SbField>
172
+ <SbButton type="submit" size="lg" block :loading="saving"
173
+ >Passwort speichern</SbButton
174
+ >
175
+ </form>
176
+ </UserAuthPanel>
144
177
  </template>
@@ -27,14 +27,15 @@ function handleLoginSuccess() {
27
27
  </script>
28
28
 
29
29
  <template>
30
- <UContainer>
31
- <div class="max-w-xl mx-auto mt-16">
32
- <UserLoginForm
33
- title="Anmelden"
34
- icon="i-lucide-user"
35
- with-register-hint
36
- @login-success="handleLoginSuccess"
37
- />
38
- </div>
39
- </UContainer>
30
+ <UserAuthPanel title="Anmelden">
31
+ <UserLoginForm @login-success="handleLoginSuccess" />
32
+ <template #footer>
33
+ Noch kein Kundenkonto?
34
+ <NuxtLink
35
+ to="/registrierung"
36
+ class="font-semibold text-sb-primary-ink underline underline-offset-4"
37
+ >Jetzt registrieren</NuxtLink
38
+ >
39
+ </template>
40
+ </UserAuthPanel>
40
41
  </template>
@@ -12,22 +12,8 @@ const { refreshCart } = useCart();
12
12
  onMounted(async () => {
13
13
  await refreshCart();
14
14
  });
15
-
16
- const links = [
17
- {
18
- label: "Zur Bestellung",
19
- to: `/bestellung/${orderId}`,
20
- icon: "i-lucide-receipt",
21
- size: "xl" as const,
22
- },
23
- ];
24
15
  </script>
25
16
 
26
17
  <template>
27
- <UPageSection
28
- icon="i-lucide-circle-check"
29
- title="Bestellung erfolgreich erstellt!"
30
- description="Wir bereiten deine Bestellung jetzt vor."
31
- :links="links"
32
- />
18
+ <OrderConfirmation :order-id="orderId" kind="success" />
33
19
  </template>
@@ -49,8 +49,11 @@ const selectablePaymentMethods = computed(() =>
49
49
 
50
50
  const isRetrying = ref(false);
51
51
 
52
+ const retryError = ref(false);
53
+
52
54
  async function retryPayment() {
53
55
  isRetrying.value = true;
56
+ retryError.value = false;
54
57
  try {
55
58
  if (selectedPaymentMethodId.value !== currentPaymentMethodId.value) {
56
59
  await changePaymentMethod(selectedPaymentMethodId.value);
@@ -66,6 +69,9 @@ async function retryPayment() {
66
69
  } else {
67
70
  await navigateTo(`/bestellung/${orderId}/erfolg`);
68
71
  }
72
+ } catch (error) {
73
+ console.error("[order][retryPayment]", error);
74
+ retryError.value = true;
69
75
  } finally {
70
76
  isRetrying.value = false;
71
77
  }
@@ -73,56 +79,62 @@ async function retryPayment() {
73
79
  </script>
74
80
 
75
81
  <template>
76
- <UPageSection>
77
- <div class="flex flex-col gap-8">
78
- <UPageHero
79
- icon="i-lucide-circle-x"
80
- title="Zahlung fehlgeschlagen"
81
- description="Bei der Verarbeitung deiner Zahlung ist ein Fehler aufgetreten. Wähle eine Zahlungsmethode und versuche es erneut."
82
- />
83
-
84
- <USeparator />
85
-
86
- <div v-if="order" class="grid grid-cols-1 md:grid-cols-2 gap-8">
87
- <div class="flex flex-col gap-4">
88
- <p class="text-sm font-semibold text-muted uppercase tracking-wide">
89
- Bestellung {{ order.orderNumber }}
90
- </p>
91
- <UCard>
92
- <OrderDetail :order="order" :status="status ?? ''" />
93
- </UCard>
94
- </div>
95
-
96
- <div class="flex flex-col gap-6">
97
- <div class="flex flex-col gap-3">
98
- <p class="text-sm font-semibold text-muted uppercase tracking-wide">
99
- Zahlungsmethode
100
- </p>
101
- <URadioGroup
102
- v-model="selectedPaymentMethodId"
103
- :items="selectablePaymentMethods"
104
- variant="card"
105
- />
106
- </div>
107
-
108
- <UButton
109
- label="Jetzt bezahlen"
110
- icon="i-lucide-refresh-cw"
111
- size="xl"
112
- block
113
- :loading="isRetrying"
114
- :disabled="!selectedPaymentMethodId"
115
- @click="retryPayment"
116
- />
117
- </div>
118
- </div>
119
-
120
- <div v-else class="flex justify-center py-16">
121
- <UIcon
122
- name="i-lucide-loader-circle"
123
- class="size-10 animate-spin text-primary"
82
+ <div
83
+ class="mx-auto flex w-full max-w-2xl flex-col gap-6 font-body text-sb-ink"
84
+ >
85
+ <header class="flex flex-col gap-3">
86
+ <h1 class="font-display text-4xl leading-tight sm:text-5xl">
87
+ Zahlung fehlgeschlagen
88
+ </h1>
89
+ <p class="text-lg">
90
+ Ihre Bestellung ist gespeichert, aber die Zahlung hat nicht geklappt.
91
+ Wählen Sie eine Zahlungsart und versuchen Sie es noch einmal.
92
+ </p>
93
+ </header>
94
+ <p v-if="!order" role="status" class="text-sb-ink-muted">
95
+ Bestellung wird geladen …
96
+ </p>
97
+ <template v-else>
98
+ <section
99
+ aria-labelledby="zahlung-wiederholen"
100
+ class="flex flex-col gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
101
+ >
102
+ <h2 id="zahlung-wiederholen" class="font-display text-2xl">
103
+ Zahlungsart
104
+ </h2>
105
+ <SbChoiceGroup
106
+ v-model="selectedPaymentMethodId"
107
+ legend="Zahlungsart"
108
+ hide-legend
109
+ variant="cards"
110
+ :options="selectablePaymentMethods ?? []"
124
111
  />
125
- </div>
126
- </div>
127
- </UPageSection>
112
+ <p
113
+ v-if="retryError"
114
+ role="alert"
115
+ class="rounded-sb-control border-[1.5px] border-sb-danger p-4 text-sm"
116
+ >
117
+ Die Zahlung konnte nicht gestartet werden. Bitte versuchen Sie es noch
118
+ einmal oder rufen Sie uns an.
119
+ </p>
120
+ <SbButton
121
+ block
122
+ size="lg"
123
+ :loading="isRetrying"
124
+ :disabled="!selectedPaymentMethodId || isRetrying"
125
+ @click="retryPayment"
126
+ >Jetzt bezahlen</SbButton
127
+ >
128
+ </section>
129
+ <section
130
+ aria-labelledby="bestellung-details"
131
+ class="rounded-sb-card border border-sb-line bg-sb-surface p-6"
132
+ >
133
+ <h2 id="bestellung-details" class="mb-4 font-display text-2xl">
134
+ Bestellung <span class="tabular-nums">{{ order.orderNumber }}</span>
135
+ </h2>
136
+ <OrderDetail :order="order" :status="status ?? undefined" />
137
+ </section>
138
+ </template>
139
+ </div>
128
140
  </template>
@@ -1,95 +1,13 @@
1
1
  <script setup lang="ts">
2
- import { useOrderDetails } from "@shopware/composables";
3
- import { formatDate } from "~/utils/formatDate";
4
-
5
- import type { RouteParams } from "vue-router";
6
- import type { ButtonProps } from "#ui/components/Button.vue";
7
-
8
- interface OrderRouteParams extends RouteParams {
9
- id: string;
10
- }
11
-
12
2
  useSeoMeta({
13
3
  title: "Bestellung",
4
+ robots: "noindex, nofollow",
14
5
  });
15
6
 
16
7
  const route = useRoute();
17
- const { id } = route.params as OrderRouteParams;
18
- const { order, loadOrderDetails, status } = useOrderDetails(id);
19
- // Shop phone number for the "call us" card; hidden without one (#251).
20
- const { site } = useRuntimeConfig().public;
21
-
22
- const isLoadingData = ref(true);
23
-
24
- onMounted(async () => {
25
- isLoadingData.value = true;
26
-
27
- await loadOrderDetails();
28
-
29
- isLoadingData.value = false;
30
- });
31
- const links = ref<ButtonProps[]>([
32
- {
33
- label: "Zurück zur Startseite",
34
- to: "/",
35
- color: "error",
36
- variant: "subtle",
37
- },
38
- ]);
8
+ const orderId = route.params.id as string;
39
9
  </script>
40
10
 
41
11
  <template>
42
- <UContainer v-if="isLoadingData">
43
- <!-- Show loading spinner while fetching order data -->
44
- <UPageHeader headline="BESTELLUNG" title="Lädt..." />
45
- <UPageBody>
46
- <div class="flex flex-col items-center justify-center py-16 gap-4">
47
- <UIcon
48
- name="i-lucide-loader-circle"
49
- class="w-12 h-12 animate-spin text-primary"
50
- />
51
- <p class="text-lg text-muted">Bestellung wird geladen...</p>
52
- </div>
53
- </UPageBody>
54
- </UContainer>
55
-
56
- <UContainer v-else-if="order">
57
- <UPageHeader
58
- headline="BESTELLUNG"
59
- :title="order?.orderNumber"
60
- :description="order.createdAt ? formatDate(order?.createdAt) : ''"
61
- />
62
- <UPageBody>
63
- <OrderDetail :order="order" :status="status ?? 'laden...'" />
64
- <UCard v-if="site.telephone" class="mt-6">
65
- <div
66
- class="flex flex-col sm:flex-row items-start sm:items-center gap-4"
67
- >
68
- <div class="flex-1">
69
- <p class="font-semibold">Stimmt etwas nicht?</p>
70
- <p class="text-sm text-muted mt-0.5">
71
- Ruf uns sofort an, damit wir deine Bestellung noch rechtzeitig
72
- korrigieren können.
73
- </p>
74
- </div>
75
- <UButton
76
- :label="`Jetzt anrufen: ${site.telephone}`"
77
- color="primary"
78
- :to="toTelHref(site.telephone)"
79
- icon="i-lucide-phone"
80
- shrink-0
81
- />
82
- </div>
83
- </UCard>
84
- </UPageBody>
85
- </UContainer>
86
-
87
- <UContainer v-else>
88
- <UPageSection
89
- headline="FEHLER"
90
- title="Irgendwas ist schief gelaufen"
91
- description="Sie können Speisen und Getränke abholen, liefern lassen, oder vor Ort in unserem Restaurant genießen."
92
- :links="links"
93
- />
94
- </UContainer>
12
+ <OrderConfirmation :order-id="orderId" />
95
13
  </template>
@@ -0,0 +1,29 @@
1
+ <script setup lang="ts">
2
+ // One-page checkout (#443): delivery or pickup, time, customer data,
3
+ // payment and the order on one page.
4
+ useSeoMeta({
5
+ title: "Kasse",
6
+ robots: "noindex, nofollow",
7
+ });
8
+
9
+ const { isEmpty } = useCart();
10
+ </script>
11
+
12
+ <template>
13
+ <div class="flex flex-col gap-6 py-2 font-body text-sb-ink sm:gap-8">
14
+ <h1 class="font-display text-4xl leading-none sm:text-5xl">Kasse</h1>
15
+ <ClientOnly>
16
+ <div
17
+ v-if="isEmpty"
18
+ class="flex flex-col items-start gap-4 rounded-sb-card border border-sb-line bg-sb-surface p-6"
19
+ >
20
+ <p>Ihr Warenkorb ist noch leer.</p>
21
+ <SbButton to="/speisekarte/">Zur Speisekarte</SbButton>
22
+ </div>
23
+ <CheckoutSummary v-else />
24
+ <template #fallback>
25
+ <div class="h-96" aria-busy="true" aria-label="Kasse wird geladen" />
26
+ </template>
27
+ </ClientOnly>
28
+ </div>
29
+ </template>
@@ -1,65 +1,13 @@
1
1
  <script setup lang="ts">
2
- import type { StepperItem } from "@nuxt/ui";
3
-
4
- const stepRoutes = [
5
- "/bestellung/warenkorb",
6
- "/bestellung/zahlung-versand",
7
- "/bestellung/bestaetigen",
8
- ] as const;
9
-
10
- const route = useRoute();
11
- const isPaymentReturnRoute = computed(() =>
12
- /^\/bestellung\/[0-9a-f]{32}(\/erfolg|\/fehler)?$/.test(route.path),
13
- );
14
-
15
- // The active step follows the route, so the server renders the same step the
16
- // browser hydrates. Setting it from the child pages ran after the stepper had
17
- // been rendered on the server (#339).
18
- const step = computed<number>({
19
- get: () =>
20
- Math.max(
21
- 0,
22
- stepRoutes.findIndex((path) => path === route.path),
23
- ),
24
- set: (index) => {
25
- const path = stepRoutes[index];
26
- if (path && path !== route.path) {
27
- navigateTo(path);
28
- }
29
- },
30
- });
31
-
32
- const items = computed(
33
- () =>
34
- [
35
- {
36
- title: "Warenkorb",
37
- icon: "i-lucide-shopping-cart",
38
- disabled: false,
39
- },
40
- {
41
- title: "Zahlung & Versand",
42
- icon: "i-lucide-truck",
43
- disabled: step.value < 1,
44
- },
45
- {
46
- title: "Prüfen & Bestellen",
47
- icon: "i-lucide-check",
48
- disabled: step.value < 2,
49
- },
50
- ] satisfies StepperItem[],
51
- );
2
+ // Frame of the order pages: the one-page checkout (/bestellung/kasse, #443)
3
+ // and the order and payment result pages. The old step routes redirect to
4
+ // the checkout (routeRules in nuxt.config.ts).
52
5
  </script>
53
6
 
54
7
  <template>
55
- <UPageSection>
56
- <template v-if="isPaymentReturnRoute">
57
- <NuxtPage />
58
- </template>
59
- <UStepper v-else ref="stepper" v-model="step" :items="items" size="lg">
60
- <template #content>
61
- <NuxtPage />
62
- </template>
63
- </UStepper>
64
- </UPageSection>
8
+ <div
9
+ class="mx-auto w-full max-w-(--sb-container) px-4 pt-8 pb-16 sm:px-6 sm:pt-12 lg:px-8"
10
+ >
11
+ <NuxtPage />
12
+ </div>
65
13
  </template>