From 0f0124e8f62a43bf5f10552f6880ba1e6ed35d00 Mon Sep 17 00:00:00 2001 From: Gabriel Matos Boubee <108771428+gabrielMatosBoubee@users.noreply.github.com> Date: Tue, 25 Feb 2025 13:48:48 -0300 Subject: [PATCH] feat: add preferDescription in legacyLoader (#1022) --- vtex/loaders/legacy/productDetailsPage.ts | 4 +++- vtex/utils/types.ts | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/vtex/loaders/legacy/productDetailsPage.ts b/vtex/loaders/legacy/productDetailsPage.ts index 73941baa2..e3d3ea9bc 100644 --- a/vtex/loaders/legacy/productDetailsPage.ts +++ b/vtex/loaders/legacy/productDetailsPage.ts @@ -101,7 +101,9 @@ async function loader( : page.product, seo: { title: product.productTitle || product.productName, - description: product.metaTagDescription, + description: props.advancedConfigs?.preferDescription + ? product.description + : product.metaTagDescription, canonical: new URL(`/${product.linkText}/p`, url.origin).href, noIndexing: props.indexingSkus ? false : !!skuId, }, diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index c87b84357..89b86ec21 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1520,6 +1520,9 @@ export interface Promotion { export interface AdvancedLoaderConfig { /** @description Specifies an array of attribute names from the original object to be directly included in the transformed object. */ includeOriginalAttributes: string[]; + + /** @description Allow this field if you prefer to use description instead of metaTagDescription */ + preferDescription?: boolean; } export type Maybe = T | null | undefined;