Skip to content

Commit

Permalink
feat: add preferDescription in legacyLoader (#1022)
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielMatosBoubee authored Feb 25, 2025
1 parent fdc26a5 commit 0f0124e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion vtex/loaders/legacy/productDetailsPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
Expand Down
3 changes: 3 additions & 0 deletions vtex/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> = T | null | undefined;

0 comments on commit 0f0124e

Please sign in to comment.