@revenexx/cover 0.2.25 → 0.2.26
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.
|
@@ -31,6 +31,13 @@ const { data: rates } = useFetch<{
|
|
|
31
31
|
methods: DeliveryOption[];
|
|
32
32
|
defaultMethod: string | null;
|
|
33
33
|
}>("/api/shipping/rates", {
|
|
34
|
+
// STABLE KEY, deliberately. Without one Nuxt derives it from the request —
|
|
35
|
+
// body included — and the body carries the cart total, which is 0 while the
|
|
36
|
+
// server renders and the real sum once the store has hydrated. Two different
|
|
37
|
+
// keys, so the client looked up a payload entry that did not exist, found
|
|
38
|
+
// nothing, and never refetched either: on a hard page load the section fell
|
|
39
|
+
// back to the demo profile and offered methods this merchant does not have.
|
|
40
|
+
key: "checkout-shipping-rates",
|
|
34
41
|
method: "POST",
|
|
35
42
|
body: computed(() => ({
|
|
36
43
|
amount: cartStore.subtotal,
|
|
@@ -40,8 +47,19 @@ const { data: rates } = useFetch<{
|
|
|
40
47
|
default: () => null,
|
|
41
48
|
});
|
|
42
49
|
|
|
50
|
+
/**
|
|
51
|
+
* The demo profile is a MOCK-MODE fallback and must never surface on a live
|
|
52
|
+
* storefront. When the live list is missing — the request failed, or it raced
|
|
53
|
+
* a cart that was still syncing on a hard page load — falling through to it
|
|
54
|
+
* offered methods this merchant does not have: "Express 9,90 €" on a shop that
|
|
55
|
+
* ships by quote, "Bestellschein" and "Kostenstelle" on a tenant that only
|
|
56
|
+
* knows invoice and its PSP. An empty list is honest; sample data is not.
|
|
57
|
+
*/
|
|
58
|
+
const liveShipping = computed(() => appConfig.shippingService === "api");
|
|
43
59
|
const deliveryOptions = computed<DeliveryOption[]>(() =>
|
|
44
|
-
rates.value?.methods
|
|
60
|
+
rates.value?.methods
|
|
61
|
+
?? (liveShipping.value ? [] : profile.value?.availableDeliveryMethods)
|
|
62
|
+
?? []);
|
|
45
63
|
|
|
46
64
|
// A method that became unavailable (country switch, free-above flip)
|
|
47
65
|
// resets the selection to the first available one.
|
|
@@ -124,6 +142,16 @@ watch(deliveryOptions, (options) => {
|
|
|
124
142
|
</p>
|
|
125
143
|
</button>
|
|
126
144
|
</div>
|
|
145
|
+
|
|
146
|
+
<!-- Nothing to choose from. Says so rather than leaving a blank box:
|
|
147
|
+
a live storefront no longer falls back to the demo profile, so an empty
|
|
148
|
+
list means the list could not be loaded. -->
|
|
149
|
+
<p
|
|
150
|
+
v-if="!profileLoading && !deliveryOptions.length"
|
|
151
|
+
class="text-sm text-muted"
|
|
152
|
+
>
|
|
153
|
+
{{ t('onepage.delivery.noneAvailable') }}
|
|
154
|
+
</p>
|
|
127
155
|
</fieldset>
|
|
128
156
|
|
|
129
157
|
<!-- Requested date + delivery note side by side -->
|
|
@@ -21,6 +21,13 @@ const { data: eligible } = useFetch<{
|
|
|
21
21
|
methods: PaymentOption[];
|
|
22
22
|
defaultMethod: string | null;
|
|
23
23
|
}>("/api/payment/methods", {
|
|
24
|
+
// STABLE KEY, deliberately. Without one Nuxt derives it from the request —
|
|
25
|
+
// body included — and the body carries the cart total, which is 0 while the
|
|
26
|
+
// server renders and the real sum once the store has hydrated. Two different
|
|
27
|
+
// keys, so the client looked up a payload entry that did not exist, found
|
|
28
|
+
// nothing, and never refetched either: on a hard page load the section fell
|
|
29
|
+
// back to the demo profile and offered methods this merchant does not have.
|
|
30
|
+
key: "checkout-payment-methods",
|
|
24
31
|
method: "POST",
|
|
25
32
|
body: computed(() => ({
|
|
26
33
|
amount: cartStore.total,
|
|
@@ -30,8 +37,20 @@ const { data: eligible } = useFetch<{
|
|
|
30
37
|
default: () => null,
|
|
31
38
|
});
|
|
32
39
|
|
|
40
|
+
/**
|
|
41
|
+
* The demo profile is a MOCK-MODE fallback and must never surface on a live
|
|
42
|
+
* storefront. When the live list is missing — the request failed, or it raced
|
|
43
|
+
* a cart that was still syncing on a hard page load — falling through to it
|
|
44
|
+
* offered methods this merchant does not have: "Express 9,90 €" on a shop that
|
|
45
|
+
* ships by quote, "Bestellschein" and "Kostenstelle" on a tenant that only
|
|
46
|
+
* knows invoice and its PSP. An empty list is honest; sample data is not.
|
|
47
|
+
*/
|
|
48
|
+
const appConfig = useAppConfig();
|
|
49
|
+
const livePayments = computed(() => appConfig.paymentService === "api");
|
|
33
50
|
const paymentOptions = computed<PaymentOption[]>(() =>
|
|
34
|
-
eligible.value?.methods
|
|
51
|
+
eligible.value?.methods
|
|
52
|
+
?? (livePayments.value ? [] : profile.value?.availablePaymentMethods)
|
|
53
|
+
?? []);
|
|
35
54
|
|
|
36
55
|
// A method that became ineligible (country switch, order value) resets
|
|
37
56
|
// the selection to the first available one.
|
|
@@ -179,6 +198,16 @@ if (import.meta.client) {
|
|
|
179
198
|
>
|
|
180
199
|
{{ fieldErrors.paymentMethod }}
|
|
181
200
|
</p>
|
|
201
|
+
|
|
202
|
+
<!-- Nothing to choose from. Says so rather than leaving a blank box:
|
|
203
|
+
a live storefront no longer falls back to the demo profile, so an empty
|
|
204
|
+
list means the list could not be loaded. -->
|
|
205
|
+
<p
|
|
206
|
+
v-if="!profileLoading && !paymentOptions.length"
|
|
207
|
+
class="text-sm text-muted"
|
|
208
|
+
>
|
|
209
|
+
{{ t('onepage.payment.noneAvailable') }}
|
|
210
|
+
</p>
|
|
182
211
|
</fieldset>
|
|
183
212
|
|
|
184
213
|
<!-- Method-specific fields -->
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"businessDays": "Werktage",
|
|
115
115
|
"free": "Kostenlos",
|
|
116
116
|
"onRequest": "Auf Anfrage",
|
|
117
|
+
"noneAvailable": "Für diesen Warenkorb konnte keine Versandart ermittelt werden. Bitte kontaktieren Sie uns.",
|
|
117
118
|
"requestedDate": "Gewünschtes Lieferdatum",
|
|
118
119
|
"deliveryNote": "Lieferhinweis",
|
|
119
120
|
"deliveryNotePlaceholder": "Besondere Lieferanweisungen...",
|
|
@@ -124,6 +125,7 @@
|
|
|
124
125
|
},
|
|
125
126
|
"payment": {
|
|
126
127
|
"method": "Zahlungsmethode",
|
|
128
|
+
"noneAvailable": "Keine Zahlungsart verfügbar. Bitte kontaktieren Sie uns.",
|
|
127
129
|
"poNumber": "Bestellnummer",
|
|
128
130
|
"poNumberPlaceholder": "Bestellnummer eingeben...",
|
|
129
131
|
"costCenter": "Kostenstelle",
|
|
@@ -114,6 +114,7 @@
|
|
|
114
114
|
"businessDays": "business days",
|
|
115
115
|
"free": "Free",
|
|
116
116
|
"onRequest": "On request",
|
|
117
|
+
"noneAvailable": "No shipping method could be determined for this basket. Please contact us.",
|
|
117
118
|
"requestedDate": "Requested Delivery Date",
|
|
118
119
|
"deliveryNote": "Delivery Note",
|
|
119
120
|
"deliveryNotePlaceholder": "Special delivery instructions...",
|
|
@@ -124,6 +125,7 @@
|
|
|
124
125
|
},
|
|
125
126
|
"payment": {
|
|
126
127
|
"method": "Payment Method",
|
|
128
|
+
"noneAvailable": "No payment method available. Please contact us.",
|
|
127
129
|
"poNumber": "PO Number",
|
|
128
130
|
"poNumberPlaceholder": "Enter PO number...",
|
|
129
131
|
"costCenter": "Cost Center",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@revenexx/cover",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.26",
|
|
4
4
|
"description": "Cover \u2014 revenexx design system for Nuxt. Distributed as a Nuxt layer: generic UI components, theming tokens and stores shared by the demo shop, custom storefronts and the Blokkli theme.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./nuxt.config.ts",
|