Footer
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// --- 1. Move accordion under gallery ---
$(".accordion-block").insertAfter(".gallery-accordion-wrapper");
// --- 2. Adjust Matcha accordion block ---
setTimeout(function() {
if (window.location.pathname.includes("/shop/p/matchateabar")) {
const accordionBlock = document.querySelector("#block-yui_3_17_2_1_1745456135185_48159");
if (accordionBlock) {
accordionBlock.classList.add("adjust-matcha-accordion-block");
}
}
}, 500);
// --- 3. Equalize product block heights ---
function equalizeProductHeights() {
// ONLY target main product grids (not related products)
const blocks = document.querySelectorAll('.collection-type-products .product-block');
let maxHeight = 0;
// Reset heights
blocks.forEach(block => block.style.height = 'auto');
// Find tallest
blocks.forEach(block => {
const blockHeight = block.offsetHeight;
if (blockHeight > maxHeight) maxHeight = blockHeight;
});
// Apply height
blocks.forEach(block => block.style.height = maxHeight + 'px');
}
equalizeProductHeights();
window.addEventListener("resize", equalizeProductHeights);
// --- 4. Function to force-show variants + quantity ---
function showVariantsAndQty() {
const products = document.querySelectorAll(".product-block");
products.forEach(product => {
const variantWrapper = product.querySelector(".product-variants");
const quantityWrapper = product.querySelector(".product-quantity-input-wrapper");
if (variantWrapper) {
variantWrapper.style.display = "block";
variantWrapper.style.visibility = "visible";
variantWrapper.style.opacity = "1";
variantWrapper.removeAttribute("hidden");
}
if (quantityWrapper) {
quantityWrapper.style.display = "flex";
quantityWrapper.style.visibility = "visible";
quantityWrapper.style.opacity = "1";
quantityWrapper.removeAttribute("hidden");
}
});
}
// Run once after DOM load
showVariantsAndQty();
// --- 5. MutationObserver to catch late-loaded products ---
const observer = new MutationObserver(() => {
showVariantsAndQty();
});
observer.observe(document.body, { childList: true, subtree: true });
// --- 6. Product page safety net ---
const isProductPage = document.querySelector(".ProductItem-details");
if (isProductPage) {
document.querySelectorAll(".variant-option-wrapper, .product-quantity-input-wrapper").forEach(el => {
el.style.display = "block";
el.style.visibility = "visible";
el.style.opacity = "1";
el.removeAttribute("hidden");
});
}
// --- 7. Hide variant titles (optional) ---
document.querySelectorAll(".variant-option-title").forEach(title => {
title.style.display = "none";
});
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Select all product variant wrappers on homepage
const homepageProducts = document.querySelectorAll(".collection-type-products .product-block .product-variants");
homepageProducts.forEach(wrapper => {
// Remove any "hidden" attribute Squarespace adds
wrapper.removeAttribute("hidden");
// Force visible with inline styles
wrapper.style.display = "block";
wrapper.style.opacity = "1";
wrapper.style.visibility = "visible";
wrapper.style.height = "auto";
wrapper.style.overflow = "visible";
});
// Also force the select dropdown itself
const selects = document.querySelectorAll(".collection-type-products .product-block .product-variants select");
selects.forEach(select => {
select.style.display = "block";
select.style.opacity = "1";
select.style.visibility = "visible";
});
});
</script>
<script>
document.addEventListener("DOMContentLoaded", function() {
// Watch for changes in the cart drawer
const observer = new MutationObserver(() => {
const cartTitle = document.querySelector(".cart-title");
if (cartTitle && cartTitle.textContent !== "Ready for checkout") {
cartTitle.textContent = "Ready for checkout";
}
});
observer.observe(document.body, { childList: true, subtree: true });
});
</script>