@shopbite-de/storefront 1.29.0 → 1.30.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 (50) hide show
  1. package/.env.example +9 -0
  2. package/CLAUDE.md +4 -1
  3. package/app/components/Category/Listing.vue +1 -0
  4. package/app/components/Home/Faq.vue +58 -0
  5. package/app/components/Home/Highlights.vue +1 -0
  6. package/app/components/Product/Card.vue +46 -10
  7. package/app/components/Product/CardDietBadges.vue +7 -13
  8. package/app/components/Product/CrossSelling.vue +18 -2
  9. package/app/components/Product/DeselectIngredient.vue +10 -3
  10. package/app/components/Product/Detail.vue +33 -2
  11. package/app/components/Product/QuickView.vue +20 -1
  12. package/app/composables/useMenuSectionSchema.ts +21 -8
  13. package/app/composables/useProductCrossSelling.ts +1 -0
  14. package/app/composables/useProductQuickView.ts +151 -9
  15. package/app/composables/useRestaurantSchema.ts +40 -3
  16. package/app/composables/useShareLink.ts +47 -0
  17. package/app/composables/useTopSellers.ts +4 -1
  18. package/app/pages/index.vue +7 -0
  19. package/app/types/Association.d.ts +2 -0
  20. package/app/utils/product.ts +28 -0
  21. package/app/utils/productUrl.ts +87 -0
  22. package/app/utils/schema.ts +82 -1
  23. package/app/utils/seo.ts +13 -0
  24. package/content/index.yml +18 -0
  25. package/content.config.ts +13 -0
  26. package/docs/notes/2026-10-05-issue-289-product-deep-links.md +28 -0
  27. package/docs/notes/2026-10-05-issue-400-menu-item-ingredients-diet.md +18 -0
  28. package/docs/notes/2026-10-05-issue-401-restaurant-schema-ordering.md +21 -0
  29. package/docs/notes/2026-10-05-issue-402-llms-txt.md +17 -0
  30. package/docs/notes/2026-10-05-issue-403-ai-crawlers.md +15 -0
  31. package/docs/notes/2026-10-05-issue-404-faq.md +21 -0
  32. package/docs/notes/2026-10-05-issue-411-quick-view-share.md +22 -0
  33. package/nuxt.config.ts +20 -0
  34. package/package.json +1 -1
  35. package/server/api/listing/[categoryId].get.ts +3 -0
  36. package/server/api/product/[productId]/cross-selling.get.ts +2 -1
  37. package/server/plugins/ai-crawlers.ts +27 -0
  38. package/server/routes/llms.txt.ts +213 -0
  39. package/server/utils/aiCrawlers.ts +79 -0
  40. package/server/utils/llmsTxt.ts +207 -0
  41. package/test/nuxt/HomeFaq.test.ts +34 -0
  42. package/test/nuxt/ProductCrossSelling.test.ts +20 -0
  43. package/test/nuxt/ProductDeselectIngredient.test.ts +34 -0
  44. package/test/nuxt/useShareLink.test.ts +76 -0
  45. package/test/unit/aiCrawlers.spec.ts +48 -0
  46. package/test/unit/llmsTxt.spec.ts +149 -0
  47. package/test/unit/product.spec.ts +20 -0
  48. package/test/unit/productUrl.spec.ts +90 -0
  49. package/test/unit/schema.spec.ts +123 -0
  50. package/test/unit/seo.spec.ts +13 -0
