Bootcamp page: Reserve your seat now buys the bootcamp (product_id 12)

The three Reserve-your-seat CTAs posted to /support.html#contact. They now
run the same checkout path as the main page's Buy Now: a new page-local
static/buy.js mirrors script.js buyNow() (POST basket to
20.odoo4projects.com/shop/post_basket, clear=1, UTM cookies appended) and
binds .btn-buy via one delegated click handler. CTAs become
.btn-buy[data-id=12]; label unchanged. script.js and the homepage untouched.

The Price-and-booking section keeps a second, smaller link to
/support.html#contact so readers who have questions still have a fallback.
This commit is contained in:
oliver committed 2026-10-24 22:03:38 +00:00
1 parent b69e4ceaed
commit 45a3cc5398
2 files changed
+84 -3

No files matched your search

+5 -3
View File
@@ -527,7 +527,7 @@
<span class="hero-stat"><i aria-hidden="true">&#10003;</i> One year of Odoo Community Edition included</span> <span class="hero-stat"><i aria-hidden="true">&#10003;</i> One year of Odoo Community Edition included</span>
</div> </div>
<div class="hero-actions"> <div class="hero-actions">
<a href="/support.html#contact" class="btn btn-brass btn-lg">Reserve your seat</a> <a href="javascript:void(0)" class="btn btn-brass btn-lg btn-buy" data-id="12">Reserve your seat</a>
</div> </div>
</div> </div>
</section> </section>
@@ -546,7 +546,7 @@
</p> </p>
<p class="bc-subline">Three months. Ten hours of teaching. One system that runs your company.</p> <p class="bc-subline">Three months. Ten hours of teaching. One system that runs your company.</p>
<div class="bc-action"> <div class="bc-action">
<a href="/support.html#contact" class="btn btn-brass btn-lg">Reserve your seat</a> <a href="javascript:void(0)" class="btn btn-brass btn-lg btn-buy" data-id="12">Reserve your seat</a>
</div> </div>
</div> </div>
</section> </section>
@@ -715,9 +715,10 @@
alumni community and the expert review. alumni community and the expert review.
</p> </p>
<div class="bc-action"> <div class="bc-action">
<a href="/support.html#contact" class="btn btn-brass btn-lg">Reserve your seat</a> <a href="javascript:void(0)" class="btn btn-brass btn-lg btn-buy" data-id="12">Reserve your seat</a>
</div> </div>
<ul class="bc-related"> <ul class="bc-related">
<li><a href="/support.html#contact">Questions before you book? Talk to us first</a></li>
<li><a href="/odoo-hosting-2027.html">What hosting looks like after your year with us</a></li> <li><a href="/odoo-hosting-2027.html">What hosting looks like after your year with us</a></li>
<li><a href="/support.html">What our support does and does not cover</a></li> <li><a href="/support.html">What our support does and does not cover</a></li>
<li><a href="/blog/posts/community-vs-enterprise-cost.html">What Community costs compared with Enterprise</a></li> <li><a href="/blog/posts/community-vs-enterprise-cost.html">What Community costs compared with Enterprise</a></li>
@@ -813,6 +814,7 @@
<div class="fcopy">Copyright &copy; ODOO4projects LLC</div> <div class="fcopy">Copyright &copy; ODOO4projects LLC</div>
</div> </div>
</footer> </footer>
<script defer src="/static/buy.js"></script>
<script defer src="/static/lang.js"></script> <script defer src="/static/lang.js"></script>
</body> </body>
</html> </html>
+79
View File
@@ -0,0 +1,79 @@
/* buy.js — page-local checkout helper.
*
* Mirrors `script.js` `buyNow()` — the main page's checkout path.
* If that changes, change this too.
*
* Loaded by pages that do not load `script.js` (e.g. the bootcamp page).
* Binds `.btn-buy` elements: <a class="btn-buy" data-id="12">…</a>.
*/
(function () {
'use strict';
/* ---- UTM tracking helpers (verbatim from script.js) ---- */
function getCookie(name) {
var match = document.cookie.match(new RegExp('(^| )' + name + '=([^;]+)'));
return match ? decodeURIComponent(match[2]) : null;
}
function getStoredUTM() {
var utm = {};
var keys = ['source', 'medium', 'campaign'];
for (var i = 0; i < keys.length; i++) {
var val = getCookie('utm_' + keys[i]);
if (val) utm[keys[i]] = val;
}
return utm;
}
function appendToForm(form) {
var stored = getStoredUTM();
var keys = ['source', 'medium', 'campaign'];
for (var i = 0; i < keys.length; i++) {
if (stored[keys[i]]) {
var input = document.createElement('input');
input.type = 'hidden';
input.name = 'utm_' + keys[i];
input.value = stored[keys[i]];
form.appendChild(input);
}
}
}
/* ---- Buy Now — POST basket via form, opens checkout in new tab ---- */
window.buyNow = function (productId) {
var form = document.createElement('form');
form.method = 'POST';
form.action = 'https://20.odoo4projects.com/shop/post_basket';
form.target = '_blank';
form.style.display = 'none';
var basket = document.createElement('input');
basket.type = 'hidden';
basket.name = 'basket';
basket.value = JSON.stringify([{ product_id: productId, qty: 1 }]);
form.appendChild(basket);
var clear = document.createElement('input');
clear.type = 'hidden';
clear.name = 'clear';
clear.value = '1';
form.appendChild(clear);
appendToForm(form);
document.body.appendChild(form);
form.submit();
document.body.removeChild(form);
};
/* ---- Bind .btn-buy (delegated: same contract as script.js) ---- */
document.addEventListener('click', function (e) {
var btn = e.target.closest ? e.target.closest('.btn-buy') : null;
if (!btn) return;
var id = btn.getAttribute('data-id');
if (id) {
e.preventDefault();
window.buyNow(parseInt(id, 10));
}
});
})();