@shopbite-de/storefront 1.24.0 → 1.25.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.
- package/.env.example +3 -0
- package/CLAUDE.md +9 -2
- package/app/app.config.ts +3 -2
- package/app/app.vue +4 -1
- package/app/assets/css/main.css +16 -0
- package/app/components/AddToWishlist.vue +13 -6
- package/app/components/Cart/Bar.vue +102 -0
- package/app/components/Cart/QuickView.vue +4 -0
- package/app/components/Cart/Upsell.vue +106 -0
- package/app/components/Category/Listing.vue +11 -3
- package/app/components/Checkout/Summary.vue +5 -1
- package/app/components/DemoBanner.vue +13 -0
- package/app/components/Feature/Card.vue +121 -0
- package/app/components/Features.vue +14 -9
- package/app/components/Footer/Contact.vue +5 -1
- package/app/components/Header/Right.vue +44 -15
- package/app/components/Hero.vue +126 -36
- package/app/components/Product/Card.vue +102 -50
- package/app/components/Product/CardCompact.vue +72 -0
- package/app/components/Product/CardDietBadges.vue +38 -31
- package/app/components/Product/CardIngredients.vue +35 -0
- package/app/components/Product/CardSkeleton.vue +10 -18
- package/app/components/Product/Category.vue +9 -2
- package/app/components/Product/Configurator.vue +11 -7
- package/app/components/Product/CrossSelling.vue +45 -34
- package/app/components/Product/DeselectIngredient.vue +37 -31
- package/app/components/Product/Detail.vue +73 -13
- package/app/components/Product/QuickView.vue +77 -0
- package/app/components/Topseller.vue +44 -34
- package/app/composables/useAddToCart.ts +3 -30
- package/app/composables/useCartQuickView.ts +19 -0
- package/app/composables/useCartUpsell.ts +100 -0
- package/app/composables/useCategorySeo.ts +5 -4
- package/app/composables/useProductCartQuantity.ts +15 -0
- package/app/composables/useProductCrossSelling.ts +1 -0
- package/app/composables/useProductDetail.ts +15 -1
- package/app/composables/useProductEvents.ts +30 -0
- package/app/composables/useProductQuickView.ts +65 -0
- package/app/composables/useTopSellers.ts +22 -0
- package/app/composables/useTrackEvent.ts +7 -0
- package/app/pages/index.vue +3 -1
- package/app/pages/suche.vue +18 -5
- package/app/types/Association.d.ts +1 -0
- package/app/utils/openingHours.ts +31 -8
- package/app/utils/product.ts +31 -0
- package/content/index.yml +16 -11
- package/content.config.ts +13 -0
- package/docs/notes/2026-09-12-issue-319-stylesheet-cost.md +154 -0
- package/docs/notes/2026-09-12-issue-325-product-card.md +100 -0
- package/docs/notes/2026-09-12-issue-327-home-hero.md +64 -0
- package/docs/notes/2026-09-13-demo-banner.md +32 -0
- package/docs/notes/2026-09-13-issue-332-home-info-cards.md +46 -0
- package/docs/notes/2026-09-13-quick-view-flicker.md +65 -0
- package/docs/notes/2026-09-14-cart-upsell.md +105 -0
- package/docs/notes/2026-09-14-demo-noindex.md +57 -0
- package/nuxt.config.ts +24 -0
- package/package.json +1 -1
- package/scripts/perf/first-render.mjs +30 -0
- package/scripts/perf/h2-proxy.cjs +49 -0
- package/scripts/perf/lighthouse.sh +22 -0
- package/scripts/perf/quick-view-layout.mjs +126 -0
- package/server/api/listing/[categoryId].get.ts +2 -0
- package/server/api/search.get.ts +2 -0
- package/test/e2e/simple-checkout-as-recurring-customer.test.ts +13 -17
- package/test/nuxt/CartBar.test.ts +110 -0
- package/test/nuxt/CartUpsell.test.ts +125 -0
- package/test/nuxt/DemoBanner.test.ts +12 -0
- package/test/nuxt/useAddToCart.test.ts +6 -19
- package/test/nuxt/useCartUpsell.test.ts +126 -0
- package/test/nuxt/useTrackEvent.test.ts +15 -0
- package/test/unit/openingHours.spec.ts +32 -1
- package/test/unit/product.spec.ts +72 -0
- package/test/unit/useCategorySeo.spec.ts +2 -1
- package/test/visual/playwright.config.ts +33 -0
- package/test/visual/visual.spec.ts +87 -0
- package/app/components/Product/CardDescription.vue +0 -27
- package/app/components/Product/CardFooter.vue +0 -61
package/.env.example
CHANGED
|
@@ -9,6 +9,9 @@ NUXT_PUBLIC_SHOPWARE_COUNTRY_ID=019a17a0f67b706a8ec9ead3059e12ba
|
|
|
9
9
|
|
|
10
10
|
NUXT_PUBLIC_SHOP_BITE_FEATURE_MULTI_CHANNEL=false
|
|
11
11
|
NUXT_PUBLIC_SHOP_BITE_FEATURE_SECURE_KEY=
|
|
12
|
+
NUXT_PUBLIC_SHOP_BITE_FEATURE_CONTACT_FORM=false
|
|
13
|
+
# Demo shops: notice above the header that orders are not fulfilled
|
|
14
|
+
NUXT_PUBLIC_SHOP_BITE_FEATURE_DEMO_BANNER=false
|
|
12
15
|
# Optional Geoapify bounding box lon1,lat1,lon2,lat2 for the address
|
|
13
16
|
# suggestions in the checkout (empty = no filter)
|
|
14
17
|
NUXT_PUBLIC_SHOP_BITE_ADDRESS_AUTOCOMPLETE_BOUNDING_BOX=
|
package/CLAUDE.md
CHANGED
|
@@ -94,8 +94,8 @@ The storefront reads plain Shopware entities with fixed names; seed data must ma
|
|
|
94
94
|
|
|
95
95
|
- **Navigation:** menu sections are the children of the sales channel navigation root (`readNavigation main-navigation`), optionally scoped by `runtimeConfig.public.shopBite.menuCategoryId`. Category icon comes from the custom field `shopbite_category_icon` (icones.js.org name such as `i-lucide-pizza`), set by the ShopBite plugin.
|
|
96
96
|
- **Property groups:** `Hauptzutaten` (ingredients on the card, deselectable on the detail page, removed ones are appended to the cart label with "-"), `Vegetarisch` and `Vegan` with the option `Ja` (diet badges), `Küche` (kitchen badge). Filterable groups appear as listing filters.
|
|
97
|
-
- **Extras:** product cross-sellings of type `productList`; the cross-selling name is the label ("Extras", "Beilagen"), the assigned products need a price and sales-channel visibility but no category. Selected extras are sent as children of a `container` line item (`useAddToCart.ts`, handled by the ShopBite plugin).
|
|
98
|
-
- **Custom fields on products:** `shopbite_receipt_print_type` (`number` prints the menu number on the receipt, `label` prints the name) and `shopbite_delivery_time_factor` (int),
|
|
97
|
+
- **Extras:** product cross-sellings of type `productList`; the cross-selling name is the label ("Extras", "Beilagen"), the assigned products need a price and sales-channel visibility but no category. Selected extras are sent as children of a `container` line item (`useAddToCart.ts`, handled by the ShopBite plugin). The product card has no buttons: the card opens the quick view drawer (`Product/QuickView.vue`), whose state is the `produkt` query parameter (product number) via `useProductQuickView` (#325).
|
|
98
|
+
- **Custom fields on products:** `shopbite_receipt_print_type` (`number` prints the menu number on the receipt, `label` prints the name) and `shopbite_delivery_time_factor` (int) and `shopbite_cart_upsell` (bool, suggests the product on the order confirmation step `/bestellung/bestaetigen` via `useCartUpsell`; variant parents are never suggested, a flag on a parent applies to its variants), all from the ShopBite plugin.
|
|
99
99
|
- **Variants:** standard configurator settings (`Product/Configurator.vue`); `server/api/product/variant.get.ts` resolves a variant by option ids.
|
|
100
100
|
|
|
101
101
|
### Server routes
|
|
@@ -113,8 +113,15 @@ The storefront reads plain Shopware entities with fixed names; seed data must ma
|
|
|
113
113
|
- Long lists render on the server and hydrate on scroll: `hydrateWhenVisible(Component)` (`app/utils`) keeps the markup and the chunk, `AnimatedSection` still animates. Used for product cards and the footer.
|
|
114
114
|
- `NuxtLink` prefetches on interaction only (`experimental.defaults.nuxtLink`), and Rolldown groups shared framework/UI modules into two chunks (`vite.build.rollupOptions.output.codeSplitting`). Measure with Lighthouse behind the h2 proxy (see `docs/notes/2026-09-10-issue-314-mobile-js-cost.md`) before changing either.
|
|
115
115
|
|
|
116
|
+
### Stylesheet (#319)
|
|
117
|
+
|
|
118
|
+
- Nuxt UI runs with `ui.experimental.componentDetection`, so only the theme files of the `<U…>` components found in the layers become Tailwind sources; a component rendered dynamically by name must be listed in the option's array form or its theme is empty.
|
|
119
|
+
- Every family in the `--font-sans` stack costs a system font lookup per text style during the first layout. `fonts.defaults.fallbacks["sans-serif"]` is therefore limited to the phone system fonts (Roboto, Helvetica Neue); do not add desktop families back without measuring Style & Layout (`docs/notes/2026-09-12-issue-319-stylesheet-cost.md`).
|
|
120
|
+
- `ui.colors.primary` in `app.config.ts` must be a colour alias defined in `main.css` (`brand`), not a hex value.
|
|
121
|
+
|
|
116
122
|
### SEO
|
|
117
123
|
|
|
124
|
+
- This repository, deployed as the app, is the demo shop (demo.shopbite.de) and must not be crawled: its Dokploy deployment sets `NUXT_SITE_INDEXABLE=false`. Never set `site.indexable` in `nuxt.config.ts`: shops extending the layer would inherit it and drop out of search engines.
|
|
118
125
|
- `server/plugins/site-url.ts` makes `storeUrl` the nuxt-site-config URL, so canonical, sitemap and robots.txt share one base. Build absolute URLs with `toAbsoluteUrl(useSiteConfig().url, path)` (`app/utils/seo.ts`).
|
|
119
126
|
- `app.vue` sets the title template (`site.titleTemplate`), canonical from the route, `og:url`, fallback `og:image` (`site.ogImage`) and `twitter:card`. Page titles are plain (`"Warenkorb"`), never suffixed with the shop name. Indexable pages use `usePageSeo` (`standalone: true` skips the template, home page); categories use `useCategorySeo`, which overrides the canonical with the SEO URL.
|
|
120
127
|
- Shopware category SEO URLs end in `/` and 404 without it, but the sitemap module strips trailing slashes from every URL. Sitemap entries that need the slash carry `_trailingSlash: true`; `server/plugins/sitemap-trailing-slash.ts` restores it in the XML. Never normalise trailing slashes of backend SEO URLs.
|
package/app/app.config.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export default defineAppConfig({
|
|
2
2
|
ui: {
|
|
3
3
|
colors: {
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
// Alias of the colour scale in main.css; a hex value here produced
|
|
5
|
+
// invalid `var(--color-#ff5b00-*)` declarations (#319).
|
|
6
|
+
primary: "brand",
|
|
6
7
|
},
|
|
7
8
|
drawer: {
|
|
8
9
|
slots: {
|
package/app/app.vue
CHANGED
|
@@ -57,7 +57,7 @@ onMounted(async () => {
|
|
|
57
57
|
|
|
58
58
|
const route = useRoute();
|
|
59
59
|
const siteConfig = useSiteConfig();
|
|
60
|
-
const { site } = useRuntimeConfig().public;
|
|
60
|
+
const { site, shopBite } = useRuntimeConfig().public;
|
|
61
61
|
|
|
62
62
|
// Pages with a backend SEO URL (categories) override the canonical link.
|
|
63
63
|
const canonicalUrl = computed(() => toAbsoluteUrl(siteConfig.url, route.path));
|
|
@@ -101,6 +101,8 @@ useSeoMeta({
|
|
|
101
101
|
<NuxtLoadingIndicator />
|
|
102
102
|
|
|
103
103
|
<UApp :toaster="appConfig.toaster">
|
|
104
|
+
<!-- Lazy keeps UBanner out of the entry chunk of real shops (#314). -->
|
|
105
|
+
<LazyDemoBanner v-if="shopBite.feature.demoBanner" />
|
|
104
106
|
<Header />
|
|
105
107
|
<UMain>
|
|
106
108
|
<NuxtLayout>
|
|
@@ -108,5 +110,6 @@ useSeoMeta({
|
|
|
108
110
|
</NuxtLayout>
|
|
109
111
|
</UMain>
|
|
110
112
|
<FooterWhenVisible />
|
|
113
|
+
<CartBar />
|
|
111
114
|
</UApp>
|
|
112
115
|
</template>
|
package/app/assets/css/main.css
CHANGED
|
@@ -22,6 +22,22 @@
|
|
|
22
22
|
|
|
23
23
|
/* This is important because apple devices will zoom in when the font size is below 16px */
|
|
24
24
|
--text-sm: 16px;
|
|
25
|
+
|
|
26
|
+
/* Feedback after adding to the cart: the cart bar and the header badge
|
|
27
|
+
pop instead of a toast (#325). */
|
|
28
|
+
--animate-cart-pop: cart-pop 450ms cubic-bezier(0.34, 1.56, 0.64, 1);
|
|
29
|
+
|
|
30
|
+
@keyframes cart-pop {
|
|
31
|
+
0% {
|
|
32
|
+
transform: scale(1);
|
|
33
|
+
}
|
|
34
|
+
35% {
|
|
35
|
+
transform: scale(1.06);
|
|
36
|
+
}
|
|
37
|
+
100% {
|
|
38
|
+
transform: scale(1);
|
|
39
|
+
}
|
|
40
|
+
}
|
|
25
41
|
}
|
|
26
42
|
|
|
27
43
|
/*
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import type { Schemas } from "#shopware";
|
|
3
|
+
import type { ButtonProps } from "@nuxt/ui";
|
|
3
4
|
|
|
4
|
-
const props =
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const props = withDefaults(
|
|
6
|
+
defineProps<{
|
|
7
|
+
product: Schemas["Product"];
|
|
8
|
+
size?: ButtonProps["size"];
|
|
9
|
+
variant?: ButtonProps["variant"];
|
|
10
|
+
}>(),
|
|
11
|
+
{ size: "md", variant: "ghost" },
|
|
12
|
+
);
|
|
7
13
|
|
|
8
14
|
const { addToWishlist, isInWishlist, removeFromWishlist } = useProductWishlist(
|
|
9
15
|
props.product.id,
|
|
@@ -23,11 +29,10 @@ const toggleWishlistProduct = async () => {
|
|
|
23
29
|
}
|
|
24
30
|
};
|
|
25
31
|
|
|
26
|
-
// Computed tooltip text
|
|
27
32
|
const tooltipText = computed(() =>
|
|
28
33
|
isInWishlist.value
|
|
29
34
|
? "Von der Merkliste entfernen"
|
|
30
|
-
: "Auf die Merkliste
|
|
35
|
+
: "Auf die Merkliste setzen",
|
|
31
36
|
);
|
|
32
37
|
</script>
|
|
33
38
|
|
|
@@ -35,8 +40,10 @@ const tooltipText = computed(() =>
|
|
|
35
40
|
<UTooltip :text="tooltipText">
|
|
36
41
|
<UButton
|
|
37
42
|
icon="i-lucide-heart"
|
|
38
|
-
|
|
43
|
+
:size="size"
|
|
44
|
+
:variant="variant"
|
|
39
45
|
:color="isInWishlist ? 'error' : 'neutral'"
|
|
46
|
+
:aria-label="tooltipText"
|
|
40
47
|
@click="toggleWishlistProduct"
|
|
41
48
|
/>
|
|
42
49
|
</UTooltip>
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Sticky cart bar on phones: appears as soon as the cart holds something and
|
|
3
|
+
// opens the cart drawer; hidden on the checkout pages, which show the cart
|
|
4
|
+
// themselves. The cart is loaded on the client, so the bar never renders on
|
|
5
|
+
// the server (no hydration mismatch). Adding a product pops the bar and
|
|
6
|
+
// names the product for a moment; this replaces the add-to-cart toast (#325).
|
|
7
|
+
const CHECKOUT_PATH_PREFIX = "/bestellung";
|
|
8
|
+
const ADDED_LABEL_MS = 1800;
|
|
9
|
+
|
|
10
|
+
const route = useRoute();
|
|
11
|
+
const { count, subtotal } = useCart();
|
|
12
|
+
const { isCheckoutEnabled } = useShopBiteConfig();
|
|
13
|
+
const { getFormattedPrice } = useCommercePrice();
|
|
14
|
+
const { show } = useCartQuickView();
|
|
15
|
+
const { onCartItemAdded } = useProductEvents();
|
|
16
|
+
|
|
17
|
+
const visible = computed(
|
|
18
|
+
() =>
|
|
19
|
+
isCheckoutEnabled.value &&
|
|
20
|
+
count.value > 0 &&
|
|
21
|
+
!route.path.startsWith(CHECKOUT_PATH_PREFIX),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const itemsLabel = computed(() =>
|
|
25
|
+
count.value === 1 ? "1 Artikel" : `${count.value} Artikel`,
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
const addedLabel = ref<string | null>(null);
|
|
29
|
+
// Changing the key re-mounts the button, which restarts the pop animation.
|
|
30
|
+
const popKey = ref(0);
|
|
31
|
+
let addedTimer: ReturnType<typeof setTimeout> | undefined;
|
|
32
|
+
|
|
33
|
+
onCartItemAdded(({ product, quantity }) => {
|
|
34
|
+
const name = product.translated?.name ?? product.name;
|
|
35
|
+
addedLabel.value = quantity > 1 ? `${quantity}× ${name}` : name;
|
|
36
|
+
popKey.value++;
|
|
37
|
+
clearTimeout(addedTimer);
|
|
38
|
+
addedTimer = setTimeout(() => {
|
|
39
|
+
addedLabel.value = null;
|
|
40
|
+
}, ADDED_LABEL_MS);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
onBeforeUnmount(() => clearTimeout(addedTimer));
|
|
44
|
+
</script>
|
|
45
|
+
|
|
46
|
+
<template>
|
|
47
|
+
<!-- Keeps the page bottom clear of the fixed bar. -->
|
|
48
|
+
<div v-if="visible" class="h-20 lg:hidden" aria-hidden="true" />
|
|
49
|
+
<Transition
|
|
50
|
+
enter-active-class="transition duration-200 ease-out"
|
|
51
|
+
enter-from-class="translate-y-full"
|
|
52
|
+
leave-active-class="transition duration-150 ease-in"
|
|
53
|
+
leave-to-class="translate-y-full"
|
|
54
|
+
>
|
|
55
|
+
<div
|
|
56
|
+
v-if="visible"
|
|
57
|
+
class="fixed inset-x-0 bottom-0 z-40 p-3 pb-[max(0.75rem,env(safe-area-inset-bottom))] lg:hidden"
|
|
58
|
+
>
|
|
59
|
+
<button
|
|
60
|
+
:key="popKey"
|
|
61
|
+
type="button"
|
|
62
|
+
class="flex h-14 w-full items-center gap-3 rounded-xl bg-primary px-4 text-inverted shadow-lg transition-colors hover:bg-primary/90 active:bg-primary/90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary"
|
|
63
|
+
:class="{ 'motion-safe:animate-cart-pop': popKey > 0 }"
|
|
64
|
+
aria-haspopup="dialog"
|
|
65
|
+
aria-live="polite"
|
|
66
|
+
data-testid="cart-bar"
|
|
67
|
+
@click="show"
|
|
68
|
+
>
|
|
69
|
+
<UIcon name="i-lucide-shopping-bag" class="size-6 shrink-0" />
|
|
70
|
+
<span class="flex min-w-0 flex-1 items-baseline gap-2 text-left">
|
|
71
|
+
<Transition
|
|
72
|
+
mode="out-in"
|
|
73
|
+
enter-active-class="transition duration-150"
|
|
74
|
+
enter-from-class="translate-y-1 opacity-0"
|
|
75
|
+
leave-active-class="transition duration-100"
|
|
76
|
+
leave-to-class="-translate-y-1 opacity-0"
|
|
77
|
+
>
|
|
78
|
+
<span
|
|
79
|
+
v-if="addedLabel"
|
|
80
|
+
key="added"
|
|
81
|
+
class="flex min-w-0 items-baseline gap-2"
|
|
82
|
+
>
|
|
83
|
+
<UIcon
|
|
84
|
+
name="i-lucide-check"
|
|
85
|
+
class="size-4 shrink-0 self-center"
|
|
86
|
+
/>
|
|
87
|
+
<span class="truncate font-semibold">{{ addedLabel }}</span>
|
|
88
|
+
<span class="shrink-0 text-sm opacity-90">hinzugefügt</span>
|
|
89
|
+
</span>
|
|
90
|
+
<span v-else key="cart" class="flex min-w-0 items-baseline gap-2">
|
|
91
|
+
<span class="font-semibold">Warenkorb</span>
|
|
92
|
+
<span class="truncate text-sm opacity-90">
|
|
93
|
+
{{ itemsLabel }} · {{ getFormattedPrice(subtotal) }}
|
|
94
|
+
</span>
|
|
95
|
+
</span>
|
|
96
|
+
</Transition>
|
|
97
|
+
</span>
|
|
98
|
+
<UIcon name="i-lucide-chevron-up" class="size-5 shrink-0" />
|
|
99
|
+
</button>
|
|
100
|
+
</div>
|
|
101
|
+
</Transition>
|
|
102
|
+
</template>
|
|
@@ -6,11 +6,13 @@ withDefaults(
|
|
|
6
6
|
withQuantityInput?: boolean;
|
|
7
7
|
withDeleteButton?: boolean;
|
|
8
8
|
withToCartButton?: boolean;
|
|
9
|
+
withUpsell?: boolean;
|
|
9
10
|
}>(),
|
|
10
11
|
{
|
|
11
12
|
withQuantityInput: true,
|
|
12
13
|
withDeleteButton: true,
|
|
13
14
|
withToCartButton: false,
|
|
15
|
+
withUpsell: false,
|
|
14
16
|
},
|
|
15
17
|
);
|
|
16
18
|
|
|
@@ -30,6 +32,8 @@ const emit = defineEmits(["go-to-cart"]);
|
|
|
30
32
|
/>
|
|
31
33
|
</div>
|
|
32
34
|
<div class="flex flex-col gap-4">
|
|
35
|
+
<!-- Suggestions right above the total, on the confirmation step only (#338). -->
|
|
36
|
+
<LazyCartUpsell v-if="withUpsell && !isEmpty" />
|
|
33
37
|
<div class="flex flex-row justify-between">
|
|
34
38
|
<template v-if="shippingTotal === 0">
|
|
35
39
|
<div class="text-success font-medium">
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { Schemas } from "#shopware";
|
|
3
|
+
|
|
4
|
+
// One-click suggestions on the order confirmation step (#338): flagged
|
|
5
|
+
// products that are not in the cart yet. Renders nothing once every
|
|
6
|
+
// suggestion is in the cart.
|
|
7
|
+
const { loadUpsellProducts, addUpsellProduct, isAdding } = useCartUpsell();
|
|
8
|
+
const { cartItems } = useCart();
|
|
9
|
+
const { getFormattedPrice } = useCommercePrice();
|
|
10
|
+
|
|
11
|
+
// Browser only: the server renders without the cart, so filtering there would
|
|
12
|
+
// not match the hydrated page. The row follows once the request returns.
|
|
13
|
+
const { data: upsellProducts } = useAsyncData(
|
|
14
|
+
"cart-upsell",
|
|
15
|
+
loadUpsellProducts,
|
|
16
|
+
{ server: false },
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
const products = computed(() =>
|
|
20
|
+
(upsellProducts.value ?? []).filter(
|
|
21
|
+
(product) =>
|
|
22
|
+
!cartItems.value.some((item) => lineItemHoldsProduct(item, product.id)),
|
|
23
|
+
),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
const productName = (product: Schemas["Product"]) =>
|
|
27
|
+
product.translated?.name ?? product.name;
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template>
|
|
31
|
+
<!-- Tinted box with offer cards, so the suggestions do not read as line items. -->
|
|
32
|
+
<section
|
|
33
|
+
v-if="products.length > 0"
|
|
34
|
+
aria-labelledby="cart-upsell-title"
|
|
35
|
+
class="flex flex-col gap-3 rounded-lg bg-primary/5 p-3 ring ring-primary/20"
|
|
36
|
+
>
|
|
37
|
+
<div>
|
|
38
|
+
<h3
|
|
39
|
+
id="cart-upsell-title"
|
|
40
|
+
class="flex items-center gap-1.5 font-bold text-highlighted"
|
|
41
|
+
>
|
|
42
|
+
<UIcon name="i-lucide-sparkles" class="size-4 text-primary" />
|
|
43
|
+
Dazu passt
|
|
44
|
+
</h3>
|
|
45
|
+
<p class="text-sm text-muted">
|
|
46
|
+
Mit einem Klick zur Bestellung hinzufügen.
|
|
47
|
+
</p>
|
|
48
|
+
</div>
|
|
49
|
+
<!-- One suggestion spans the full width; with more the next one peeks in. -->
|
|
50
|
+
<ul
|
|
51
|
+
class="flex snap-x snap-mandatory gap-3 overflow-x-auto [scrollbar-width:thin]"
|
|
52
|
+
>
|
|
53
|
+
<li
|
|
54
|
+
v-for="product in products"
|
|
55
|
+
:key="product.id"
|
|
56
|
+
class="flex shrink-0 snap-start overflow-hidden rounded-lg bg-default shadow-sm ring ring-default"
|
|
57
|
+
:class="products.length > 1 ? 'w-[85%]' : 'w-full'"
|
|
58
|
+
>
|
|
59
|
+
<!-- Decorative: the name is right next to it. -->
|
|
60
|
+
<img
|
|
61
|
+
v-if="product.cover?.media?.url"
|
|
62
|
+
:src="product.cover.media.url"
|
|
63
|
+
:srcset="mediaSrcSet(product.cover.media)"
|
|
64
|
+
sizes="(min-width: 40rem) 144px, 112px"
|
|
65
|
+
alt=""
|
|
66
|
+
loading="lazy"
|
|
67
|
+
decoding="async"
|
|
68
|
+
class="size-28 shrink-0 object-cover sm:size-36"
|
|
69
|
+
/>
|
|
70
|
+
<div
|
|
71
|
+
v-else
|
|
72
|
+
class="flex size-28 shrink-0 items-center justify-center bg-gradient-to-b from-brand-100 to-brand-200 text-brand-600 sm:size-36"
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
>
|
|
75
|
+
<UIcon name="i-lucide-utensils-crossed" class="size-8" />
|
|
76
|
+
</div>
|
|
77
|
+
<div class="flex min-w-0 flex-1 flex-col gap-0.5 p-3">
|
|
78
|
+
<span class="text-xs font-semibold text-primary">
|
|
79
|
+
#{{ product.productNumber }}
|
|
80
|
+
</span>
|
|
81
|
+
<span
|
|
82
|
+
class="line-clamp-2 text-sm font-semibold text-highlighted sm:text-base"
|
|
83
|
+
>
|
|
84
|
+
{{ productName(product) }}
|
|
85
|
+
</span>
|
|
86
|
+
<div class="mt-auto flex items-center justify-between gap-2 pt-1">
|
|
87
|
+
<span class="font-bold text-highlighted">
|
|
88
|
+
{{ getFormattedPrice(product.calculatedPrice.totalPrice) }}
|
|
89
|
+
</span>
|
|
90
|
+
<UButton
|
|
91
|
+
icon="i-lucide-plus"
|
|
92
|
+
variant="subtle"
|
|
93
|
+
class="shrink-0"
|
|
94
|
+
:aria-label="`${productName(product)} in den Warenkorb`"
|
|
95
|
+
:loading="isAdding(product.id)"
|
|
96
|
+
:disabled="!productIsAvailable(product) || isAdding(product.id)"
|
|
97
|
+
@click="addUpsellProduct(product)"
|
|
98
|
+
>
|
|
99
|
+
<span class="hidden sm:inline">Hinzufügen</span>
|
|
100
|
+
</UButton>
|
|
101
|
+
</div>
|
|
102
|
+
</div>
|
|
103
|
+
</li>
|
|
104
|
+
</ul>
|
|
105
|
+
</section>
|
|
106
|
+
</template>
|
|
@@ -41,6 +41,8 @@ async function resetFilters() {
|
|
|
41
41
|
useCategorySeo(category);
|
|
42
42
|
useMenuSectionSchema(category, elements);
|
|
43
43
|
|
|
44
|
+
const quickView = useProductQuickView(elements);
|
|
45
|
+
|
|
44
46
|
// Derived from the listing data instead of snapshotted at setup time, which
|
|
45
47
|
// would be a hydration mismatch (#239); see useSortingSelection.
|
|
46
48
|
const { currentSorting } = useSortingSelection(currentSortingOrder);
|
|
@@ -195,7 +197,7 @@ async function openFilterDrawer() {
|
|
|
195
197
|
|
|
196
198
|
<div
|
|
197
199
|
v-if="showSkeleton"
|
|
198
|
-
class="
|
|
200
|
+
class="grid grid-cols-1 gap-4"
|
|
199
201
|
aria-busy="true"
|
|
200
202
|
aria-label="Produkte werden geladen"
|
|
201
203
|
>
|
|
@@ -204,7 +206,7 @@ async function openFilterDrawer() {
|
|
|
204
206
|
|
|
205
207
|
<div
|
|
206
208
|
v-else
|
|
207
|
-
class="
|
|
209
|
+
class="grid grid-cols-1 gap-4 transition-opacity duration-200"
|
|
208
210
|
:class="{ 'opacity-40 pointer-events-none': loading }"
|
|
209
211
|
>
|
|
210
212
|
<ProductCardWhenVisible
|
|
@@ -212,9 +214,15 @@ async function openFilterDrawer() {
|
|
|
212
214
|
:key="product.id"
|
|
213
215
|
:product="product"
|
|
214
216
|
:with-favorite-button="true"
|
|
215
|
-
:
|
|
217
|
+
:selectable="true"
|
|
218
|
+
@select="quickView.show"
|
|
216
219
|
/>
|
|
217
220
|
</div>
|
|
221
|
+
<LazyProductQuickView
|
|
222
|
+
v-if="quickView.mounted.value"
|
|
223
|
+
v-model:open="quickView.open.value"
|
|
224
|
+
:product="quickView.product.value"
|
|
225
|
+
/>
|
|
218
226
|
</div>
|
|
219
227
|
</UPageBody>
|
|
220
228
|
|
|
@@ -192,7 +192,11 @@ const checkoutButtonLabel = computed<string>(() => {
|
|
|
192
192
|
<div class="flex flex-col gap-4">
|
|
193
193
|
<h3 class="text-lg font-semibold">Warenkorb</h3>
|
|
194
194
|
<UCard>
|
|
195
|
-
<QuickView
|
|
195
|
+
<QuickView
|
|
196
|
+
:with-quantity-input="false"
|
|
197
|
+
:with-delete-button="false"
|
|
198
|
+
:with-upsell="true"
|
|
199
|
+
/>
|
|
196
200
|
</UCard>
|
|
197
201
|
<CheckoutVoucherInput />
|
|
198
202
|
<UButton
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Notice for demo shops (demos/): rendered above the header when
|
|
3
|
+
// `shopBite.feature.demoBanner` is set. Not dismissible on purpose, so a
|
|
4
|
+
// prospect never mistakes the demo for a live shop.
|
|
5
|
+
</script>
|
|
6
|
+
|
|
7
|
+
<template>
|
|
8
|
+
<UBanner
|
|
9
|
+
color="warning"
|
|
10
|
+
icon="i-lucide-flask-conical"
|
|
11
|
+
title="Demo-Shop: Bestellungen werden nicht bearbeitet und nicht ausgeliefert."
|
|
12
|
+
/>
|
|
13
|
+
</template>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// Information card on the home page (#332): tinted icon, category label, a
|
|
3
|
+
// bold lead line, detail text and an optional action. `kind` fills the lead
|
|
4
|
+
// with live data; both live parts render on the client only, like the
|
|
5
|
+
// footer's store status (#275), with their height reserved.
|
|
6
|
+
export type FeatureCardProps = {
|
|
7
|
+
title: string;
|
|
8
|
+
description: string;
|
|
9
|
+
icon?: string;
|
|
10
|
+
kind?: "hours" | "delivery" | "reservation";
|
|
11
|
+
lead?: string;
|
|
12
|
+
link?: { label: string; to: string };
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const props = defineProps<FeatureCardProps>();
|
|
16
|
+
|
|
17
|
+
const { businessHours } = useBusinessHours();
|
|
18
|
+
const { status } = useStoreStatus();
|
|
19
|
+
const { deliveryTime } = useShopBiteConfig();
|
|
20
|
+
|
|
21
|
+
const isLive = computed(
|
|
22
|
+
() => props.kind === "hours" || props.kind === "delivery",
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const lead = computed(() => {
|
|
26
|
+
if (props.kind === "hours") {
|
|
27
|
+
return businessHours.value
|
|
28
|
+
? formatTodayHours(businessHours.value, new Date())
|
|
29
|
+
: "";
|
|
30
|
+
}
|
|
31
|
+
if (props.kind === "delivery") {
|
|
32
|
+
return `In ca. ${deliveryTime.value} Minuten bei dir`;
|
|
33
|
+
}
|
|
34
|
+
return props.lead ?? "";
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
const statusLabel = computed(() => {
|
|
38
|
+
if (props.kind !== "hours" || !status.value) return "";
|
|
39
|
+
if (status.value.open) return `Geöffnet bis ${status.value.closesAt}`;
|
|
40
|
+
return status.value.nextOpening
|
|
41
|
+
? `Öffnet ${status.value.nextOpening}`
|
|
42
|
+
: "Geschlossen";
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
const isCallLink = computed(() => props.link?.to.startsWith("tel:") ?? false);
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<div
|
|
50
|
+
class="flex h-full flex-col gap-3 rounded-2xl bg-default p-5 shadow-md ring ring-default"
|
|
51
|
+
>
|
|
52
|
+
<div class="flex items-center justify-between gap-3">
|
|
53
|
+
<span
|
|
54
|
+
class="flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-primary"
|
|
55
|
+
aria-hidden="true"
|
|
56
|
+
>
|
|
57
|
+
<UIcon v-if="icon" :name="icon" class="size-6" />
|
|
58
|
+
</span>
|
|
59
|
+
<ClientOnly v-if="kind === 'hours'">
|
|
60
|
+
<span
|
|
61
|
+
v-if="statusLabel"
|
|
62
|
+
class="inline-flex items-center gap-1.5 text-sm font-semibold"
|
|
63
|
+
:class="status?.open ? 'text-success' : 'text-muted'"
|
|
64
|
+
role="status"
|
|
65
|
+
>
|
|
66
|
+
<span
|
|
67
|
+
class="size-2 rounded-full"
|
|
68
|
+
:class="status?.open ? 'bg-success' : 'bg-dimmed'"
|
|
69
|
+
aria-hidden="true"
|
|
70
|
+
/>
|
|
71
|
+
{{ statusLabel }}
|
|
72
|
+
</span>
|
|
73
|
+
<template #fallback>
|
|
74
|
+
<span class="h-5" aria-hidden="true" />
|
|
75
|
+
</template>
|
|
76
|
+
</ClientOnly>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<div class="flex flex-col gap-1">
|
|
80
|
+
<span class="text-xs font-semibold tracking-wider text-muted uppercase">
|
|
81
|
+
{{ title }}
|
|
82
|
+
</span>
|
|
83
|
+
<ClientOnly v-if="isLive">
|
|
84
|
+
<span class="text-lg leading-6 font-bold text-highlighted">
|
|
85
|
+
{{ lead }}
|
|
86
|
+
</span>
|
|
87
|
+
<template #fallback>
|
|
88
|
+
<span class="block h-6" aria-hidden="true" />
|
|
89
|
+
</template>
|
|
90
|
+
</ClientOnly>
|
|
91
|
+
<span
|
|
92
|
+
v-else-if="lead"
|
|
93
|
+
class="text-lg leading-6 font-bold text-highlighted"
|
|
94
|
+
>
|
|
95
|
+
{{ lead }}
|
|
96
|
+
</span>
|
|
97
|
+
<p class="text-sm text-default">{{ description }}</p>
|
|
98
|
+
</div>
|
|
99
|
+
|
|
100
|
+
<div v-if="link" class="mt-auto pt-1">
|
|
101
|
+
<UButton
|
|
102
|
+
v-if="isCallLink"
|
|
103
|
+
:label="link.label"
|
|
104
|
+
:to="link.to"
|
|
105
|
+
icon="i-lucide-phone"
|
|
106
|
+
variant="subtle"
|
|
107
|
+
size="lg"
|
|
108
|
+
class="justify-center"
|
|
109
|
+
block
|
|
110
|
+
/>
|
|
111
|
+
<UButton
|
|
112
|
+
v-else
|
|
113
|
+
:label="link.label"
|
|
114
|
+
:to="link.to"
|
|
115
|
+
variant="link"
|
|
116
|
+
trailing-icon="i-lucide-arrow-right"
|
|
117
|
+
class="px-0"
|
|
118
|
+
/>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
</template>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import type {
|
|
2
|
+
import type { FeatureCardProps } from "~/components/Feature/Card.vue";
|
|
3
3
|
|
|
4
4
|
defineProps<{
|
|
5
5
|
title: string;
|
|
6
6
|
description: string;
|
|
7
7
|
headline?: string | undefined;
|
|
8
|
-
features:
|
|
8
|
+
features: FeatureCardProps[];
|
|
9
9
|
}>();
|
|
10
10
|
</script>
|
|
11
11
|
|
|
@@ -18,20 +18,25 @@ defineProps<{
|
|
|
18
18
|
<UPageSection
|
|
19
19
|
id="features"
|
|
20
20
|
:description="description"
|
|
21
|
-
:title="title"
|
|
22
|
-
:features="features"
|
|
23
21
|
:headline="headline"
|
|
24
22
|
class="relative overflow-hidden"
|
|
25
23
|
>
|
|
24
|
+
<template #title>
|
|
25
|
+
<MDC :value="title" class="*:leading-9" />
|
|
26
|
+
</template>
|
|
26
27
|
<div
|
|
27
|
-
class="absolute rounded-full -left-10 top-10 size-[300px] z-10 bg-primary opacity-30 blur-[200px]"
|
|
28
|
+
class="absolute rounded-full -left-10 top-10 size-[300px] -z-10 bg-primary opacity-30 blur-[200px]"
|
|
28
29
|
/>
|
|
29
30
|
<div
|
|
30
|
-
class="absolute rounded-full -right-10 -bottom-10 size-[300px] z-10 bg-primary opacity-30 blur-[200px]"
|
|
31
|
+
class="absolute rounded-full -right-10 -bottom-10 size-[300px] -z-10 bg-primary opacity-30 blur-[200px]"
|
|
31
32
|
/>
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
33
|
+
<div class="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
34
|
+
<FeatureCard
|
|
35
|
+
v-for="(feature, index) in features"
|
|
36
|
+
:key="index"
|
|
37
|
+
v-bind="feature"
|
|
38
|
+
/>
|
|
39
|
+
</div>
|
|
35
40
|
</UPageSection>
|
|
36
41
|
</AnimatedSection>
|
|
37
42
|
</template>
|
|
@@ -55,7 +55,11 @@ const hasContact = Boolean(
|
|
|
55
55
|
</ul>
|
|
56
56
|
</address>
|
|
57
57
|
|
|
58
|
-
<div
|
|
58
|
+
<div
|
|
59
|
+
v-if="openingHours.length"
|
|
60
|
+
id="oeffnungszeiten"
|
|
61
|
+
class="scroll-mt-24 text-sm"
|
|
62
|
+
>
|
|
59
63
|
<p class="font-semibold">Öffnungszeiten</p>
|
|
60
64
|
<FooterStoreStatus class="mt-6" />
|
|
61
65
|
<dl class="mt-4 grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-muted">
|