Contact Us On Whatsapp

Search
VAT Inclusive VAT Exclusive
VAT Inclusive
Shop All Products
    Menu Close
    0.0 0
    Write your own review Close
    • Only registered users can write reviews
    • Product can be reviewed only after purchasing it
    *
    *
    • Bad
    • Excellent
    // Mailchimp validation script loader (function () { var mc = document.createElement("script"); mc.type = "text/javascript"; mc.src = "//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"; document.head.appendChild(mc); })(); // Mailchimp field setup (function ($) { window.fnames = []; window.ftypes = []; fnames[0] = "EMAIL"; ftypes[0] = "email"; fnames[4] = "PHONE"; ftypes[4] = "phone"; fnames[1] = "FNAME"; ftypes[1] = "text"; fnames[2] = "LNAME"; ftypes[2] = "text"; fnames[9] = "PROD1"; ftypes[9] = "text"; fnames[6] = "MMERGE6"; ftypes[6] = "dropdown"; fnames[3] = "ADDRESS"; ftypes[3] = "address"; fnames[5] = "BIRTHDAY";ftypes[5] = "birthday"; fnames[7] = "COMPX"; ftypes[7] = "radio"; fnames[8] = "MMERGE8"; ftypes[8] = "text"; })(jQuery); var $mcj = jQuery.noConflict(true); // === Pass product name from clicked image link into Mailchimp field (#mce-PROD1) === document.addEventListener("DOMContentLoaded", function () { var links = document.querySelectorAll("#clondalkin-category-grid a.clondalkin-category-item"); var prodField = document.getElementById("mce-PROD1"); if (!links.length || !prodField) return; function titleCase(str) { return str.replace(/\s+/g, " ").trim().toLowerCase().replace(/(?:^|\s)\S/g, function (c) { return c.toUpperCase(); }); } function deriveNameFromImg(imgEl) { if (!imgEl) return ""; // 1) alt text if (imgEl.alt && imgEl.alt.trim()) return imgEl.alt.trim(); // 2) filename fallback try { var src = imgEl.currentSrc || imgEl.src || ""; var file = src.split("?")[0].split("/").pop() || ""; var base = file.replace(/\.[a-z0-9]+$/i, ""); // strip extension base = base.replace(/[_-]+/g, " "); // underscores/dashes -> spaces return titleCase(base); } catch (e) { return ""; } } function getProductNameFromLink(a) { // Priority: data-product > title attribute > img alt/filename var dataName = a.getAttribute("data-product"); if (dataName && dataName.trim()) return dataName.trim(); var titleAttr = a.getAttribute("title"); if (titleAttr && titleAttr.trim()) return titleAttr.trim(); var img = a.querySelector("img"); var fromImg = deriveNameFromImg(img); if (fromImg) return fromImg; // Last resort: use the link text return (a.textContent || "").trim(); } function setMailchimpField(value) { prodField.value = value; // Fire an input event so Mailchimp validators/listeners (if any) pick it up prodField.dispatchEvent(new Event("input", { bubbles: true })); } links.forEach(function (a) { a.addEventListener("click", function () { var name = getProductNameFromLink(a); if (name) setMailchimpField(name); // Optional: smooth scroll the user to the form field // prodField.scrollIntoView({ behavior: "smooth", block: "center" }); // NOTE: We are NOT preventing navigation (e.g., tel: links). // If you want to keep users on the page, uncomment the next line: // event.preventDefault(); }); }); });