From 56d20099db754ca14dbc38b6b13f08f04dc2a112 Mon Sep 17 00:00:00 2001 From: "iconstantin@bitdefender.com" Date: Thu, 16 Jan 2025 12:52:01 +0200 Subject: [PATCH] added option to add extraParameters in thebuy links from Target using buyLinks mbox --- _src/scripts/libs/store/store.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/_src/scripts/libs/store/store.js b/_src/scripts/libs/store/store.js index 17249e792..2fdd431ea 100644 --- a/_src/scripts/libs/store/store.js +++ b/_src/scripts/libs/store/store.js @@ -431,6 +431,13 @@ export class Product { buyLink = new URL(Store.targetBuyLinkMappings[this.productAlias][productVariation]); } + // if there are extra parameters which need to be added to the links, add them + if (Store.targetBuyLinkMappings.extraParameters) { + Store.targetBuyLinkMappings.extraParameters.forEach(extraParameter => { + buyLink.searchParams.set(extraParameter.key, extraParameter.value); + }); + } + if (window.UC_UI) { buyLink.searchParams.set("ucControllerId", window.UC_UI.getControllerId()); }