From 8081a149978ac29433dc483fb52ee863284a5298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Barb=C3=A9?= Date: Fri, 29 Sep 2023 14:55:29 +0200 Subject: [PATCH] retrict updates of links to the one with empty link (#366) --- blocks/products/products.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/blocks/products/products.js b/blocks/products/products.js index a7f3e1e02..0b3f56023 100644 --- a/blocks/products/products.js +++ b/blocks/products/products.js @@ -373,12 +373,13 @@ export default function decorate(block) { renderNanoBlocks(col, mv); - // listen to ProductCard change and update the first button accordingly + // listen to ProductCard change and update the buttons pointing to the store url mv.subscribe((card) => { - const link = col.querySelector('.button-container a'); - if (link) { - link.href = card.url; - } + col.querySelectorAll('.button-container a').forEach((link) => { + if (link && link.href === 'https://www.bitdefender.com/site/Store/buy/') { + link.href = card.url; + } + }); }); }); row.remove();