Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Product compariso products #510

Open
wants to merge 1,431 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
1431 commits
Select commit Hold shift + click to select a range
4ab5f83
fix: lint
ltiseanu Aug 28, 2024
d941c6a
fix lint
ltiseanu Aug 28, 2024
208ae74
Merge pull request #170 from bitdefender/DEX-19615-creators
ltiseanu Aug 28, 2024
b05e59a
Merge pull request #171 from bitdefender/creators-block
imantescu Aug 28, 2024
91ec0c1
DEX-19813
vradulescu-bd Aug 28, 2024
b92f833
DEX-19813
vradulescu-bd Aug 28, 2024
6a864e0
fix: adding id for tos
ltiseanu Aug 28, 2024
32e42b8
Merge pull request #173 from bitdefender/DEX-19615-creators
imantescu Aug 28, 2024
d511622
feat: Add margin-bottom to new-prod-boxes for better spacing
Matei-Iordache Aug 28, 2024
f44ed8f
Merge branch 'main' into DEX-18444
Matei-Iordache Aug 28, 2024
6272d99
feat: Update dynamic buy link in new-prod-boxes
Matei-Iordache Aug 28, 2024
762ad55
add export function
Matei-Iordache Aug 28, 2024
03c3697
update creator
imantescu Aug 28, 2024
6673d22
Merge pull request #174 from bitdefender/creators-block
imantescu Aug 28, 2024
b7f87e5
Fix: create buy link if not hardcoded
ltiseanu Aug 28, 2024
e9a120f
Merge branch 'main' of https://github.com/bitdefender/www-websites in…
ltiseanu Aug 28, 2024
a4a77e7
fix - remove unnecesary condition
ltiseanu Aug 28, 2024
8ebc976
Update dynamic buy link function in new-prod-boxes
Matei-Iordache Aug 28, 2024
caf1f5d
Update dynamic buy link function in new-prod-boxes
Matei-Iordache Aug 28, 2024
5451407
Update dynamic buy link function in new-prod-boxes
Matei-Iordache Aug 28, 2024
5de9b2d
Update dynamic buy link function in new-prod-boxes
Matei-Iordache Aug 28, 2024
eb6e18d
Merge pull request #175 from bitdefender/DEX-19615-creators
inastase Aug 29, 2024
ffe8dcc
DEX-19813
vradulescu-bd Aug 29, 2024
6356d51
update creators: target blank
imantescu Aug 29, 2024
68ba448
DEX-19813
vradulescu-bd Aug 29, 2024
644303a
Merge pull request #177 from bitdefender/creators-block
imantescu Aug 29, 2024
3622890
update creator after feedback
imantescu Aug 29, 2024
9601a4e
update creators after feedback
imantescu Aug 29, 2024
55b69f1
Merge pull request #178 from bitdefender/creators-update
imantescu Aug 29, 2024
2a52700
Update dynamic buy link function in new-prod-boxes
Matei-Iordache Aug 29, 2024
a7de3e7
Merge branch 'main' into DEX-18444
Matei-Iordache Aug 29, 2024
406b2c0
Linting fix
Matei-Iordache Aug 29, 2024
0b7b15e
refactor: Adjust dropdown-box layout and logic
Matei-Iordache Aug 29, 2024
a3b5a9f
Merge branch 'main' into DEX-19788
Matei-Iordache Aug 29, 2024
2ef91a6
updates
ltiseanu Aug 29, 2024
8b8d3ef
Merge branch 'main' of https://github.com/bitdefender/www-websites in…
ltiseanu Aug 29, 2024
ea55239
Merge pull request #166 from bitdefender/DEX-19788
Matei-Iordache Aug 29, 2024
3988e2b
New Updates creators
ltiseanu Aug 29, 2024
a34f513
Merge pull request #179 from bitdefender/DEX-19615-creators
inastase Aug 29, 2024
22928a0
adding new price near biling text
ltiseanu Aug 29, 2024
7685a09
fix
ltiseanu Aug 29, 2024
452754a
adding font for creators
ltiseanu Aug 29, 2024
f0625eb
fix lint
ltiseanu Aug 29, 2024
d1c6c20
Merge pull request #180 from bitdefender/DEX-19615-creators
ltiseanu Aug 29, 2024
e98e54a
Merge branch 'main' into DEX-18444
Matei-Iordache Aug 29, 2024
87cbd3e
Solve conflicts
Matei-Iordache Aug 29, 2024
456e1a6
Merge pull request #176 from bitdefender/DEX-18444
Matei-Iordache Aug 29, 2024
9ad0aab
Merge branch 'main' into DEX-19271
Matei-Iordache Aug 30, 2024
c872024
Merge pull request #141 from bitdefender/DEX-19271
Matei-Iordache Aug 30, 2024
3be18ae
update mobile version creators page
imantescu Aug 30, 2024
7e2285d
update creators page
imantescu Aug 30, 2024
db6b62e
Merge pull request #181 from bitdefender/creators-update
enake Aug 30, 2024
0c32051
update creators page
imantescu Aug 30, 2024
97366f3
Merge pull request #182 from bitdefender/creators-update
enake Aug 30, 2024
cbce47e
Merge branch 'main' of https://github.com/bitdefender/www-websites in…
ltiseanu Sep 1, 2024
08b8e47
update css creators page
imantescu Sep 2, 2024
695f9b8
Merge pull request #183 from bitdefender/creators-page
imantescu Sep 2, 2024
95106ec
chore: Update product-comparison-table CSS and JS
Matei-Iordache Sep 2, 2024
c9903b1
Merge branch 'main' of github.com:bitdefender/www-websites
Matei-Iordache Sep 2, 2024
cfdf2a5
refactor: Update add-on price calculation in new-prod-boxes.js
Matei-Iordache Sep 2, 2024
73d5a1f
Merge pull request #184 from bitdefender/fix-product-comparisson-table
Matei-Iordache Sep 3, 2024
ab4d895
refactor: Update add-on price calculation in new-prod-boxes.js
Matei-Iordache Sep 3, 2024
354eaa7
update headings creators page
imantescu Sep 3, 2024
8d8861a
zuora-pricing
vradulescu-bd Sep 3, 2024
36d19ed
update headings creators page
imantescu Sep 3, 2024
646d26b
Merge pull request #186 from bitdefender/creators-page
imantescu Sep 3, 2024
de1c219
Merge pull request #185 from bitdefender/DEX-18444
Matei-Iordache Sep 3, 2024
17c720f
zuora-pricing
vradulescu-bd Sep 3, 2024
0d82258
zuora-pricing
vradulescu-bd Sep 3, 2024
ee22650
feat: Migrare upgrade/free
ltiseanu Sep 3, 2024
64148e6
fix: lint
ltiseanu Sep 3, 2024
cdd59c4
fix: lint
ltiseanu Sep 3, 2024
23221f1
fix lint
ltiseanu Sep 3, 2024
5cce022
fix: lint
ltiseanu Sep 3, 2024
cea3941
fix lint
ltiseanu Sep 3, 2024
119991a
fix css template creators
imantescu Sep 3, 2024
167af8b
refactor: Update add-on price calculation and plan switcher in new-pr…
Matei-Iordache Sep 3, 2024
e80ff44
zuora-pricing
vradulescu-bd Sep 3, 2024
b27e34e
zuora-pricing
vradulescu-bd Sep 3, 2024
1687a8a
Merge pull request #187 from bitdefender/zuora-pricing
vradulescu-bd Sep 3, 2024
7959649
barchart fix
vradulescu-bd Sep 3, 2024
71a991d
Merge branch 'main' into DEX-19813
vradulescu-bd Sep 3, 2024
5fac1e8
Merge pull request #172 from bitdefender/DEX-19813
vradulescu-bd Sep 3, 2024
2841536
Merge pull request #189 from bitdefender/creators-page
enake Sep 4, 2024
1bc74e9
update currency for $ on creators page
imantescu Sep 4, 2024
04fdff6
update currency for $ on creators page
imantescu Sep 4, 2024
a571571
Merge branch 'main' into DEX-19880
Matei-Iordache Sep 4, 2024
94b4d0b
update currency for $ and £ on creators page
imantescu Sep 4, 2024
1057894
update currency on creators page
imantescu Sep 4, 2024
cb8b938
update currency on creators page
imantescu Sep 4, 2024
0ac7460
Merge pull request #191 from bitdefender/currency-creators-page
enake Sep 4, 2024
e258938
Merge pull request #190 from bitdefender/DEX-19984
enake Sep 4, 2024
f42d959
update regions creators page
imantescu Sep 4, 2024
c138f7f
update regions on creators page
imantescu Sep 4, 2024
913b2c7
Merge pull request #193 from bitdefender/currency-creators-page
enake Sep 4, 2024
9d9179f
update regions creators page
imantescu Sep 4, 2024
1677cb6
update regions creators page
imantescu Sep 4, 2024
7c489d1
update regions creators page
imantescu Sep 4, 2024
d28721b
update regions creators page
imantescu Sep 4, 2024
1f04b4b
Merge pull request #194 from bitdefender/currency-creators-page
enake Sep 4, 2024
5886b3d
fix link-uri de buy uk
imantescu Sep 4, 2024
cbc3c9a
Merge pull request #195 from bitdefender/currency-creators-page
enake Sep 5, 2024
219626d
refactor: Update add-on price calculation and plan switcher in new-pr…
Matei-Iordache Sep 5, 2024
7cec406
newPriceListed was never given a default value, it broke if the hideD…
Matei-Iordache Sep 5, 2024
d61f1f0
delete console.log
Matei-Iordache Sep 5, 2024
5316019
Merge pull request #196 from bitdefender/fix-pricing
enake Sep 5, 2024
d82a5d2
update adobeDataLayer for creators page
imantescu Sep 5, 2024
8b5b49b
Merge branch 'main' into DEX-19880
Matei-Iordache Sep 5, 2024
1a32b7c
Delete Comment
Matei-Iordache Sep 5, 2024
d4eff1b
adobeDataLayer for creators page
imantescu Sep 5, 2024
3349a13
Merge pull request #197 from bitdefender/currency-creators-page
enake Sep 5, 2024
0ae0808
fix for landing page creators
imantescu Sep 5, 2024
7a08aba
Merge pull request #198 from bitdefender/currency-creators-page
enake Sep 5, 2024
25755a7
refactor: Update add-on price calculation and plan switcher in new-pr…
Matei-Iordache Sep 5, 2024
5234f92
Merge pull request #192 from bitdefender/DEX-19880
Matei-Iordache Sep 5, 2024
744ed78
chore: Add unique IDs to each section in the page
Matei-Iordache Sep 6, 2024
59a625f
Merge pull request #199 from bitdefender/DEX-19998
Matei-Iordache Sep 6, 2024
58a450d
fix text save creators page
imantescu Sep 6, 2024
8c51d51
Merge pull request #200 from bitdefender/currency-creators-page
enake Sep 6, 2024
00504d7
fix-save-creators
imantescu Sep 6, 2024
97f5055
Merge pull request #202 from bitdefender/fix-save-creators
enake Sep 6, 2024
ed0c00e
take 1 on fixing data layer on import
Matei-Iordache Sep 6, 2024
943e564
take 2
Matei-Iordache Sep 6, 2024
d3d70b1
take 3
Matei-Iordache Sep 6, 2024
faab138
chore: Fix import path for sendAnalyticsPageLoadedEvent in new-prod-b…
Matei-Iordache Sep 6, 2024
6121630
take 4
Matei-Iordache Sep 6, 2024
30f6e8d
take 5
Matei-Iordache Sep 6, 2024
2b29220
TAKE 6
Matei-Iordache Sep 6, 2024
002f647
Take 7
Matei-Iordache Sep 6, 2024
b61c180
Take 8
Matei-Iordache Sep 6, 2024
f5e87d3
Cleanup
Matei-Iordache Sep 6, 2024
a77345c
Modify parameter name
Matei-Iordache Sep 6, 2024
2629648
Merge pull request #203 from bitdefender/fix-data-layer
enake Sep 6, 2024
e3007d1
updated the way links are created
iconstantin-bd Sep 9, 2024
bcf5070
added TO DO comment
iconstantin-bd Sep 9, 2024
216a045
fixed linter
iconstantin-bd Sep 9, 2024
199e4a1
Merge pull request #204 from bitdefender/header-single-domain
enake Sep 9, 2024
f5d07ba
Revert "update regions creators page"
vradulescu-bd Sep 9, 2024
c4347aa
Merge pull request #205 from bitdefender/revert-194-currency-creators…
enake Sep 9, 2024
9df7c34
columns lint
ltiseanu Sep 10, 2024
29544be
lint fix
ltiseanu Sep 10, 2024
e7a881d
lint fix
ltiseanu Sep 10, 2024
1985629
lint fix
ltiseanu Sep 10, 2024
6f15182
lint fix
ltiseanu Sep 10, 2024
58efa96
lint fix
ltiseanu Sep 10, 2024
9921345
fix lint
ltiseanu Sep 10, 2024
ddba1f0
fix lint
ltiseanu Sep 10, 2024
9f42e8f
fix lint
ltiseanu Sep 10, 2024
4bb51da
lint fix
ltiseanu Sep 10, 2024
7558f13
lint fix
ltiseanu Sep 10, 2024
101de30
Merge branch 'main' of https://github.com/bitdefender/www-websites in…
ltiseanu Sep 10, 2024
ac45ccb
lint fix
ltiseanu Sep 10, 2024
e595753
fix lint
ltiseanu Sep 10, 2024
84f2d93
lint fix
ltiseanu Sep 10, 2024
11fab75
fix lint
ltiseanu Sep 10, 2024
0d1e1da
fix: blog insert image to always fill the container
enake Sep 10, 2024
07080cf
feat: update the prod host
enake Sep 10, 2024
79e31d0
Merge pull request #206 from bitdefender/blog-fix
enake Sep 10, 2024
1e4f375
aligned cards
abutuza Sep 10, 2024
14f1d7b
Merge pull request #188 from bitdefender/migrare_us
ltiseanu Sep 10, 2024
b2057ef
chore: Update CSS margin in new-prod-boxes.css
Matei-Iordache Sep 10, 2024
85f3953
aligned featured cards
abutuza Sep 10, 2024
23e0e0d
refactor: Improve product card alignment and height matching
Matei-Iordache Sep 10, 2024
63ad948
refactor: Improve product card alignment and height matching
abutuza Sep 10, 2024
99ff160
mega menu upate
vradulescu-bd Sep 11, 2024
9f38cee
Merge pull request #209 from bitdefender/mega-menu-update
vradulescu-bd Sep 11, 2024
0c0fa93
fix issue on buylink
ltiseanu Sep 11, 2024
4a01cc3
Merge pull request #210 from bitdefender/migrare_us
ltiseanu Sep 11, 2024
c841cf4
fix display old price
ltiseanu Sep 11, 2024
298b868
price list updates + run lint changes
vradulescu-bd Sep 11, 2024
4922691
Merge pull request #207 from bitdefender/align-new-prod-boxes-icons
Matei-Iordache Sep 11, 2024
e089b89
price list updates + run lint changes
vradulescu-bd Sep 11, 2024
d6e94dd
Merge pull request #212 from bitdefender/DEX-20028
vradulescu-bd Sep 11, 2024
d824098
Merge pull request #211 from bitdefender/migrare_us
ltiseanu Sep 11, 2024
039f30c
Merge pull request #208 from bitdefender/DEX-20033
abutuza Sep 11, 2024
c9be03e
matched ul height
abutuza Sep 11, 2024
c5d5c96
Add posibility to add more tags, rewrite css so it sits better, adjus…
Matei-Iordache Sep 12, 2024
e38d68c
zuora update buy link fix
vradulescu-bd Sep 12, 2024
9e1ff41
Merge pull request #213 from bitdefender/DEX-20045
Matei-Iordache Sep 12, 2024
95c1ae7
aligned cards for products not on sale
abutuza Sep 12, 2024
2f145a5
Merge pull request #214 from bitdefender/DEX-20080
vradulescu-bd Sep 13, 2024
e1d8563
adjusted product cards alignment
abutuza Sep 13, 2024
1800fc9
adjusted product cards alignment
abutuza Sep 13, 2024
7988bbd
Merge pull request #215 from bitdefender/DEX-20033
abutuza Sep 13, 2024
fb1ace8
fix: styling pages for migration
ltiseanu Sep 16, 2024
d29fa21
updates
ltiseanu Sep 16, 2024
b81ed87
updated buy link + extended scrolling support
vradulescu-bd Sep 16, 2024
d0aa7dc
Merge pull request #216 from bitdefender/buylink-update
enake Sep 16, 2024
205597f
fix
Andserbanbitdefender Sep 16, 2024
871f504
lint
Andserbanbitdefender Sep 16, 2024
cb0906a
fix: hero discount label
enake Sep 16, 2024
6b56ae5
Merge pull request #218 from bitdefender/hero-label
enake Sep 16, 2024
5414588
Merge pull request #217 from bitdefender/fix-undefined-old-price
enake Sep 16, 2024
70e1612
added testing support
vradulescu-bd Sep 16, 2024
ab22c20
added testing support
vradulescu-bd Sep 16, 2024
645127b
added testing support
vradulescu-bd Sep 16, 2024
55095d7
added the footer, language banner and mega menu logic
iconstantin-bd Sep 16, 2024
6417b4a
fixed linter
iconstantin-bd Sep 16, 2024
d053de0
Merge branch 'main' into add-the-language-banner-and-footer
iconstantin-bd Sep 16, 2024
ccfad82
fixed more linter errors
iconstantin-bd Sep 16, 2024
0c45605
styling updates
ltiseanu Sep 17, 2024
8ec6d81
Merge pull request #221 from bitdefender/add-the-language-banner-and-…
enake Sep 17, 2024
7cfbe83
Merge pull request #220 from bitdefender/20042
enake Sep 17, 2024
6c8b65e
Updates
ltiseanu Sep 17, 2024
3a56c55
extended support
vradulescu-bd Sep 17, 2024
335978b
Merge pull request #223 from bitdefender/DEX-20034-fix
enake Sep 17, 2024
c14e69b
fix: 404 page fragments
enake Sep 17, 2024
6830328
Merge pull request #224 from bitdefender/404
enake Sep 17, 2024
c606f77
MIgration updates
ltiseanu Sep 17, 2024
964c7ce
added special case for china websites
iconstantin-bd Sep 17, 2024
07894c6
fixed linter
iconstantin-bd Sep 17, 2024
bc927b8
Merge branch 'main' of https://github.com/bitdefender/www-websites in…
ltiseanu Sep 17, 2024
14fbfa0
fix: lint
ltiseanu Sep 17, 2024
fcfd821
fix lint js
ltiseanu Sep 17, 2024
b43455a
Updates buy links to have data sets for testing
vradulescu-bd Sep 17, 2024
9c03227
fix: lint css
ltiseanu Sep 17, 2024
caad5d3
fix: lint
ltiseanu Sep 17, 2024
a65d2b7
Merge pull request #225 from bitdefender/revert-code-from-old-footer
iconstantin-bd Sep 17, 2024
18b4ee6
force locale revert
vradulescu-bd Sep 17, 2024
67aa257
fix lint css
ltiseanu Sep 17, 2024
f27b012
fix: lint css
ltiseanu Sep 17, 2024
bf61b40
fix: lint css
ltiseanu Sep 17, 2024
4d82d18
fix: lint css
ltiseanu Sep 17, 2024
ef699cc
fix lint css
ltiseanu Sep 17, 2024
cdbe624
fix lint css
ltiseanu Sep 17, 2024
eae65f2
fix lint css
ltiseanu Sep 17, 2024
222c596
added more reverted code
iconstantin-bd Sep 17, 2024
75fbf15
fix lint css
ltiseanu Sep 17, 2024
1e8c0de
Merge pull request #227 from bitdefender/cross-buy-link-fixes
vradulescu-bd Sep 17, 2024
75c880d
fixed linting
iconstantin-bd Sep 17, 2024
0e82382
fix lint css
ltiseanu Sep 17, 2024
2a17e2e
fix lint css
ltiseanu Sep 17, 2024
5490a8a
Merge pull request #226 from bitdefender/migrare_us
enake Sep 17, 2024
127bbfb
Merge pull request #228 from bitdefender/revert-code-from-old-footer
enake Sep 17, 2024
d9059f0
fix: index
enake Sep 18, 2024
4f85efd
Merge pull request #229 from bitdefender/index
enake Sep 18, 2024
fab067d
fix: breadcrumbs no longer take in the account the locale
enake Sep 18, 2024
9616b01
Merge pull request #230 from bitdefender/index
enake Sep 18, 2024
40f26de
Merge branch 'main' into DEX-19622
iconstantin-bd Sep 18, 2024
adfe778
Merge branch 'main' into DEX-19622
iconstantin-bd Sep 18, 2024
136b010
fixed linting issue
iconstantin-bd Sep 18, 2024
de5519f
Merge pull request #169 from bitdefender/DEX-19622
enake Sep 18, 2024
78f8e2e
fix
vradulescu-bd Sep 18, 2024
f0c5bb0
Merge branch 'main' into DEX-20128
vradulescu-bd Sep 18, 2024
25ddb5e
Merge pull request #231 from bitdefender/DEX-20128
vradulescu-bd Sep 18, 2024
2facd52
fix
vradulescu-bd Sep 18, 2024
c38c43d
Merge pull request #232 from bitdefender/product-compariso-products
vradulescu-bd Sep 18, 2024
685e971
buttom price fix
vradulescu-bd Sep 18, 2024
a896f5b
options fix
vradulescu-bd Sep 18, 2024
2be8c7c
options fix
vradulescu-bd Sep 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
vradulescu-bd committed Sep 18, 2024
commit 78f8e2e4c03cc6704f1f77a52db52c14becfe6f0
1 change: 1 addition & 0 deletions _src/blocks/barchart/barchart.css
Original file line number Diff line number Diff line change
@@ -147,6 +147,7 @@
.barchart.block h3 {
font-size: var(--body-font-size-m);
}