@@ -0,0 +1,207 @@
1
+ import { groupOpeningHours } from "../../app/utils/openingHours";
2
+
3
+ // Builder for /llms.txt (#402, https://llmstxt.org): a Markdown summary of
4
+ // the shop for language models. Pure, so it is unit-testable; the route
5
+ // gathers the data and hands it in. The text is German like the shop.
6
+
7
+ export type LlmsMenuItem = {
8
+ name: string;
9
+ /** Quick view deep link (#289). */
10
+ url?: string;
11
+ price?: number;
12
+ /** The product has variants; `price` is the cheapest one. */
13
+ fromPrice?: boolean;
14
+ ingredients?: string[];
15
+ diets?: ("vegetarian" | "vegan")[];
16
+ };
17
+
18
+ export type LlmsMenuSection = {
19
+ name: string;
20
+ url?: string;
21
+ items: LlmsMenuItem[];
22
+ sections?: LlmsMenuSection[];
23
+ };
24
+
25
+ export type LlmsTxtInput = {
26
+ name: string;
27
+ description?: string;
28
+ url: string;
29
+ cuisine?: string;
30
+ address?: { street?: string; postalCode?: string; city?: string };
31
+ telephone?: string;
32
+ googleBusinessProfileUrl?: string;
33
+ deliveryAreas?: string[];
34
+ businessHours?: {
35
+ dayOfWeek?: number;
36
+ openingTime?: string;
37
+ closingTime?: string;
38
+ }[];
39
+ holidays?: { start?: string; end?: string }[];
40
+ isCheckoutEnabled?: boolean;
41
+ /** Minutes until delivery. */
42
+ deliveryTime?: number;
43
+ menuUrl?: string;
44
+ menu?: LlmsMenuSection[];
45
+ pages?: { title: string; url: string; description?: string }[];
46
+ /** FAQ of the home page (#404). */
47
+ faq?: { question: string; answer: string }[];
48
+ currency?: string;
49
+ /** Closing days that ended before this date are left out. */
50
+ now: Date;
51
+ };
52
+
53
+ const DIET_LABELS = { vegetarian: "vegetarisch", vegan: "vegan" } as const;
54
+
55
+ function formatPrice(price: number, currency: string) {
56
+ return new Intl.NumberFormat("de-DE", { style: "currency", currency })
57
+ .format(price)
58
+ .replace(/\u00a0/g, " ");
59
+ }
60
+
61
+ /** `2026-07-12T21:00:00Z` → `12.07.2026` (date part as in the Restaurant schema). */
62
+ function formatDay(isoDate: string) {
63
+ const [year, month, day] = isoDate.slice(0, 10).split("-");
64
+ return `${day}.${month}.${year}`;
65
+ }
66
+
67
+ function menuItemLine(item: LlmsMenuItem, currency: string) {
68
+ const price =
69
+ item.price !== undefined
70
+ ? `${item.fromPrice ? "ab " : ""}${formatPrice(item.price, currency)}`
71
+ : undefined;
72
+ // Vegan dishes are vegetarian too; naming "vegan" is enough.
73
+ const diet = item.diets?.includes("vegan")
74
+ ? DIET_LABELS.vegan
75
+ : item.diets?.includes("vegetarian")
76
+ ? DIET_LABELS.vegetarian
77
+ : undefined;
78
+ const details = [
79
+ item.ingredients?.length ? item.ingredients.join(", ") : undefined,
80
+ diet,
81
+ ].filter((line): line is string => Boolean(line));
82
+
83
+ const name = item.url ? `[${item.name}](${item.url})` : item.name;
84
+ return `- ${name}${price ? `: ${price}` : ""}${
85
+ details.length ? ` (${details.join("; ")})` : ""
86
+ }`;
87
+ }
88
+
89
+ function menuSectionLines(
90
+ section: LlmsMenuSection,
91
+ currency: string,
92
+ level: number,
93
+ ): string[] {
94
+ const heading = "#".repeat(Math.min(level, 6));
95
+ const title = section.url
96
+ ? `[${section.name}](${section.url})`
97
+ : section.name;
98
+ const subsections = (section.sections ?? []).flatMap((child) =>
99
+ menuSectionLines(child, currency, level + 1),
100
+ );
101
+ if (section.items.length === 0 && subsections.length === 0) return [];
102
+
103
+ return [
104
+ "",
105
+ `${heading} ${title}`,
106
+ ...(section.items.length ? [""] : []),
107
+ ...section.items.map((item) => menuItemLine(item, currency)),
108
+ ...subsections,
109
+ ];
110
+ }
111
+
112
+ export function buildLlmsTxt(input: LlmsTxtInput): string {
113
+ const currency = input.currency || "EUR";
114
+ const city = input.address?.city;
115
+
116
+ const summary = [
117
+ input.cuisine && city
118
+ ? `${input.name}: ${input.cuisine} in ${city}.`
119
+ : `${input.name}${city ? ` in ${city}` : ""}.`,
120
+ input.isCheckoutEnabled
121
+ ? `Online bestellen zur Lieferung oder Abholung unter ${input.url}.`
122
+ : undefined,
123
+ ]
124
+ .filter(Boolean)
125
+ .join(" ");
126
+
127
+ const contact = [
128
+ input.address?.street || input.address?.postalCode || city
129
+ ? `- Adresse: ${[
130
+ input.address?.street,
131
+ [input.address?.postalCode, city].filter(Boolean).join(" "),
132
+ ]
133
+ .filter(Boolean)
134
+ .join(", ")}`
135
+ : undefined,
136
+ input.telephone ? `- Telefon: ${input.telephone}` : undefined,
137
+ `- Website: ${input.url}`,
138
+ input.googleBusinessProfileUrl
139
+ ? `- Google: ${input.googleBusinessProfileUrl}`
140
+ : undefined,
141
+ ].filter((line): line is string => Boolean(line));
142
+
143
+ const hours = groupOpeningHours(input.businessHours ?? []).map(
144
+ (row) =>
145
+ `- ${row.days}: ${row.intervals.length ? row.intervals.join(", ") : "Ruhetag"}`,
146
+ );
147
+
148
+ const today = input.now.toISOString().slice(0, 10);
149
+ const closingDays = (input.holidays ?? [])
150
+ .filter((holiday) => holiday.start && holiday.end)
151
+ .filter((holiday) => holiday.end!.slice(0, 10) >= today)
152
+ .map((holiday) => {
153
+ const start = formatDay(holiday.start!);
154
+ const end = formatDay(holiday.end!);
155
+ return `- Geschlossen: ${start === end ? start : `${start} – ${end}`}`;
156
+ });
157
+
158
+ const ordering = input.isCheckoutEnabled
159
+ ? [
160
+ `- Online bestellen: ${input.menuUrl ?? input.url}`,
161
+ input.deliveryAreas?.length
162
+ ? `- Liefergebiet: ${input.deliveryAreas.join(", ")}`
163
+ : undefined,
164
+ input.deliveryTime
165
+ ? `- Lieferzeit: ca. ${input.deliveryTime} Minuten`
166
+ : undefined,
167
+ input.address?.street ? "- Abholung im Restaurant möglich" : undefined,
168
+ ].filter((line): line is string => Boolean(line))
169
+ : [];
170
+
171
+ const menu = (input.menu ?? []).flatMap((section) =>
172
+ menuSectionLines(section, currency, 3),
173
+ );
174
+
175
+ const pages = (input.pages ?? []).map(
176
+ (page) =>
177
+ `- [${page.title}](${page.url})${page.description && page.description !== page.title ? `: ${page.description}` : ""}`,
178
+ );
179
+
180
+ const sections: string[][] = [
181
+ [`# ${input.name}`, "", `> ${summary}`],
182
+ input.description ? [input.description] : [],
183
+ ["## Kontakt", "", ...contact],
184
+ hours.length || closingDays.length
185
+ ? ["## Öffnungszeiten", "", ...hours, ...closingDays]
186
+ : [],
187
+ ordering.length ? ["## Bestellen", "", ...ordering] : [],
188
+ input.faq?.length
189
+ ? [
190
+ "## Häufige Fragen",
191
+ ...input.faq.flatMap((item) => [
192
+ "",
193
+ `### ${item.question}`,
194
+ "",
195
+ item.answer,
196
+ ]),
197
+ ]
198
+ : [],
199
+ menu.length ? ["## Speisekarte", ...menu] : [],
200
+ pages.length ? ["## Weitere Informationen", "", ...pages] : [],
201
+ ];
202
+
203
+ return `${sections
204
+ .filter((lines) => lines.length)
205
+ .map((lines) => lines.join("\n"))
206
+ .join("\n\n")}\n`;
207
+ }
@@ -0,0 +1,34 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { mountSuspended } from "@nuxt/test-utils/runtime";
3
+ import HomeFaq from "~/components/Home/Faq.vue";
4
+
5
+ const items = [
6
+ { question: "Wohin liefern Sie?", answer: "Nach Obertshausen." },
7
+ { question: "Wie kann ich bezahlen?", answer: "Bar oder mit EC-Karte." },
8
+ ];
9
+
10
+ describe("HomeFaq", () => {
11
+ it("renders every answer in the markup, collapsed", async () => {
12
+ const wrapper = await mountSuspended(HomeFaq, { props: { items } });
13
+
14
+ const details = wrapper.findAll("details");
15
+ expect(details).toHaveLength(2);
16
+ expect(details.every((d) => d.attributes("open") === undefined)).toBe(true);
17
+ expect(wrapper.find("summary").text()).toBe("Wohin liefern Sie?");
18
+ expect(wrapper.text()).toContain("Bar oder mit EC-Karte.");
19
+ expect(wrapper.text()).toContain("Häufige Fragen");
20
+ });
21
+
22
+ it("adds FAQPage JSON-LD to the head", async () => {
23
+ await mountSuspended(HomeFaq, { props: { items } });
24
+ // unhead renders the DOM debounced
25
+ await new Promise((resolve) => setTimeout(resolve, 50));
26
+
27
+ const schemas = [
28
+ ...document.head.querySelectorAll('script[type="application/ld+json"]'),
29
+ ].map((script) => JSON.parse(script.textContent ?? "{}"));
30
+ const schema = schemas.find((entry) => entry["@type"] === "FAQPage");
31
+ expect(schema).toBeDefined();
32
+ expect(schema!.mainEntity).toHaveLength(2);
33
+ });
34
+ });
@@ -12,6 +12,7 @@ const group = (label: string, count: number): AssociationItem => ({
12
12
  products: Array.from({ length: count }, (_, index) => ({
13
13
  label: `${label} ${index + 1}`,
14
14
  value: `${label}-${index + 1}`,
15
+ productNumber: `${label}-NR-${index + 1}`,
15
16
  price: "1.00 €",
16
17
  unitPrice: 1,
17
18
  })),
@@ -96,4 +97,23 @@ describe("ProductCrossSelling", () => {
96
97
  { value: "Extras-3" },
97
98
  ]);
98
99
  });
