Skip to content
The Environmental Benefits of Home Hydroponics April is a remarkable month, celebrated globally as both Earth Month and Citizen Scientists Month—a perfect opportunity to explore and embrace sustainable practices. At Produce’d, we champion hydroponics as one of the most sustainable farming methods available today. Not only does hydroponics align with Earth Month’s mission to protect…
This post is only available to members.
Produce’d at Atlanta Science Festival 2025: Celebrating Hydroponics and Sustainability For the third year running, Produce’d was thrilled to be part of the vibrant energy of the Atlanta Science Festival (ASF) 2025. This annual celebration of science, technology, engineering, arts, and mathematics (STEAM) brings the community together, sparking curiosity and inspiring innovation across Atlanta. This…
This post is only available to members.
Go to Top
console.log("GB custom code loaded");
window.GB_OOS_SCRIPT_LOADED = true;
document.addEventListener("DOMContentLoaded", function () {
// Only run on GrowBox product page (ID 2577)
if (!document.body.classList.contains("postid-2577")) return;
// Debug flag so we can verify it loaded
window.GB_OOS_SCRIPT_LOADED = true;
function isOutOfStock(stockEl) {
if (!stockEl) return false;
if (stockEl.classList.contains("out-of-stock")) return true;
var t = (stockEl.textContent || "").toLowerCase().trim();
return t.includes("out of stock");
}
function getItemContainer(fromEl) {
// Try common bundle wrappers; fall back to something safe
return (
fromEl.closest("li") ||
fromEl.closest(".bundled_item") ||
fromEl.closest(".bundled_product") ||
fromEl.closest(".cart") ||
fromEl.parentElement
);
}
function setQtyToZero(container) {
// Catch *any* number inputs inside the container (qty boxes)
container.querySelectorAll('input[type="number"], input.qty').forEach(function (inp) {
inp.value = 0;
inp.dispatchEvent(new Event("change", { bubbles: true }));
inp.dispatchEvent(new Event("input", { bubbles: true }));
});
}
function disableContainer(container) {
container.classList.add("gb-oos");
container.style.opacity = "0.4";
// Disable everything interactive inside
container.querySelectorAll("input, select, textarea, button").forEach(function (el) {
el.disabled = true;
el.setAttribute("aria-disabled", "true");
el.style.pointerEvents = "none";
});
// Kill links too
container.querySelectorAll("a").forEach(function (a) {
a.setAttribute("tabindex", "-1");
a.setAttribute("aria-disabled", "true");
a.style.pointerEvents = "none";
a.style.cursor = "not-allowed";
});
setQtyToZero(container);
}
function enableContainer(container) {
container.classList.remove("gb-oos");
container.style.opacity = "1";
container.querySelectorAll("input, select, textarea, button").forEach(function (el) {
el.disabled = false;
el.removeAttribute("aria-disabled");
el.style.pointerEvents = "";
});
container.querySelectorAll("a").forEach(function (a) {
a.removeAttribute("tabindex");
a.removeAttribute("aria-disabled");
a.style.pointerEvents = "";
a.style.cursor = "";
});
}
function update() {
// IMPORTANT: This targets bundle item "cart" blocks like the ones you saw in DevTools:
//
document.querySelectorAll('.cart[data-bundle_id="2577"]').forEach(function (cartEl) {
var stockEl = cartEl.querySelector(".stock");
var container = getItemContainer(cartEl);
if (!container) return;
if (isOutOfStock(stockEl)) {
disableContainer(container);
} else {
enableContainer(container);
}
});
}
update();
// Bundles update via AJAX; keep re-checking
var obs = new MutationObserver(function () { update(); });
obs.observe(document.body, { childList: true, subtree: true });
});