Skip to content

Commit

Permalink
Merge pull request #456 from bitdefender/DEX-21657
Browse files Browse the repository at this point in the history
DEX-21657 - Update Brand Search LP - fix display discount
  • Loading branch information
ltiseanu authored Feb 3, 2025
2 parents 6420dbb + a9e3533 commit aeb392f
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 8 deletions.
12 changes: 8 additions & 4 deletions _src-lp/blocks/banner/banner.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,14 @@
border-radius: 22px;
}

.section.banner-container.new-2024.v2 p a {
text-decoration: underline;
}

.section.banner-container.hasslide .block table tr td a {
color: white;
}

.section.banner-container .banner .blue-box tr td:first-of-type {
margin-right: 10px;
}
Expand Down Expand Up @@ -396,10 +404,6 @@
color: inherit;
}

.section.banner-container.new-2024.v2 p a {
text-decoration: underline;
}

.section.banner-container.hasslide .block table tr td a:hover {
text-decoration: none;
opacity: 0.7;
Expand Down
12 changes: 8 additions & 4 deletions _src-lp/blocks/banner/banner.scss
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,14 @@
border-radius: 22px;
}

.section.banner-container.new-2024.v2 p a {
text-decoration: underline;
}

.section.banner-container.hasslide .block table tr td a {
color: white;
}

.section.banner-container .banner .blue-box tr td:first-of-type {
margin-right: 10px;
}
Expand Down Expand Up @@ -397,10 +405,6 @@
color: inherit;
}

.section.banner-container.new-2024.v2 p a {
text-decoration: underline;
}

.section.banner-container.hasslide .block table tr td a:hover {
text-decoration: none;
opacity: 0.7;
Expand Down
13 changes: 13 additions & 0 deletions _src-lp/blocks/new-prod-boxes/new-prod-boxes.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,19 @@ export default function decorate(block) {
const value = variationText.trim();
const isChecked = idx === 0 ? 'checked' : '';

percentOff = Array.from(saveOldPrice.querySelectorAll('td'))[1].innerText.replace('0%', `<span class="percent-${selectorClass}"></span>`);
if (!saveOldPrice.querySelectorAll('td')[1].innerText.includes('0%') && saveOldPrice.querySelectorAll('td')[1].innerText.includes('0')) {
percentOff = Array.from(saveOldPrice.querySelectorAll('td'))[1].innerText.replace('0', `<span class="save-${selectorClass}"></span>`);
percentOffFlag = true;
}
if (!saveOldPrice.querySelectorAll('td')[1].innerText.includes('0%') && !saveOldPrice.querySelectorAll('td')[1].innerText.includes('0')) {
percentOff = saveOldPrice.querySelectorAll('td')[1].innerText;
percentOffFlag = true;
}
if (!percentOff) {
percentOffFlag = false;
}

li.setAttribute('data-selector-u', `u_${selectorClass}`);
li.setAttribute('data-value-u', pusers);
li.setAttribute('data-selector-y', `y_${selectorClass}`);
Expand Down
2 changes: 2 additions & 0 deletions _src-lp/scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,13 @@ export async function showPrices(storeObj, triggerVPN = false, checkboxId = '',
if (parentSaveBox) {
parentSaveBox.innerHTML = savings;
parentSaveBox.style.visibility = 'visible';
parentSaveBox.closest('.save').style.visibility = 'visible';
}
} else {
document.querySelectorAll(`.save-${onSelectorClass}`).forEach((item) => {
item.innerHTML = savings;
item.style.visibility = 'visible';
item.closest('.save').style.visibility = 'visible';
});
}
}
Expand Down

0 comments on commit aeb392f

Please sign in to comment.