Public Access
fix(bf): page-scoped CRO fixes on /odoo-black-friday/ (deal price, one deal buy, live countdown)
Fix 1: the On the Rise pricing card quoted $395 while the deal block said $295 first year — a price contradiction within one scroll. On this page only the card now reads $295.00 / 'for your first year, then $395 a year'. Other pages keep $395. JSON-LD Offer price was already 295.00 and still matches the visible price. Fix 2: the three list-price Buy Now buttons (data-id 6/4/5) competed with the deal. Side Hustle and Powerhouse buy buttons removed on this page. The On the Rise card's buy is now the deal purchase — the same one-click checkout as the offer block (product 4, /coupon/HOST27?r=/shop/checkout), native POST so it works with JS off. Tracking: the offer-block form is the single element carrying the Plausible Buy class; the Bootcamp CTA and the two list-price buttons no longer carry it. Fix 10: a time-remaining element near the offer and near the buy, computed client-side from one documented constant (2026-11-30T23:59:59-05:00, US/Eastern). The static sentence 'Ends Monday 30 November 2026.' still reads with JS off; past the instant the text switches to the past tense. No visibility animation.
This commit is contained in:
1 parent
46b943bffe
commit
ec6e496900
2 files changed
+92
-8
No files matched your search
@@ -423,4 +423,43 @@
|
||||
observer.observe(g);
|
||||
});
|
||||
})();
|
||||
|
||||
/* ---- Black Friday time remaining (Fix 10) ----
|
||||
ONE documented constant: the instant the offer ends — 30 November 2026, end of day, in the
|
||||
account's US/Eastern context (EST, UTC-5, after the 1 Nov DST change). The day count is
|
||||
computed client-side from this instant on every page load; it is NEVER hard-coded, so it
|
||||
stays correct as the date changes.
|
||||
|
||||
Fail-safe: the HTML carries the static sentence "Ends Monday 30 November 2026." with an empty
|
||||
span beside it, so with JavaScript off the deadline still reads correctly on its own. Once the
|
||||
end instant has passed the text switches to the past tense — it never keeps claiming time
|
||||
remains. Nothing here animates visibility. */
|
||||
(function () {
|
||||
var BF_END = new Date('2026-11-30T23:59:59-05:00');
|
||||
var DAY = 86400000;
|
||||
var nodes = document.querySelectorAll('[data-bf-days]');
|
||||
if (!nodes.length) return;
|
||||
|
||||
/* Whole calendar days in US/Eastern, so "days left" is a date difference and not a 24-hour
|
||||
window (the offer ends at the end of a day, not 28 x 24h from now). */
|
||||
function easternDayNumber(d) {
|
||||
var parts = new Intl.DateTimeFormat('en-CA', {
|
||||
timeZone: 'America/New_York', year: 'numeric', month: '2-digit', day: '2-digit'
|
||||
}).format(d).split('-');
|
||||
return Date.UTC(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)) / DAY;
|
||||
}
|
||||
|
||||
var daysLeft = easternDayNumber(BF_END) - easternDayNumber(new Date());
|
||||
var text;
|
||||
if (daysLeft > 1) {
|
||||
text = daysLeft + ' days left';
|
||||
} else if (daysLeft === 1) {
|
||||
text = '1 day left';
|
||||
} else if (daysLeft === 0) {
|
||||
text = 'last day today';
|
||||
} else {
|
||||
text = 'this offer has ended';
|
||||
}
|
||||
nodes.forEach(function (n) { n.textContent = text; });
|
||||
})();
|
||||
})();
|
||||
Reference in new issue
Block a user