$0.00 0

Cart

No products in the cart.

Continue shopping

blog details

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

about author

admin

comments

  1. Hi, this is a comment.
    To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard.
    Commenter avatars come from Gravatar.

Leave a Reply

Your email address will not be published. Required fields are marked *

related blogs

  • +1 (605) 475 6968
  • 400 broad st, seattle, WA
  • info@oclock.com
© 2023 Oclock. all rights reserved
document.addEventListener("DOMContentLoaded", function () { function updateButtonText() { const selectedMaterialElement = document.querySelector('.variable-items-wrapper[data-attribute_name="attribute_material-piece"] .variable-item.selected'); const selectElement = document.querySelector('select[name="attribute_material-piece"]'); const addToCartButton = document.querySelector('.single_add_to_cart_button'); if (!addToCartButton) { console.error("Add to Cart button not found."); return; } let selectedMaterial = ""; // Check the selected visible button first if (selectedMaterialElement) { selectedMaterial = selectedMaterialElement.dataset.value; } // If no button is selected, check the dropdown (in case Breakdance triggers this) const selectElement = document.querySelector('select[name="attribute_material-piece"]'); if (selectElement) { selectElement.addEventListener("change", updateButtonText); } // Backup: Use MutationObserver to detect any UI updates const observer = new MutationObserver(updateButtonText); observer.observe(document.body, { subtree: true, childList: true }); // Run once on page load updateButtonText(); });