From c666565669993da3552bc4498822ea19cfbd816a Mon Sep 17 00:00:00 2001 From: guitavano Date: Thu, 9 Jul 2026 16:17:57 -0300 Subject: [PATCH] fix(vtex): check for :slug prefix instead of just : in PDP loaders The slug check was too broad, matching any string starting with ":" instead of specifically checking for the ":slug" placeholder. Co-Authored-By: Claude Opus 4.6 --- vtex/loaders/intelligentSearch/productDetailsPage.ts | 2 +- vtex/loaders/legacy/productDetailsPage.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vtex/loaders/intelligentSearch/productDetailsPage.ts b/vtex/loaders/intelligentSearch/productDetailsPage.ts index 0e593f551..62d1eb22f 100644 --- a/vtex/loaders/intelligentSearch/productDetailsPage.ts +++ b/vtex/loaders/intelligentSearch/productDetailsPage.ts @@ -71,7 +71,7 @@ const loader = async ( const { vcsDeprecated } = ctx; const { url: baseUrl } = req; const { slug } = props; - const haveToUseSlug = slug && !slug.startsWith(":"); + const haveToUseSlug = slug && !slug.startsWith(":slug"); let defaultPaths; if (!haveToUseSlug) { diff --git a/vtex/loaders/legacy/productDetailsPage.ts b/vtex/loaders/legacy/productDetailsPage.ts index 7691ec71f..977a623b2 100644 --- a/vtex/loaders/legacy/productDetailsPage.ts +++ b/vtex/loaders/legacy/productDetailsPage.ts @@ -45,7 +45,7 @@ async function loader( const { vcsDeprecated } = ctx; const { url: baseUrl } = req; const { slug } = props; - const haveToUseSlug = slug && !slug.startsWith(":"); + const haveToUseSlug = slug && !slug.startsWith(":slug"); let defaultPaths; if (!haveToUseSlug) { defaultPaths = await PDPDefaultPath({ count: 1 }, req, ctx);