100
+
101
+ it("preselects extras from the URL and emits them (#411)", async () => {
102
+ const wrapper = await mountSuspended(ProductCrossSelling, {
103
+ props: {
104
+ associations: [group("Extras", 3)],
105
+ initialExtras: ["Extras-NR-2", "unknown"],
106
+ },
107
+ });
108
+
109
+ const emitted = wrapper.emitted("extras-selected");
110
+ expect(emitted?.[0]?.[0]).toEqual([
111
+ expect.objectContaining({ productNumber: "Extras-NR-2" }),
112
+ ]);
113
+ const checked = rows(wrapper).map(
114
+ (row: { attributes: (name: string) => string | undefined }) =>
115
+ row.attributes("aria-checked"),
116
+ );
117
+ expect(checked).toEqual(["false", "true", "false"]);
118
+ });
99
119
  });
@@ -0,0 +1,34 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { mountSuspended } from "@nuxt/test-utils/runtime";
3
+ import type { Schemas } from "#shopware";
4
+ import ProductDeselectIngredient from "~/components/Product/DeselectIngredient.vue";
5
+
6
+ const product = {
7
+ properties: ["Tomatensoße", "Zwiebeln", "Oliven"].map((name) => ({
8
+ group: { name: "Hauptzutaten" },
9
+ translated: { name },
10
+ })),
11
+ } as unknown as Schemas["Product"];
12
+
13
+ describe("ProductDeselectIngredient", () => {
14
+ it("starts without deselected ingredients", async () => {
15
+ const wrapper = await mountSuspended(ProductDeselectIngredient, {
16
+ props: { product },
17
+ });
18
+
19
+ expect(wrapper.emitted("ingredients-deselected")).toBeUndefined();
20
+ expect(wrapper.findAll('[aria-pressed="true"]')).toHaveLength(0);
21
+ });
22
+
23
+ it("deselects ingredients from the URL and ignores unknown names (#411)", async () => {
24
+ const wrapper = await mountSuspended(ProductDeselectIngredient, {
25
+ props: { product, initialDeselected: ["Zwiebeln", "Salami"] },
26
+ });
27
+
28
+ expect(wrapper.emitted("ingredients-deselected")?.[0]).toEqual([
29
+ ["Zwiebeln"],
30
+ ]);
31
+ const pressed = wrapper.findAll('[aria-pressed="true"]');
32
+ expect(pressed.map((button) => button.text())).toEqual(["Zwiebeln"]);
33
+ });
34
+ });
@@ -0,0 +1,76 @@
1
+ import { afterEach, describe, expect, it, vi } from "vitest";
2
+ import { mountSuspended, mockNuxtImport } from "@nuxt/test-utils/runtime";
3
+ import { defineComponent, h } from "vue";
4
+
5
+ const { add } = vi.hoisted(() => ({ add: vi.fn() }));
6
+ mockNuxtImport("useToast", () => () => ({ add }));
7
+
8
+ async function mountShare() {
9
+ let api!: ReturnType<typeof useShareLink>;
10
+ await mountSuspended(
11
+ defineComponent({
12
+ setup() {
13
+ api = useShareLink();
14
+ return () => h("div");
15
+ },
16
+ }),
17
+ );
18
+ return api;
19
+ }
20
+
21
+ describe("useShareLink", () => {
22
+ afterEach(() => {
23
+ vi.unstubAllGlobals();
24
+ add.mockReset();
25
+ });
26
+
27
+ it("uses the native share sheet when available", async () => {
28
+ const share = vi.fn().mockResolvedValue(undefined);
29
+ vi.stubGlobal("navigator", { ...navigator, share });
30
+
31
+ const api = await mountShare();
32
+ expect(api.canShare.value).toBe(true);
33
+ await api.share({ title: "Pizza" });
34
+
35
+ expect(share).toHaveBeenCalledWith({
36
+ title: "Pizza",
37
+ url: window.location.href,
38
+ });
39
+ expect(add).not.toHaveBeenCalled();
40
+ });
41
+
42
+ it("copies the link without share sheet", async () => {
43
+ const writeText = vi.fn().mockResolvedValue(undefined);
44
+ vi.stubGlobal("navigator", {
45
+ ...navigator,
46
+ share: undefined,
47
+ clipboard: { writeText },
48
+ });
49
+
50
+ const api = await mountShare();
51
+ await api.share();
52
+
53
+ expect(writeText).toHaveBeenCalledWith(window.location.href);
54
+ expect(add).toHaveBeenCalledWith(
55
+ expect.objectContaining({ title: "Link kopiert" }),
56
+ );
57
+ });
58
+
59
+ it("does nothing when the share sheet is closed", async () => {
60
+ const share = vi
61
+ .fn()
62
+ .mockRejectedValue(new DOMException("closed", "AbortError"));
63
+ const writeText = vi.fn();
64
+ vi.stubGlobal("navigator", {
65
+ ...navigator,
66
+ share,
67
+ clipboard: { writeText },
68
+ });
69
+
70
+ const api = await mountShare();
71
+ await api.share();
72
+
73
+ expect(writeText).not.toHaveBeenCalled();
74
+ expect(add).not.toHaveBeenCalled();
75
+ });
76
+ });
@@ -0,0 +1,48 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import {
3
+ AI_SEARCH_USER_AGENTS,
4
+ AI_TRAINING_USER_AGENTS,
5
+ buildAiCrawlerGroups,
6
+ } from "../../server/utils/aiCrawlers";
7
+
8
+ const disallow = ["/merkliste", "/passwort-vergessen"];
9
+
10
+ describe("buildAiCrawlerGroups", () => {
11
+ it("allows both kinds and repeats the disallow rules by default", () => {
12
+ const [search, training] = buildAiCrawlerGroups(
13
+ { search: true, training: true },
14
+ disallow,
15
+ );
16
+
17
+ expect(search).toMatchObject({
18
+ userAgent: AI_SEARCH_USER_AGENTS,
19
+ allow: ["/"],
20
+ disallow,
21
+ });
22
+ expect(training).toMatchObject({
23
+ userAgent: AI_TRAINING_USER_AGENTS,
24
+ allow: ["/"],
25
+ disallow,
26
+ });
27
+ });
28
+
29
+ it("blocks training crawlers only", () => {
30
+ const [search, training] = buildAiCrawlerGroups(
31
+ { search: true, training: false },
32
+ disallow,
33
+ );
34
+
35
+ expect(search).toMatchObject({ allow: ["/"], disallow });
36
+ expect(training).toMatchObject({ allow: [], disallow: ["/"] });
37
+ });
38
+
39
+ it("does not copy a site-wide Disallow: / into an allowed group", () => {
40
+ const [search] = buildAiCrawlerGroups({ search: true, training: true }, [
41
+ "/",
42
+ "",
43
+ "/konto",
44
+ ]);
45
+
46
+ expect(search!.disallow).toEqual(["/konto"]);
47
+ });
48
+ });
@@ -0,0 +1,149 @@
1
+ import { describe, expect, it } from "vitest";
2
+ import { buildLlmsTxt } from "../../server/utils/llmsTxt";
3
+
4
+ const now = new Date("2026-10-05T12:00:00Z");
5
+
6
+ describe("buildLlmsTxt", () => {
7
+ it("renders shop, hours, ordering, menu and pages as Markdown", () => {
8
+ const text = buildLlmsTxt({
9
+ name: "Pizzeria La Fattoria",
10
+ description: "Italienisch-deutsche Küche seit 1997.",
11
+ url: "https://www.pizzeria-lafattoria.de",
12
+ cuisine: "Italienische Küche",
13
+ address: {
14
+ street: "Kantstraße 6",
15
+ postalCode: "63179",
16
+ city: "Obertshausen",
17
+ },
18
+ telephone: "+49 6104 71427",
19
+ deliveryAreas: ["63179 Obertshausen", "63165 Lämmerspiel"],
20
+ businessHours: [1, 2, 3, 4, 5].map((dayOfWeek) => ({
21
+ dayOfWeek,
22
+ openingTime: "11:30:00",
23
+ closingTime: "22:00:00",
24
+ })),
25
+ holidays: [
26
+ // ended before `now`: left out
27
+ { start: "2026-07-12T21:00:00Z", end: "2026-08-05T22:00:00Z" },
28
+ { start: "2026-12-24T00:00:00Z", end: "2026-12-26T00:00:00Z" },
29
+ ],
30
+ isCheckoutEnabled: true,
31
+ deliveryTime: 30,
32
+ menuUrl: "https://www.pizzeria-lafattoria.de/speisekarte",
33
+ menu: [
34
+ {
35
+ name: "Pizza",
36
+ url: "https://www.pizzeria-lafattoria.de/c/Pizza/",
37
+ items: [
38
+ {
39
+ name: "Pizza Margherita",
40
+ price: 7,
41
+ fromPrice: true,
42
+ ingredients: ["Tomatensoße", "Mozzarella"],
43
+ diets: ["vegetarian"],
44
+ },
45
+ {
46
+ name: "Pizza Salami",
47
+ price: 8.5,
48
+ url: "https://www.pizzeria-lafattoria.de/c/Pizza/?produkt=22",
49
+ },
50
+ ],
51
+ },
52
+ {
53
+ name: "Nudeln",
54
+ items: [],
55
+ sections: [
56
+ {
57
+ name: "Spaghetti",
58
+ items: [
59
+ {
60
+ name: "Spaghetti Aglio e Olio",
61
+ price: 9,
62
+ diets: ["vegetarian", "vegan"],
63
+ },
64
+ ],
65
+ },
66
+ ],
67
+ },
68
+ // no products: left out
69
+ { name: "Saisonales", items: [] },
70
+ ],
71
+ pages: [
72
+ {
73
+ title: "Zahlungs- und Lieferinformationen",
74
+ url: "https://www.pizzeria-lafattoria.de/zahlung-und-versand",
75
+ description: "Zahlungs- und Lieferinformationen",
76
+ },
77
+ ],
78
+ faq: [
79
+ {
80
+ question: "Wohin liefern Sie?",
81
+ answer: "Nach Obertshausen und Lämmerspiel.",
82
+ },
83
+ ],
84
+ currency: "EUR",
85
+ now,
86
+ });
87
+
88
+ expect(text).toBe(`# Pizzeria La Fattoria
89
+
90
+ > Pizzeria La Fattoria: Italienische Küche in Obertshausen. Online bestellen zur Lieferung oder Abholung unter https://www.pizzeria-lafattoria.de.
91
+
92
+ Italienisch-deutsche Küche seit 1997.
93
+
94
+ ## Kontakt
95
+
96
+ - Adresse: Kantstraße 6, 63179 Obertshausen
97
+ - Telefon: +49 6104 71427
98
+ - Website: https://www.pizzeria-lafattoria.de
99
+
100
+ ## Öffnungszeiten
101
+
102
+ - Mo–Fr: 11:30–22:00
103
+ - Sa–So: Ruhetag
104
+ - Geschlossen: 24.12.2026 – 26.12.2026
105
+
106
+ ## Bestellen
107
+
108
+ - Online bestellen: https://www.pizzeria-lafattoria.de/speisekarte
109
+ - Liefergebiet: 63179 Obertshausen, 63165 Lämmerspiel
110
+ - Lieferzeit: ca. 30 Minuten
111
+ - Abholung im Restaurant möglich
112
+
113
+ ## Häufige Fragen
114
+
115
+ ### Wohin liefern Sie?
116
+
117
+ Nach Obertshausen und Lämmerspiel.
118
+
119
+ ## Speisekarte
120
+
121
+ ### [Pizza](https://www.pizzeria-lafattoria.de/c/Pizza/)
122
+
123
+ - Pizza Margherita: ab 7,00 € (Tomatensoße, Mozzarella; vegetarisch)
124
+ - [Pizza Salami](https://www.pizzeria-lafattoria.de/c/Pizza/?produkt=22): 8,50 €
125
+
126
+ ### Nudeln
127
+
128
+ #### Spaghetti
129
+
130
+ - Spaghetti Aglio e Olio: 9,00 € (vegan)
131
+
132
+ ## Weitere Informationen
133
+
134
+ - [Zahlungs- und Lieferinformationen](https://www.pizzeria-lafattoria.de/zahlung-und-versand)
135
+ `);
136
+ });
137
+
138
+ it("leaves out what is not configured", () => {
139
+ expect(buildLlmsTxt({ name: "ShopBite", url: "https://example.com", now }))
140
+ .toBe(`# ShopBite
141
+
142
+ > ShopBite.
143
+
144
+ ## Kontakt
145
+
146
+ - Website: https://example.com
147
+ `);
148
+ });
149
+ });
@@ -1,7 +1,9 @@
1
1
  import { describe, expect, it } from "vitest";
