diff --git a/frontend/public/robots.txt b/frontend/public/robots.txt
new file mode 100644
index 0000000..ee57328
--- /dev/null
+++ b/frontend/public/robots.txt
@@ -0,0 +1,10 @@
+# Suchmaschinen dürfen alles lesen außer den Seiten, die eine Sitzung
+# brauchen oder für Suchende keinen Wert haben.
+User-agent: *
+Disallow: /warenkorb
+Disallow: /kasse
+Disallow: /konto
+Disallow: /bestellung
+Disallow: /admin
+
+Sitemap: https://place4bees.com/sitemap.xml
diff --git a/frontend/src/components/sections/BusinessHome.astro b/frontend/src/components/sections/BusinessHome.astro
index 712888b..42d63cf 100644
--- a/frontend/src/components/sections/BusinessHome.astro
+++ b/frontend/src/components/sections/BusinessHome.astro
@@ -34,7 +34,8 @@ const schritte = [
];
---
-
+
-
+
Eigene Bienen vor Ort.
Professionell betreut.
Nachhaltig erlebbar.
-
+
diff --git a/frontend/src/layouts/Layout.astro b/frontend/src/layouts/Layout.astro
index 5d36591..a7e9fa2 100644
--- a/frontend/src/layouts/Layout.astro
+++ b/frontend/src/layouts/Layout.astro
@@ -89,6 +89,31 @@ const gaId = process.env.PUBLIC_GA_ID ?? import.meta.env.PUBLIC_GA_ID ?? "";
{image && }
+ {/* Strukturierte Daten: Damit Suchmaschinen das Unternehmen als solches
+ erkennen und in der Trefferliste Name, Logo und Kontakt zeigen können.
+ Steht einmal im Layout und gilt damit für jede Seite. */}
+
+
diff --git a/frontend/src/pages/bestellung/danke.astro b/frontend/src/pages/bestellung/danke.astro
index 05c3f15..2e73294 100644
--- a/frontend/src/pages/bestellung/danke.astro
+++ b/frontend/src/pages/bestellung/danke.astro
@@ -50,6 +50,29 @@ import Layout from "../../layouts/Layout.astro";
const order = JSON.parse(raw);
el.textContent = `Bestellnummer ${order.display_id ?? order.id}. Eine Bestätigung geht an ${order.email}.`;
+ // Kaufabschluss an Google melden — aber nur, wenn zugestimmt wurde.
+ // Ohne Einwilligung ist window.gtag gar nicht erst geladen, deshalb
+ // reicht die Prüfung darauf. Der Schlüssel in sessionStorage verhindert,
+ // dass ein Neuladen der Seite denselben Kauf doppelt zählt.
+ const gemeldet = `p4b_gemeldet_${order.id}`;
+ if (window.gtag && !sessionStorage.getItem(gemeldet)) {
+ window.gtag("event", "purchase", {
+ transaction_id: order.display_id ?? order.id,
+ value: order.total ?? 0,
+ currency: (order.currency_code ?? "eur").toUpperCase(),
+ shipping: order.shipping_total ?? 0,
+ tax: order.tax_total ?? 0,
+ items: (order.items ?? []).map((posten: any) => ({
+ item_id: posten.variant_id ?? posten.id,
+ item_name: posten.product_title ?? posten.title,
+ item_variant: posten.variant_title,
+ price: posten.unit_price ?? 0,
+ quantity: posten.quantity ?? 1,
+ })),
+ });
+ sessionStorage.setItem(gemeldet, "1");
+ }
+
if (invoiceButton && order.id) {
invoiceButton.classList.remove("hidden");
invoiceButton.addEventListener("click", async () => {
diff --git a/frontend/src/pages/business/ihr-projekt.astro b/frontend/src/pages/business/ihr-projekt.astro
index b48db2f..d485ec5 100644
--- a/frontend/src/pages/business/ihr-projekt.astro
+++ b/frontend/src/pages/business/ihr-projekt.astro
@@ -83,9 +83,9 @@ const leistungen = [
style="background-image: url('/images/p4b/kontakt-bild-1.jpg')"
>
-
+
Eigene Bienen vor Ort.
Professionell betreut.
Nachhaltig erlebbar.
-
+
diff --git a/frontend/src/pages/business/kontakt.astro b/frontend/src/pages/business/kontakt.astro
index db93adb..a55eda3 100644
--- a/frontend/src/pages/business/kontakt.astro
+++ b/frontend/src/pages/business/kontakt.astro
@@ -21,9 +21,9 @@ import KontaktVersand from "../../components/KontaktVersand.astro";
style="background-image: url('/images/p4b/kontakt-bild-3.jpg')"
>
-
+
Partnerschaftliche
Vertrauensvolle
Zusammenarbeit
-
+
diff --git a/frontend/src/pages/business/philosophie.astro b/frontend/src/pages/business/philosophie.astro
index c021b7b..8ef2753 100644
--- a/frontend/src/pages/business/philosophie.astro
+++ b/frontend/src/pages/business/philosophie.astro
@@ -26,9 +26,9 @@ const werte = [
style="background-image: url('/images/p4b/philosophie-bild-15.jpg')"
>
-
+
Verantwortung.
Regionalität.
Wertschätzung.
-
+
diff --git a/frontend/src/pages/business/presse.astro b/frontend/src/pages/business/presse.astro
index 706a939..137c3db 100644
--- a/frontend/src/pages/business/presse.astro
+++ b/frontend/src/pages/business/presse.astro
@@ -37,9 +37,9 @@ const mitteilungen = [
style="background-image: url('/images/p4b/philosophie-bild-15.jpg')"
>
-
+
Verantwortung.
Regionalität.
Wertschätzung.
-
+
diff --git a/frontend/src/pages/business/ueber-uns.astro b/frontend/src/pages/business/ueber-uns.astro
index f11e654..f914399 100644
--- a/frontend/src/pages/business/ueber-uns.astro
+++ b/frontend/src/pages/business/ueber-uns.astro
@@ -35,9 +35,9 @@ const team = [
style="background-image: url('/images/p4b/ueberuns-9-scaled.jpg'); background-position: center top"
>
-
+
Eigene Bienen vor Ort.
Professionell betreut.
Nachhaltig erlebbar.
-
+
diff --git a/frontend/src/pages/index.astro b/frontend/src/pages/index.astro
index c7334d1..981987b 100644
--- a/frontend/src/pages/index.astro
+++ b/frontend/src/pages/index.astro
@@ -33,7 +33,9 @@ try {
}
if (!showBusiness || kommtVonHhonig) {
- return Astro.redirect(`/shop${Astro.url.search}`);
+ // 301 statt 302: Nur bei einer dauerhaften Weiterleitung schreiben
+ // Suchmaschinen die Bewertung auf das Ziel um.
+ return Astro.redirect(`/shop${Astro.url.search}`, 301);
}
---
diff --git a/frontend/src/pages/produktdaten.xml.ts b/frontend/src/pages/produktdaten.xml.ts
new file mode 100644
index 0000000..951a9a2
--- /dev/null
+++ b/frontend/src/pages/produktdaten.xml.ts
@@ -0,0 +1,97 @@
+import type { APIRoute } from "astro";
+import { PRIMARY_DOMAIN } from "../lib/sections";
+import { listProducts, getDefaultRegion } from "../lib/medusa";
+
+export const prerender = false;
+
+/**
+ * Produktdatenfeed für das Google Merchant Center — die Grundlage für
+ * Shopping-Anzeigen und kostenlose Produkteinträge in der Suche.
+ *
+ * Die Adresse wird im Merchant Center einmal hinterlegt, Google holt sie
+ * danach selbst regelmäßig ab. Eine Zeile je Variante, nicht je Produkt:
+ * 250 und 500 Gramm sind für Google zwei Artikel mit eigenem Preis.
+ *
+ * Ohne EAN und Herstellernummer verlangt Google die ausdrückliche Angabe
+ * `identifier_exists = no`. Für selbst abgefüllten Honig ist das richtig —
+ * sobald es Strichcodes gibt, gehört die EAN hier hinein.
+ */
+export const GET: APIRoute = async () => {
+ let produkte: any[] = [];
+ try {
+ const region = await getDefaultRegion();
+ produkte = await listProducts(region.id);
+ } catch {
+ // Lieber ein leerer Feed als ein Fehler: Google wertet einen Abbruch als
+ // Störung und meldet das Konto auffällig.
+ }
+
+ const esc = (text: unknown) =>
+ String(text ?? "")
+ .replace(/&/g, "&")
+ .replace(//g, ">");
+
+ const eintraege: string[] = [];
+
+ for (const produkt of produkte) {
+ // Was nicht versendet wird, gehört nicht in einen Shopping-Feed:
+ // Gutscheine, Patenschaften, Kurse und das Abo.
+ if (
+ produkt.metadata?.gift_voucher ||
+ produkt.metadata?.sponsorship ||
+ produkt.metadata?.subscription
+ ) {
+ continue;
+ }
+
+ const bild = produkt.thumbnail ?? produkt.images?.[0]?.url ?? "";
+ const bildUrl = bild.startsWith("http") ? bild : `${PRIMARY_DOMAIN}${bild}`;
+
+ for (const variante of produkt.variants ?? []) {
+ const preis = variante.calculated_price?.calculated_amount;
+ if (preis == null) continue;
+
+ const titel =
+ (produkt.variants?.length ?? 0) > 1 && variante.title !== "Default Title"
+ ? `${produkt.title} – ${variante.title}`
+ : produkt.title;
+
+ eintraege.push(
+ ` -
+ ${esc(variante.id)}
+ ${esc(produkt.id)}
+ ${esc(titel)}
+ ${esc(produkt.description ?? produkt.title)}
+ ${PRIMARY_DOMAIN}/shop/${esc(produkt.handle)}
+ ${bild ? `${esc(bildUrl)}` : ""}
+ in_stock
+ new
+ ${Number(preis).toFixed(2)} EUR
+ PLACE4BEES
+ no
+ ${variante.metadata?.net_weight_grams ? `${variante.metadata.net_weight_grams} g\n 1000 g` : ""}
+ 424
+
`
+ );
+ }
+ }
+
+ const xml = `
+
+
+ PLACE4BEES – Honig aus Hamburg
+ ${PRIMARY_DOMAIN}/shop
+ Regionaler Honig, Bienenprodukte und Geschenkideen aus Hamburg.
+${eintraege.join("\n")}
+
+
+`;
+
+ return new Response(xml, {
+ headers: {
+ "Content-Type": "application/xml; charset=utf-8",
+ "Cache-Control": "public, max-age=3600",
+ },
+ });
+};
diff --git a/frontend/src/pages/shop/[handle].astro b/frontend/src/pages/shop/[handle].astro
index 2ddeb03..30d3baa 100644
--- a/frontend/src/pages/shop/[handle].astro
+++ b/frontend/src/pages/shop/[handle].astro
@@ -7,6 +7,7 @@ import GiftVoucherOptions from "../../components/GiftVoucherOptions.astro";
import { getProductByHandle, getDefaultRegion, listHoneyVarieties, getShopSettings, getGiftShippingSurcharge } from "../../lib/medusa";
import { formatEUR, formatEURKurz, formatGrundpreis } from "../../lib/format";
import { findVariety, COLLECTION_LABELS } from "../../lib/varieties";
+import { PRIMARY_DOMAIN } from "../../lib/sections";
export const prerender = false;
@@ -63,9 +64,64 @@ const variety = findVariety(product.title);
// Aus den Shop-Einstellungen, damit hier nichts steht, was an der Kasse
// nicht gilt.
const { freeShippingThreshold } = await getShopSettings();
+
+// Strukturierte Daten für Suchmaschinen: Damit in der Trefferliste Preis und
+// Verfügbarkeit stehen können und nicht nur ein blauer Link. Jede Variante
+// wird als eigenes Angebot ausgewiesen, weil sich die Preise unterscheiden.
+// Die Brotkrumen darunter zeigen, wo die Seite im Shop hängt.
+const angebote = product.variants
+ .filter((v) => v.calculated_price)
+ .map((v) => ({
+ "@type": "Offer",
+ name: v.title,
+ price: (v.calculated_price!.calculated_amount).toFixed(2),
+ priceCurrency: "EUR",
+ availability: "https://schema.org/InStock",
+ url: `${PRIMARY_DOMAIN}/shop/${product.handle}`,
+ itemCondition: "https://schema.org/NewCondition",
+ }));
+
+const produktDaten = {
+ "@context": "https://schema.org",
+ "@type": "Product",
+ name: product.title,
+ description: product.description ?? product.title,
+ image: gallery.map((bild) => (bild.startsWith("http") ? bild : `${PRIMARY_DOMAIN}${bild}`)),
+ brand: { "@type": "Brand", name: "PLACE4BEES" },
+ ...(angebote.length === 1 ? { offers: angebote[0] } : {}),
+ ...(angebote.length > 1
+ ? {
+ offers: {
+ "@type": "AggregateOffer",
+ priceCurrency: "EUR",
+ lowPrice: Math.min(...angebote.map((a) => Number(a.price))).toFixed(2),
+ highPrice: Math.max(...angebote.map((a) => Number(a.price))).toFixed(2),
+ offerCount: angebote.length,
+ offers: angebote,
+ },
+ }
+ : {}),
+};
+
+const brotkrumenDaten = {
+ "@context": "https://schema.org",
+ "@type": "BreadcrumbList",
+ itemListElement: [
+ { "@type": "ListItem", position: 1, name: "Shop", item: `${PRIMARY_DOMAIN}/shop` },
+ ...(categoryName ? [{ "@type": "ListItem", position: 2, name: categoryName }] : []),
+ {
+ "@type": "ListItem",
+ position: categoryName ? 3 : 2,
+ name: product.title,
+ item: `${PRIMARY_DOMAIN}/shop/${product.handle}`,
+ },
+ ],
+};
---
+
+