[object Object]

← back to Dw Domain Fleet

render: route PDP buy CTA + main-store anchor + canonical through clean slug (kills vendor-handle DOM leak)

a85eb02cff0d1507d88395c8e3f46c7b505a68dd · 2026-05-31 13:22:11 -0700 · Steve Abrams

Files touched

Diff

commit a85eb02cff0d1507d88395c8e3f46c7b505a68dd
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 13:22:11 2026 -0700

    render: route PDP buy CTA + main-store anchor + canonical through clean slug (kills vendor-handle DOM leak)
---
 shared/render.js | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/shared/render.js b/shared/render.js
index 58ea85e..8c45e34 100644
--- a/shared/render.js
+++ b/shared/render.js
@@ -692,7 +692,11 @@ function productPage(cfg, p, related) {
             || scrubVendor((p.sku||p.handle||'').replace(/-Sample$/i,''))
             || 'Designer Wallcovering';
   const sku = scrubVendor(p.sku || p.handle);   // display-only; raw p.handle still used for DW-store links
-  const canonical = `${DW}/products/${encodeURIComponent(p.handle)}`;
+  // Self-canonical on the CLEAN slug (vendor-free). Was ${DW}/products/<rawHandle>,
+  // which leaked 3rd-party vendor names in the rendered <link>/JSON-LD. Buy + main-store
+  // links now route through /buy/:slug (server resolves the real handle + 302-redirects),
+  // so the vendor handle never appears in the DOM.
+  const canonical = `https://${cfg.domain}/product/${encodeURIComponent(productSlug(p))}`;
   // per-site-unique title + meta — site name makes each fleet copy distinct
   const title = `${name} — ${sku} | ${cfg.siteName}`;
   const desc = `${name} (${sku}) — ${clean(cfg.tagline)} Available through ${cfg.siteName} and Designer Wallcoverings with a free memo sample and expert order hand-holding.`;
@@ -798,11 +802,11 @@ function productPage(cfg, p, related) {
         Order a free memo sample and our team will hand-hold your order from selection
         through installation.</p>
       <a class="hero-cta__btn" style="position:static;background:var(--accent);color:#fff"
-         href="${DW}/products/${esc(p.handle)}#sample" target="_blank" rel="noopener noreferrer">
+         href="/buy/${esc(productSlug(p))}" target="_blank" rel="noopener noreferrer">
         Order Memo Sample</a>
       <p style="font-size:12px;color:var(--muted);margin:14px 0 0">
         Catalogued by Designer Wallcoverings ·
-        <a href="${canonical}" rel="noopener noreferrer" style="color:var(--accent)">View on the main store</a></p>
+        <a href="/buy/${esc(productSlug(p))}" rel="noopener noreferrer" style="color:var(--accent)">View on the main store</a></p>
     </div>
   </div>
   ${related && related.length ? `

← 49997ea Add sort <select> + density control bar to dwf homepage Feat  ·  back to Dw Domain Fleet  ·  audit: standalone storefronts outbound-href vendor leak (cdm 7fd25ca →