Shop-Feinschliff: neue Honigtexte, Seife, Essig, Reihenfolge
- Kategorien: erst alle Produkte, dann Gutschein, Patenschaft, Kurs, Abo - Gutschein und Kurs ohne Versand-, Lieferzeit- und Abfüllhinweise - Neue Beschreibungen für elf Honigsorten, Subline für Himbeerblüte - Honig-Seife: handgemacht im Untertitel, Text mit INCI-Liste - Shop-Raster zeigt den Untertitel auch bei Nicht-Honig-Produkten - Honig-Balsamico-Essig 0,25 l für 12,90 €, Grundpreis je Liter - Honiglöffel 5,90 € - Automaten: neuer Titel und Text Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,19 @@ export function formatGrundpreis(amount: number, netWeightGrams: number): string
|
||||
return `${formatEUR(perKg)}/kg`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Grundpreis aus den Metadaten einer Variante: je Kilogramm bei
|
||||
* `net_weight_grams`, je Liter bei `net_volume_ml` (z. B. Essig).
|
||||
*/
|
||||
export function grundpreisAus(
|
||||
amount: number,
|
||||
metadata?: { net_weight_grams?: number; net_volume_ml?: number } | null
|
||||
): string | null {
|
||||
if (metadata?.net_weight_grams) return formatGrundpreis(amount, metadata.net_weight_grams);
|
||||
if (metadata?.net_volume_ml) return `${formatEUR((amount / metadata.net_volume_ml) * 1000)}/l`;
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Wie formatEUR, aber ohne "‚00" bei glatten Beträgen — "60 €" statt
|
||||
* "60,00 €". Für Angaben wie die Versandfreigrenze, die immer rund ist.
|
||||
|
||||
@@ -106,6 +106,8 @@ export interface MedusaVariant {
|
||||
calculated_price?: { calculated_amount: number; currency_code: string };
|
||||
metadata?: {
|
||||
net_weight_grams?: number;
|
||||
/** Füllmenge in Millilitern bei Flüssigkeiten; Grundpreis dann je Liter. */
|
||||
net_volume_ml?: number;
|
||||
/** Nur am Abo-Produkt: "monthly" | "quarterly" | "biannual". */
|
||||
subscription_interval?: string;
|
||||
/** Nur am Abo-Produkt: Glasgröße, z. B. "250 Gramm". */
|
||||
|
||||
@@ -23,7 +23,7 @@ export interface Variety {
|
||||
match: string;
|
||||
/** Sortenname laut Briefing. */
|
||||
name: string;
|
||||
/** Subline laut Briefing. Fehlt im Briefing bei Himbeerblütenhonig. */
|
||||
/** Subline laut Briefing. */
|
||||
subline?: string;
|
||||
collection: Collection;
|
||||
/**
|
||||
@@ -86,8 +86,8 @@ export const varieties: Variety[] = [
|
||||
{ match: "akazienhonig", name: "Akazienhonig", subline: "Mild. Klar. Elegant.", collection: "country", color: FARBWELT.stone },
|
||||
{ match: "sonnenblumenhonig", name: "Sonnenblumenhonig", subline: "Gute Laune pur", collection: "country", color: FARBWELT.apricot },
|
||||
{ match: "waldhonig", name: "Waldhonig", subline: "Die Kraft des Waldes", collection: "country", color: FARBWELT.forest },
|
||||
// Im Briefing ohne Subline — hier bewusst leer statt erfunden.
|
||||
{ match: "himbeerblütenhonig", name: "Himbeerblütenhonig", collection: "country", color: FARBWELT.rust },
|
||||
// Im Briefing ohne Subline; ergänzt nach Rückmeldung, Wortlaut noch offen.
|
||||
{ match: "himbeerblütenhonig", name: "Himbeerblütenhonig", subline: "Fruchtig. Fein. Selten.", collection: "country", color: FARBWELT.rust },
|
||||
{ match: "heidehonig", name: "Heidehonig", subline: "Der Charakter des Nordens", collection: "country", color: FARBWELT.heather },
|
||||
{ match: "kornblumenhonig", name: "Kornblumenhonig", subline: "Zwischen Himmel und Kornfeld", collection: "country", color: FARBWELT.cornflower },
|
||||
// Das Briefing nennt die Sorte "Traditionshonig", im Katalog heißt sie
|
||||
|
||||
@@ -39,8 +39,8 @@ const standorte = automaten.map((automat, i) => ({
|
||||
>
|
||||
<PageHero
|
||||
label="Rund um die Uhr"
|
||||
title="Honig aus dem Automaten"
|
||||
lede="Acht Automaten in Hamburg, jeden Tag geöffnet. Kein Ladenschluss, keine Schlange — Glas ziehen und mitnehmen."
|
||||
title="Lust auf Honig & Co.? Jetzt 10x in Hamburg!"
|
||||
lede="Ab sofort gibt es alle unsere Produkte in unseren eigenen PLACE4BEES Honigautomaten in Hamburg. Jeden Tag geöffnet, kein Ladenschluss, keine Schlange — Glas ziehen und mitnehmen."
|
||||
/>
|
||||
|
||||
<section class="brand-section bg-brand-surface py-[var(--section-y)]">
|
||||
|
||||
@@ -71,6 +71,7 @@ export const GET: APIRoute = async () => {
|
||||
<g:brand>PLACE4BEES</g:brand>
|
||||
<g:identifier_exists>no</g:identifier_exists>
|
||||
${variante.metadata?.net_weight_grams ? `<g:unit_pricing_measure>${variante.metadata.net_weight_grams} g</g:unit_pricing_measure>\n <g:unit_pricing_base_measure>1000 g</g:unit_pricing_base_measure>` : ""}
|
||||
${variante.metadata?.net_volume_ml ? `<g:unit_pricing_measure>${variante.metadata.net_volume_ml} ml</g:unit_pricing_measure>\n <g:unit_pricing_base_measure>1 l</g:unit_pricing_base_measure>` : ""}
|
||||
<g:google_product_category>424</g:google_product_category>
|
||||
</item>`
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import SubscriptionOptions from "../../components/SubscriptionOptions.astro";
|
||||
import SponsorshipOptions from "../../components/SponsorshipOptions.astro";
|
||||
import GiftVoucherOptions from "../../components/GiftVoucherOptions.astro";
|
||||
import { getProductByHandle, getDefaultRegion, listHoneyVarieties, getShopSettings, getGiftShippingSurcharge } from "../../lib/medusa";
|
||||
import { formatEUR, formatEURKurz, formatGrundpreis } from "../../lib/format";
|
||||
import { formatEUR, formatEURKurz, grundpreisAus } from "../../lib/format";
|
||||
import { findVariety, COLLECTION_LABELS } from "../../lib/varieties";
|
||||
import { PRIMARY_DOMAIN } from "../../lib/sections";
|
||||
|
||||
@@ -24,10 +24,9 @@ const infoByVariant = Object.fromEntries(
|
||||
variant.id,
|
||||
{
|
||||
price: variant.calculated_price ? formatEUR(variant.calculated_price.calculated_amount) : "",
|
||||
grundpreis:
|
||||
variant.calculated_price && variant.metadata?.net_weight_grams
|
||||
? formatGrundpreis(variant.calculated_price.calculated_amount, variant.metadata.net_weight_grams)
|
||||
: null,
|
||||
grundpreis: variant.calculated_price
|
||||
? grundpreisAus(variant.calculated_price.calculated_amount, variant.metadata)
|
||||
: null,
|
||||
// Only set in the Medusa admin per variant (Produkt → Variante →
|
||||
// Bild) — most variants don't have one yet, so the gallery simply
|
||||
// doesn't switch for those until someone assigns one.
|
||||
@@ -50,6 +49,9 @@ const isSponsorship = Boolean(product.metadata?.sponsorship);
|
||||
// Der Geschenkgutschein kommt per E-Mail: kein Versand, keine Lieferzeit,
|
||||
// dafür wahlweise die Adresse des Beschenkten.
|
||||
const isGiftVoucher = Boolean(product.metadata?.gift_voucher);
|
||||
// Beim Kurs wird nichts verschickt und nichts abgefüllt.
|
||||
const isCourse = categoryName === "Kurse";
|
||||
const ohneVersand = isGiftVoucher || isCourse;
|
||||
const honeyVarieties = isSubscription ? await listHoneyVarieties(region.id) : [];
|
||||
|
||||
// Beim Geschenk-Abo: ob jedes Paket seinen Versand trägt. Steht als
|
||||
@@ -208,7 +210,7 @@ const brotkrumenDaten = {
|
||||
{/* Die Eckdaten standen bisher als Tabelle unter dem Kaufknopf und
|
||||
damit hinter der Entscheidung. Jetzt stehen sie davor. */}
|
||||
<ul class="eckdaten mt-8">
|
||||
{freeShippingThreshold != null && !isGiftVoucher && (
|
||||
{freeShippingThreshold != null && !ohneVersand && (
|
||||
<li>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true">
|
||||
<circle cx="12" cy="12" r="9" />
|
||||
@@ -235,7 +237,7 @@ const brotkrumenDaten = {
|
||||
Restguthaben bleibt erhalten
|
||||
</li>
|
||||
)}
|
||||
{deliveryTime && !isGiftVoucher && (
|
||||
{deliveryTime && !ohneVersand && (
|
||||
<li>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true">
|
||||
<rect x="1" y="6" width="14" height="11" rx="1.5" />
|
||||
@@ -253,6 +255,7 @@ const brotkrumenDaten = {
|
||||
</svg>
|
||||
Regional aus Hamburg
|
||||
</li>
|
||||
{!ohneVersand && (
|
||||
<li>
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" aria-hidden="true">
|
||||
<path d="M12 20c0-6 3.5-9.5 8-10-.5 6-4 9.5-8 10z" stroke-linejoin="round" />
|
||||
@@ -261,6 +264,7 @@ const brotkrumenDaten = {
|
||||
</svg>
|
||||
Nachhaltig, von Hand abgefüllt
|
||||
</li>
|
||||
)}
|
||||
</ul>
|
||||
|
||||
<div>
|
||||
|
||||
@@ -3,7 +3,7 @@ export const prerender = false;
|
||||
|
||||
import Layout from "../../layouts/Layout.astro";
|
||||
import { listProducts, getDefaultRegion } from "../../lib/medusa";
|
||||
import { formatEUR, formatGrundpreis } from "../../lib/format";
|
||||
import { formatEUR, grundpreisAus } from "../../lib/format";
|
||||
import { CLAIM } from "../../lib/sections";
|
||||
import {
|
||||
findVariety,
|
||||
@@ -42,9 +42,9 @@ function priceLabel(product: (typeof products)[number]) {
|
||||
}
|
||||
|
||||
function grundpreisLabel(product: (typeof products)[number]) {
|
||||
const variant = product.variants.find((v) => v.metadata?.net_weight_grams);
|
||||
if (!variant?.calculated_price || !variant.metadata?.net_weight_grams) return null;
|
||||
return formatGrundpreis(variant.calculated_price.calculated_amount, variant.metadata.net_weight_grams);
|
||||
const variant = product.variants.find((v) => v.metadata?.net_weight_grams || v.metadata?.net_volume_ml);
|
||||
if (!variant?.calculated_price) return null;
|
||||
return grundpreisAus(variant.calculated_price.calculated_amount, variant.metadata);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -239,7 +239,11 @@ const groups = [
|
||||
{/* Der kurze Sortenname aus dem Briefing statt des vollen
|
||||
Katalogtitels — der beschreibende Teil steht darunter. */}
|
||||
<h3 class="shop-karte-titel">{varietyName(product.title)}</h3>
|
||||
{variety?.subline && <p class="shop-karte-unterzeile">{variety.subline}</p>}
|
||||
{/* Ohne Sorte der Untertitel aus Medusa — so steht z. B. bei der
|
||||
eigenen Seife „handgemacht" direkt neben der Fertigware. */}
|
||||
{(variety?.subline ?? product.subtitle) && (
|
||||
<p class="shop-karte-unterzeile">{variety?.subline ?? product.subtitle}</p>
|
||||
)}
|
||||
{price && <p class="shop-karte-preis">{price}</p>}
|
||||
{grundpreis && <p class="shop-karte-grundpreis">{grundpreis}</p>}
|
||||
</article>
|
||||
|
||||
Reference in New Issue
Block a user