// Add buttons after cart on page load
(function() {
function addCartButtons() {
// Check if buttons already exist
if (document.querySelector('.sg-cart-buttons-inserted')) return;
// Find the cart actions or proceed to checkout button
var cartActions = document.querySelector('.wc-proceed-to-checkout');
if (!cartActions) {
cartActions = document.querySelector('.cart-collaterals');
}
if (!cartActions) {
cartActions = document.querySelector('.woocommerce-cart-form');
}
if (cartActions) {
var buttonDiv = document.createElement('div');
buttonDiv.className = 'sg-cart-buttons sg-cart-buttons-inserted';
buttonDiv.innerHTML = 'Return To Calendar' +
'Return To Shop Page';
// Insert after the cart actions
cartActions.parentNode.insertBefore(buttonDiv, cartActions.nextSibling);
}
}
// Run when DOM is ready
if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', addCartButtons);
} else {
addCartButtons();
}
// Also run after a short delay for dynamic content
setTimeout(addCartButtons, 500);
})();