.barchart > ul > li {
padding: 1em;
}
4 changes: 3 additions & 1 deletion _src/blocks/columns/columns.css
Original file line number Diff line number Diff line change
@@ -89,7 +89,9 @@

.section.subtitle-blue h3 {
font-size: 1.25rem;

--tw-text-opacity: 1;

color: rgb(0 110 255 / var(--tw-text-opacity));
}

@@ -520,7 +522,7 @@

/* stylelint-disable-next-line selector-class-pattern */
.section.b_mark > div {
padding: 5em 0 3em 0;
padding: 5em 0 3em;
margin-top: 0;
}

7 changes: 4 additions & 3 deletions _src/blocks/hero/hero.css
Original file line number Diff line number Diff line change
@@ -327,7 +327,8 @@ main .hero img {

main .hero .hero-picture picture img {
position: absolute;
/*display: none;*/

/* display: none; */
padding-left: 200px;
}

@@ -605,7 +606,7 @@ main .smaller_icon .hero .hero-content > div table tr td:first-of-type {
main .hero h1 {
font-size: 2.5rem;
font-weight: 700;
font-family: IBM Plex Sans, sans-serif;
font-family: "IBM Plex Sans", sans-serif;
}

main .hero .hero-picture {
@@ -718,7 +719,7 @@ main .smaller_icon .hero .hero-content > div table tr td:first-of-type {
main .hero h1 {
font-size: 2.5rem;
font-weight: 700;
font-family: IBM Plex Sans, sans-serif;
font-family: "IBM Plex Sans", sans-serif;
}

main .v2 .hero h1 {
Original file line number Diff line number Diff line change
@@ -278,7 +278,6 @@ div[role="row"].expandable-row div[role="cell"] p:first-of-type {
background-color: var(--first-table-cell-color);
padding: 0.875rem 1.75rem 1.0625rem 2.125rem;
width: 100%;
font-weight: var(--font-weight-bold);
text-align: center;
font-size: var(--body-font-size-s);
font-weight: var(--font-weight-regular);
@@ -670,7 +669,7 @@ div[role="row"].expandable-row div[role="cell"] p:first-of-type {

.product-comparison-header div[role="columnheader"] h3 {
font-size: var(--heading-font-size-xxs);
margin: 1em 0em 5px;
margin: 1em 0 5px;
}

.product-comparison-price p:last-of-type {
15 changes: 10 additions & 5 deletions _src/blocks/product-comparison-table/product-comparison-table.js
Original file line number Diff line number Diff line change
@@ -4,8 +4,9 @@ import {
fetchProduct,
matchHeights,
setDataOnBuyLinks,
generateProductBuyLink,
generateProductBuyLink, formatPrice,
} from '../../scripts/utils/utils.js';
import { getDomain } from '../../scripts/scripts.js';

const fetchedProducts = [];

@@ -29,15 +30,19 @@ createNanoBlock('priceComparison', (code, variant, label, block) => {
fetchedProducts.push({ code, variant, product });
// eslint-disable-next-line camelcase
const { price, discount: { discounted_price: discounted }, currency_iso: currency } = product;
const savings = price - discounted;
const formattedPriceParams = [currency, null, getDomain()];
// eslint-disable-next-line max-len
const formattedSavings = formatPrice((price - discounted).toFixed(2), ...formattedPriceParams);
const formattedPrice = formatPrice(price, ...formattedPriceParams);
const formattedDiscount = formatPrice(discounted, ...formattedPriceParams);

oldPriceElement.innerHTML = `<div class="old-price-box">
<span>${oldPriceText} <del>${price} ${currency}</del></span>
<span class="savings d-none">Savings <del>${savings.toFixed(2)} ${currency}</del></span>
<span>${oldPriceText} <del>${formattedPrice}</del></span>
<span class="savings d-none">Savings <del>${formattedSavings}</del></span>
</div>`;
priceElement.innerHTML = `<div class="new-price-box">
<span class="d-none total-text">Your total price:</span>
${discounted} ${currency}
${formattedDiscount}
</div>`;
priceAppliedOnTime.innerHTML = label;

8 changes: 6 additions & 2 deletions _src/blocks/products-sideview/products-sideview.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import {
createNanoBlock,
fetchProduct,
fetchProduct, formatPrice,
getBuyLinkCountryPrefix,
getDatasetFromSection,
getPidFromUrl,
renderNanoBlocks, setDataOnBuyLinks,
} from '../../scripts/utils/utils.js';
import { getDomain } from '../../scripts/scripts.js';

const state = {
firstProduct: null,
@@ -175,7 +176,10 @@ function updatePrice(block) {
state.currentProduct = product;
const variant = `${MEMBERS_MAP.get(state.membersIndex)}u-1y`;
const resp = await fetchProduct(product.alias, variant);
priceEl.textContent = `${resp.currency_label} ${resp.price}`;

const formattedPrice = formatPrice(resp.price, resp.currency_iso, null, getDomain());

priceEl.textContent = `${formattedPrice}`;
})();
}

3 changes: 2 additions & 1 deletion _src/blocks/products/products.css
Original file line number Diff line number Diff line change
@@ -217,7 +217,7 @@

.product-card .featured {
color: #2cb43d;
background-color: rgba(44,180,61,.2);
background-color: rgb(44 180 61 / 20%);
border-radius: 8px;
font-size: var(--body-font-size-xs);
font-weight: var(--font-weight-bold);
@@ -759,6 +759,7 @@
@media (max-width: 992px) {
.products.compact, .products.plans {
--max-columns: 2;

display: flex;
flex-wrap: wrap;
text-align: center;
43 changes: 23 additions & 20 deletions _src/blocks/products/products.js
Original file line number Diff line number Diff line change
@@ -5,10 +5,10 @@ import {
createTag,
generateProductBuyLink,
matchHeights,
setDataOnBuyLinks,
setDataOnBuyLinks, formatPrice,
} from '../../scripts/utils/utils.js';

import { trackProduct } from '../../scripts/scripts.js';
import { getDomain, trackProduct } from '../../scripts/scripts.js';

// all avaiable text variables
const TEXT_VARIABLES_MAPPING = [
@@ -45,6 +45,8 @@ function customRound(value) {
* @returns a model
*/
function toModel(productCode, variantId, v) {
const currentDomain = getDomain();
const formattedPriceParams = [v.currency_iso, null, currentDomain];
return {
productCode,
variantId,
@@ -53,16 +55,17 @@ function toModel(productCode, variantId, v) {
devices: +v.variation.dimension_value,
subscription: v.variation.years * 12,
version: v.variation.years ? 'yearly' : 'monthly',
basePrice: +v.price,
actualPrice: v.discount ? +v.discount.discounted_price : +v.price,
monthlyBasePrice: customRound(v.price / 12),
discountedPrice: v.discount?.discounted_price,
discountedMonthlyPrice: v.discount
basePrice: formatPrice(+v.price, ...formattedPriceParams),
// eslint-disable-next-line max-len
actualPrice: formatPrice(v.discount ? +v.discount.discounted_price : +v.price, ...formattedPriceParams),
monthlyBasePrice: formatPrice(customRound(v.price / 12), ...formattedPriceParams),
discountedPrice: formatPrice(v.discount?.discounted_price, ...formattedPriceParams),
discountedMonthlyPrice: formatPrice(v.discount
? customRound(v.discount.discounted_price / 12)
: 0,
discount: v.discount
: 0, ...formattedPriceParams),
discount: formatPrice(v.discount
? customRound((v.price - v.discount.discounted_price) * 100) / 100
: 0,
: 0, ...formattedPriceParams),
discountRate: v.discount
? Math.floor(((v.price - v.discount.discounted_price) / v.price) * 100)
: 0,
@@ -177,16 +180,16 @@ function renderOldPrice(mv, text = '', monthly = '') {
{
class: 'price',
},
`<span class='old-price ${!mv.model.basePrice ? 'no-old-price' : ''}'>${text} <del>${mv.model.basePrice ?? ''} ${mv.model.currency ?? ''}</del>`,
`<span class='old-price ${!mv.model.basePrice ? 'no-old-price' : ''}'>${text} <del>${mv.model.basePrice ?? ''}</del>`,
);

const oldPriceElt = root.querySelector('span');

mv.subscribe(() => {
if (mv.model.discountedPrice) {
oldPriceElt.innerHTML = monthly.toLowerCase() === 'monthly'
? `${text} <del>${mv.model.monthlyBasePrice} ${mv.model.currency}<sup>/mo</sup></del>`
: `${text} <del>${mv.model.basePrice} ${mv.model.currency}</del>`;
? `${text} <del>${mv.model.monthlyBasePrice} <sup>/mo</sup></del>`
: `${text} <del>${mv.model.basePrice}</del>`;
oldPriceElt.style.visibility = 'visible';
} else {
oldPriceElt.style.visibility = 'hidden';
@@ -218,14 +221,14 @@ function renderPrice(mv, text = '', monthly = '', monthTranslation = 'mo') {
mv.subscribe(() => {
if (monthly.toLowerCase() === 'monthly') {
if (mv.model.discountedPrice) {
priceElt.innerHTML = `${text} ${mv.model.discountedMonthlyPrice} ${mv.model.currency} <sup>/${monthTranslation}</sup>`;
priceElt.innerHTML = `${text} ${mv.model.discountedMonthlyPrice} <sup>/${monthTranslation}</sup>`;
} else {
priceElt.innerHTML = `${text} ${mv.model.monthlyBasePrice} ${mv.model.currency} <sup>/${monthTranslation}</sup>`;
priceElt.innerHTML = `${text} ${mv.model.monthlyBasePrice} <sup>/${monthTranslation}</sup>`;
}
} else if (mv.model.discountedPrice) {
priceElt.innerHTML = `${text} ${mv.model.discountedPrice} ${mv.model.currency}`;
priceElt.innerHTML = `${text} ${mv.model.discountedPrice}`;
} else {
priceElt.innerHTML = `${text} ${mv.model.basePrice} ${mv.model.currency}`;
priceElt.innerHTML = `${text} ${mv.model.basePrice}`;
}

trackProduct(mv.model);
@@ -254,7 +257,7 @@ function renderHighlightSavings(mv, text = 'Save', percent = '') {
if (mv.model.discountRate) {
root.querySelector('span').innerText = (percent.toLowerCase() === 'percent')
? `${text} ${mv.model.discountRate}%`
: `${text} ${mv.model.discount} ${mv.model.currency}`;
: `${text} ${mv.model.discount}`;
root.style.visibility = 'visible';
} else {
root.style.visibility = 'hidden';
@@ -353,7 +356,7 @@ function renderFeaturedSavings(mv, text = 'Save', percent = '') {
if (mv.model.discountRate) {
root.innerText = (percent.toLowerCase() === 'percent')
? `${text} ${mv.model.discountRate}%`
: `${text} ${mv.model.discount} ${mv.model.currency}`;
: `${text} ${mv.model.discount}`;
root.style.visibility = 'visible';
} else {
root.style.visibility = 'hidden';
@@ -377,7 +380,7 @@ function renderLowestPrice(code, variant, monthly = '', text = '') {
const m = toModel(code, variant, product);
const isMonthly = monthly.toLowerCase() === 'monthly';
const price = isMonthly ? customRound(m.actualPrice / 12) : m.actualPrice;
root.innerHTML = `${text.replace('0', `${price} ${product.currency_label}`)}`;
root.innerHTML = `${text.replace('0', `${price}`)}`;
});

return root;
2 changes: 1 addition & 1 deletion _src/scripts/breadcrumbs.js
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ function prependSlash(path) {
}

function getName(pageIndex, path, part, current) {
const pg = pageIndex.find((page) => page.path.replace(/^\/[^\/]+/, '') === path.replace(/^\/[^\/]+/, ''));
const pg = pageIndex.find((page) => page.path.replace(/^\/[^\\/]+/, '') === path.replace(/^\/[^\\/]+/, ''));
if (pg && pg.breadcrumbtitle && pg.breadcrumbtitle !== '0') {
return pg.breadcrumbtitle;
}
3 changes: 3 additions & 0 deletions _src/scripts/utils/utils.js
Original file line number Diff line number Diff line change
@@ -337,6 +337,9 @@ export function setDataOnBuyLinks(element, dataInfo) {
}

export function formatPrice(price, currency, region = null, locale = null) {
if (!price) {
return null;
}
const loc = region ? IANA_BY_REGION_MAP.get(Number(region))?.locale || 'en-US' : locale;
return new Intl.NumberFormat(loc, { style: 'currency', currency }).format(price);
}