diff --git a/v3/src/pages/ar/pricing.astro b/v3/src/pages/ar/pricing.astro index 5fe7e5f..b7d5371 100644 --- a/v3/src/pages/ar/pricing.astro +++ b/v3/src/pages/ar/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'لا', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/de/pricing.astro b/v3/src/pages/de/pricing.astro index 1548efc..057afea 100644 --- a/v3/src/pages/de/pricing.astro +++ b/v3/src/pages/de/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'Nein', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/es/pricing.astro b/v3/src/pages/es/pricing.astro index 41e3f0f..5664136 100644 --- a/v3/src/pages/es/pricing.astro +++ b/v3/src/pages/es/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'No', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/fr/pricing.astro b/v3/src/pages/fr/pricing.astro index 66aab9e..0b169b5 100644 --- a/v3/src/pages/fr/pricing.astro +++ b/v3/src/pages/fr/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'Non', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/it/pricing.astro b/v3/src/pages/it/pricing.astro index 3db6eeb..6b098a1 100644 --- a/v3/src/pages/it/pricing.astro +++ b/v3/src/pages/it/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'No', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/ja/pricing.astro b/v3/src/pages/ja/pricing.astro index f396c1f..6a041ef 100644 --- a/v3/src/pages/ja/pricing.astro +++ b/v3/src/pages/ja/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: 'いいえ', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/ko/pricing.astro b/v3/src/pages/ko/pricing.astro index f645a26..e5cac6e 100644 --- a/v3/src/pages/ko/pricing.astro +++ b/v3/src/pages/ko/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: '아니오', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/pricing.astro b/v3/src/pages/pricing.astro index 2ef42fc..9fd2997 100644 --- a/v3/src/pages/pricing.astro +++ b/v3/src/pages/pricing.astro @@ -35,7 +35,18 @@ const metadata = { cancelButtonText: 'No', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + // Fallback if URL API fails for any reason + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/pt/pricing.astro b/v3/src/pages/pt/pricing.astro index 80d59d8..a15e45f 100644 --- a/v3/src/pages/pt/pricing.astro +++ b/v3/src/pages/pt/pricing.astro @@ -35,7 +35,19 @@ const metadata = { cancelButtonText: 'Não', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search + ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) + : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); } diff --git a/v3/src/pages/zh-cn/pricing.astro b/v3/src/pages/zh-cn/pricing.astro index 262d4d0..270e406 100644 --- a/v3/src/pages/zh-cn/pricing.astro +++ b/v3/src/pages/zh-cn/pricing.astro @@ -37,7 +37,22 @@ const metadata = { cancelButtonText: '否', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl + '¤cy=cny', '_blank'); + try { + const url = new URL(redirectUrl); + // Ensure currency=cny for zh-cn + if (!url.searchParams.has('currency')) url.searchParams.set('currency', 'cny'); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search + ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) + : ''; + const sep = (redirectUrl + qs).includes('?') ? '&' : '?'; + window.open(redirectUrl + qs + sep + 'currency=cny', '_blank'); + } } }); } diff --git a/v3/src/pages/zh-tw/pricing.astro b/v3/src/pages/zh-tw/pricing.astro index ab9ffde..fb4a4cc 100644 --- a/v3/src/pages/zh-tw/pricing.astro +++ b/v3/src/pages/zh-tw/pricing.astro @@ -35,7 +35,17 @@ const metadata = { cancelButtonText: '否', }).then((result) => { if (result.isConfirmed) { - window.open(redirectUrl, '_blank'); + try { + const url = new URL(redirectUrl); + const pageParams = new URLSearchParams(window.location.search); + pageParams.forEach((value, key) => { + if (!url.searchParams.has(key)) url.searchParams.append(key, value); + }); + window.open(url.toString(), '_blank'); + } catch (e) { + const qs = window.location.search ? (redirectUrl.includes('?') ? '&' : '?') + window.location.search.slice(1) : ''; + window.open(redirectUrl + qs, '_blank'); + } } }); }