2
2
  import type { Schemas } from "#shopware";
3
3
  import {
4
+ getDiets,
4
5
  getMainIngredients,
6
+ hasYesOption,
5
7
  lineItemHoldsProduct,
6
8
  productIsAvailable,
7
9
  } from "../../app/utils/product";
@@ -70,3 +72,21 @@ describe("getMainIngredients", () => {
70
72
  expect(getMainIngredients([group("Küche", ["Italienisch"])])).toEqual([]);
71
73
  });
72
74
  });
75
+
76
+ describe("hasYesOption", () => {
77
+ it("needs the option Ja in the named group", () => {
78
+ const properties = [group("Vegetarisch", ["Ja"]), group("Vegan", ["Nein"])];
79
+ expect(hasYesOption(properties, "Vegetarisch")).toBe(true);
80
+ expect(hasYesOption(properties, "Vegan")).toBe(false);
81
+ expect(hasYesOption(undefined, "Vegetarisch")).toBe(false);
82
+ });
83
+ });
84
+
85
+ describe("getDiets", () => {
86
+ it("returns the marked diets", () => {
87
+ expect(
88
+ getDiets([group("Vegetarisch", ["Ja"]), group("Vegan", ["Ja"])]),
89
+ ).toEqual(["vegetarian", "vegan"]);
90
+ expect(getDiets([group("Hauptzutaten", ["Salami"])])).toEqual([]);
91
+ });
92
+ });