From 088326927d3c4e9801d526d18d6f03fa46800be7 Mon Sep 17 00:00:00 2001 From: Raja-danaher Date: Thu, 12 Dec 2024 14:36:57 +0530 Subject: [PATCH 1/5] code update 1311. --- blocks/product-hero/product-hero.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/blocks/product-hero/product-hero.js b/blocks/product-hero/product-hero.js index de3ccff4..e062e9f3 100644 --- a/blocks/product-hero/product-hero.js +++ b/blocks/product-hero/product-hero.js @@ -6,6 +6,7 @@ import { getProductResponse, } from '../../scripts/commerce.js'; import { createOptimizedS7Picture, decorateModals } from '../../scripts/scripts.js'; +import { getMetadata } from '../../scripts/lib-franklin.js'; function showImage(e) { const selectedImage = document.querySelector('.image-content picture'); @@ -164,18 +165,17 @@ async function addToQuote(product) { export default async function decorate(block) { const titleEl = block.querySelector('h1'); + const h1Value = getMetadata('h1'); titleEl?.classList.add('title'); titleEl?.parentElement.parentElement.remove(); const response = await getProductResponse(); if (response?.length > 0) { - // Issue : 1311-products-title-metadata-fix - // document.title = response[0].Title ? response[0].Title : 'Danaher Product'; const allImages = response[0]?.raw.images; const verticalImageGallery = imageSlider(allImages, response[0]?.Title); const defaultContent = div(); defaultContent.innerHTML = response[0]?.raw.richdescription; defaultContent.prepend(span({ class: 'sku hidden' }, response[0]?.raw.productid)); - defaultContent.prepend(titleEl || h1({ class: 'title' }, response[0]?.Title)); + defaultContent.prepend(h1({ class: 'title' }, h1Value || response[0]?.raw.titlelsig)); defaultContent.prepend(span({ class: 'categories hidden' }, response[0]?.raw.categories)); defaultContent.prepend(span({ class: 'category-name' }, response[0]?.raw?.defaultcategoryname ? response[0]?.raw?.defaultcategoryname : '')); const rfqEl = block.querySelector(':scope > div:nth-child(1)'); From a1f1be27d97607d6910a56d31e8a6ebfb9b1981f Mon Sep 17 00:00:00 2001 From: Raja-danaher Date: Thu, 12 Dec 2024 14:40:57 +0530 Subject: [PATCH 2/5] code update --- blocks/product-hero/product-hero.js | 1 + 1 file changed, 1 insertion(+) diff --git a/blocks/product-hero/product-hero.js b/blocks/product-hero/product-hero.js index e062e9f3..b6454592 100644 --- a/blocks/product-hero/product-hero.js +++ b/blocks/product-hero/product-hero.js @@ -166,6 +166,7 @@ async function addToQuote(product) { export default async function decorate(block) { const titleEl = block.querySelector('h1'); const h1Value = getMetadata('h1'); + titleEl?.classList.add('title'); titleEl?.parentElement.parentElement.remove(); const response = await getProductResponse(); From 2aa5b23407476bf8b4a4345931420fcaa3ccf7c9 Mon Sep 17 00:00:00 2001 From: Raja-danaher Date: Thu, 12 Dec 2024 14:42:56 +0530 Subject: [PATCH 3/5] code update. --- blocks/product-hero/product-hero.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/product-hero/product-hero.js b/blocks/product-hero/product-hero.js index b6454592..e062e9f3 100644 --- a/blocks/product-hero/product-hero.js +++ b/blocks/product-hero/product-hero.js @@ -166,7 +166,6 @@ async function addToQuote(product) { export default async function decorate(block) { const titleEl = block.querySelector('h1'); const h1Value = getMetadata('h1'); - titleEl?.classList.add('title'); titleEl?.parentElement.parentElement.remove(); const response = await getProductResponse(); From f4087559bd0c88d18a83273d03a89be85c8b8265 Mon Sep 17 00:00:00 2001 From: Raja-danaher Date: Thu, 12 Dec 2024 15:02:00 +0530 Subject: [PATCH 4/5] code update --- blocks/product-hero/product-hero.js | 1 + 1 file changed, 1 insertion(+) diff --git a/blocks/product-hero/product-hero.js b/blocks/product-hero/product-hero.js index e062e9f3..afcbe455 100644 --- a/blocks/product-hero/product-hero.js +++ b/blocks/product-hero/product-hero.js @@ -165,6 +165,7 @@ async function addToQuote(product) { export default async function decorate(block) { const titleEl = block.querySelector('h1'); + const h1Value = getMetadata('h1'); titleEl?.classList.add('title'); titleEl?.parentElement.parentElement.remove(); From 058d80a2df1bd0f2fe541c8eab7b98e564d91859 Mon Sep 17 00:00:00 2001 From: Raja-danaher Date: Thu, 12 Dec 2024 15:11:16 +0530 Subject: [PATCH 5/5] code update --- blocks/product-hero/product-hero.js | 1 - 1 file changed, 1 deletion(-) diff --git a/blocks/product-hero/product-hero.js b/blocks/product-hero/product-hero.js index afcbe455..e062e9f3 100644 --- a/blocks/product-hero/product-hero.js +++ b/blocks/product-hero/product-hero.js @@ -165,7 +165,6 @@ async function addToQuote(product) { export default async function decorate(block) { const titleEl = block.querySelector('h1'); - const h1Value = getMetadata('h1'); titleEl?.classList.add('title'); titleEl?.parentElement.parentElement.remove();