Compare commits

...

5 Commits

Author SHA1 Message Date
torbinus 8e86e6d5c0 Neue Fotos für Doppelbärchen, Waffeln, Lakritz und Bonbons
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 13:33:14 +01:00
torbinus 72e664f714 Shop-Reihenfolge als eigenes Migrationsskript nachziehen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:24:52 +01:00
torbinus 81b04530ef Shop: Wachs und Kerzen nach den Lebensmitteln
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:19:06 +01:00
torbinus 23483ad9c5 Zugekaufte Honigseife nicht mehr im Shop (Entwurf)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:15:48 +01:00
torbinus 44d176e42e Highlights: Zwischentitel größer
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 15:06:20 +01:00
18 changed files with 85 additions and 5 deletions
@@ -0,0 +1,9 @@
import { kategorienSortieren } from "../scripts/set-shop-feinschliff";
/**
* Reihenfolge der Kategorien noch einmal setzen: Auf dem Testsystem lief
* shop-feinschliff mit der älteren Reihenfolge (Kerzen vor den Lebensmitteln).
*/
export default async function ({ container }: any) {
await kategorienSortieren(container);
}
@@ -0,0 +1,6 @@
import snackbilder from "../scripts/set-snackbilder";
/** Läuft einmal beim Deploy (medusa db:migrate). */
export default async function ({ container }: any) {
await snackbilder({ container });
}
@@ -3,11 +3,14 @@
* *
* npx medusa exec ./src/scripts/set-shop-feinschliff.ts * npx medusa exec ./src/scripts/set-shop-feinschliff.ts
* *
* - Reihenfolge der Kategorien: erst alle Produkte, dann Gutschein, * - Reihenfolge der Kategorien: erst alles zum Essen, dann Wachs, Kerzen,
* Pflege und Zubehör, dann Gutschein,
* Patenschaft, Kurs und Abo. * Patenschaft, Kurs und Abo.
* - Text der eigenen Honig-Seife mit Zutatenliste (INCI, bei Kosmetik * - Text der eigenen Honig-Seife mit Zutatenliste (INCI, bei Kosmetik
* Pflicht). Der offene Hinweis dazu am Produkt fällt weg. * Pflicht). Der offene Hinweis dazu am Produkt fällt weg.
* - Honiglöffel ("Honigheber") kostet 5,90 €. * - Honiglöffel ("Honigheber") kostet 5,90 €.
* - Die zugekaufte Honigseife (Lavendel, Gelee Royal, Propolis) wird nicht
* mehr verkauft: Entwurf statt löschen, Bestellungen bleiben erhalten.
* *
* Wiederholbar: setzt nur Zielwerte. * Wiederholbar: setzt nur Zielwerte.
*/ */
@@ -18,11 +21,12 @@ import {
} from "@medusajs/core-flows"; } from "@medusajs/core-flows";
const REIHENFOLGE = [ const REIHENFOLGE = [
// Erst alles zum Essen, dann Wachs und Kerzen.
"honig", "honig",
"bienenprodukte",
"süßigkeiten-mit-honig", "süßigkeiten-mit-honig",
"pflegeprodukte",
"feinkost", "feinkost",
"bienenprodukte",
"pflegeprodukte",
"zubehoer", "zubehoer",
"geschenkgutschein", "geschenkgutschein",
"bienenpatenschaften", "bienenpatenschaften",
@@ -42,7 +46,8 @@ const SEIFE = {
].join("\n\n"), ].join("\n\n"),
}; };
export default async function ({ container }: any) { /** Kategorien in REIHENFOLGE bringen. Auch einzeln nutzbar (shop-reihenfolge). */
export async function kategorienSortieren(container: any) {
const query = container.resolve("query"); const query = container.resolve("query");
const logger = container.resolve("logger"); const logger = container.resolve("logger");
@@ -68,6 +73,13 @@ export default async function ({ container }: any) {
platz++; platz++;
} }
logger.info("Kategorien neu sortiert."); logger.info("Kategorien neu sortiert.");
}
export default async function ({ container }: any) {
const query = container.resolve("query");
const logger = container.resolve("logger");
await kategorienSortieren(container);
const { data: produkte } = await query.graph({ const { data: produkte } = await query.graph({
entity: "product", entity: "product",
@@ -102,4 +114,16 @@ export default async function ({ container }: any) {
}); });
} }
if (loeffel?.[0]) logger.info("Honiglöffel: 5,90 €."); if (loeffel?.[0]) logger.info("Honiglöffel: 5,90 €.");
const { data: alteSeife } = await query.graph({
entity: "product",
fields: ["id", "status"],
filters: { handle: "seife-aus-unserem-honig" },
});
if (alteSeife?.[0] && alteSeife[0].status !== "draft") {
await updateProductsWorkflow(container).run({
input: { selector: { id: alteSeife[0].id }, update: { status: "draft" } } as any,
});
logger.info("Zugekaufte Honigseife ist jetzt Entwurf und nicht mehr im Shop.");
}
} }
@@ -0,0 +1,41 @@
/**
* Neue Fotos für Honig-Doppelbärchen, Honigwaffeln, Honig-Lakritz und Honig-Bonbons.
*
* npx medusa exec ./src/scripts/set-snackbilder.ts
*
* Ersetzt die bisherigen Bilder ganz. Hauptbild ist die Packung auf
* Elfenbein, dahinter die Szenen mit Packung und der Teller.
* Die Dateien liegen im Frontend (public/images/produkte).
*
* Wiederholbar.
*/
import { updateProductsWorkflow } from "@medusajs/core-flows";
const SNACKS = [
{ handle: "gummibarchen", datei: "doppelbaerchen", szenen: ["wohnzimmer"] },
{ handle: "honigwaffeln", datei: "honigwaffeln", szenen: ["tisch"] },
{ handle: "honig-lakritze", datei: "honig-lakritz", szenen: ["wohnzimmer"] },
{ handle: "honig-bonbons", datei: "honig-bonbons", szenen: ["tisch", "unterwegs"] },
];
export default async function ({ container }: any) {
const query = container.resolve("query");
const logger = container.resolve("logger");
for (const snack of SNACKS) {
const { data } = await query.graph({ entity: "product", fields: ["id", "title"], filters: { handle: snack.handle } });
const produkt = data?.[0];
if (!produkt) {
logger.warn(`Kein Produkt mit Handle ${snack.handle}.`);
continue;
}
const bilder = ["studio", ...snack.szenen, "teller"].map((a) => `/images/produkte/produkt-${a}-${snack.datei}.jpg`);
await updateProductsWorkflow(container).run({
input: {
selector: { id: produkt.id },
update: { thumbnail: bilder[0], images: bilder.map((url) => ({ url })) },
} as any,
});
logger.info(`${produkt.title}: ${bilder.length} neue Bilder.`);
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 248 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 250 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 332 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 233 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 275 KiB

@@ -235,7 +235,7 @@ const leistungen = [
.highlights-titel { .highlights-titel {
font-family: var(--font-display); font-family: var(--font-display);
font-size: 24px; font-size: 30px;
line-height: 1.2; line-height: 1.2;
letter-spacing: -0.015em; letter-spacing: -0.015em;
color: #000; color: #000;