Keep shoppers on mozimo.in: internalize all marketing links
- gifting tab CTAs now point at our /collections pages (seed defaults + one-off PB migration rewriting shop.mozimo.in cta_urls, idempotent) - Hero/Footer/our-world/journal 'shop' links -> /chocolate; bespoke bulk-ordering -> /gifting#corporate-bulk - still on Shopify (deliberate, until Phase 2): PDP buy button, Header bag+account, footer policies
This commit is contained in:
+25
-5
@@ -48,7 +48,7 @@ const GIFTING_TABS = [
|
||||
product_handles: "mozimo-dark-chocolate-bar-85\n9-pralines-box\nbars-box",
|
||||
collection_handle: "gift-collection",
|
||||
cta_label: "View all Signature gifts",
|
||||
cta_url: "https://shop.mozimo.in/collections/gift-collection",
|
||||
cta_url: "/collections/gift-collection",
|
||||
sort: 1,
|
||||
visible: true,
|
||||
},
|
||||
@@ -64,7 +64,7 @@ const GIFTING_TABS = [
|
||||
"pistachio-spread-60\nmozimo-almond-dragees-60\nkunafa-chocolate-bar\nspreads-box",
|
||||
collection_handle: "best-sellers",
|
||||
cta_label: "Shop Best Sellers",
|
||||
cta_url: "https://shop.mozimo.in/collections/best-sellers",
|
||||
cta_url: "/collections/best-sellers",
|
||||
sort: 2,
|
||||
visible: true,
|
||||
},
|
||||
@@ -80,7 +80,7 @@ const GIFTING_TABS = [
|
||||
"mozimo-carnival-celebration-s\nmozimo-carnival-celebration-m",
|
||||
collection_handle: "gift-collection",
|
||||
cta_label: "View the full collection",
|
||||
cta_url: "https://shop.mozimo.in/collections/gift-collection",
|
||||
cta_url: "/collections/gift-collection",
|
||||
sort: 3,
|
||||
visible: true,
|
||||
},
|
||||
@@ -95,7 +95,7 @@ const GIFTING_TABS = [
|
||||
product_handles: "mozimo-carnival-celebration-l\nmozimo-celestial-s",
|
||||
collection_handle: "gift-collection",
|
||||
cta_label: "View the full collection",
|
||||
cta_url: "https://shop.mozimo.in/collections/gift-collection",
|
||||
cta_url: "/collections/gift-collection",
|
||||
sort: 4,
|
||||
visible: true,
|
||||
},
|
||||
@@ -109,7 +109,7 @@ const GIFTING_TABS = [
|
||||
tile_url: "/products/mozi-30.jpg",
|
||||
collection_handle: "gift-collection",
|
||||
cta_label: "Shop the Seasonal Edit",
|
||||
cta_url: "https://shop.mozimo.in/collections/gift-collection",
|
||||
cta_url: "/collections/gift-collection",
|
||||
sort: 5,
|
||||
visible: true,
|
||||
},
|
||||
@@ -455,6 +455,26 @@ async function main() {
|
||||
console.log(
|
||||
`[pb-seed] "${name}" already has ${existing.body.totalItems} record(s) — leaving as is`,
|
||||
);
|
||||
// one-off migration: gifting tab CTAs must keep users on mozimo.in,
|
||||
// never bounce them out to the shopify domain
|
||||
if (name === "gifting_tabs") {
|
||||
const all = await authed(`/api/collections/${name}/records?perPage=100`);
|
||||
for (const rec of all.body.items ?? []) {
|
||||
const url = rec.cta_url ?? "";
|
||||
if (url.startsWith("https://shop.mozimo.in/")) {
|
||||
const internal = url.replace("https://shop.mozimo.in", "");
|
||||
const patched = await authed(`/api/collections/${name}/records/${rec.id}`, {
|
||||
method: "PATCH",
|
||||
body: JSON.stringify({ cta_url: internal }),
|
||||
});
|
||||
if (patched.ok) {
|
||||
console.log(`[pb-seed] migrated cta_url for "${rec.name}" -> ${internal}`);
|
||||
} else {
|
||||
console.warn(`[pb-seed] cta migration failed for "${rec.name}":`, patched.status);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
continue;
|
||||
}
|
||||
for (const record of SEEDS[name]) {
|
||||
|
||||
Reference in New Issue
Block a user