Corrección de widgets tipo “slides.default”

(function(jQuery) { ‘use strict’; const fixSlidesClases = function() { if (elementorFrontend && elementorFrontend.hooks) { // Filtramos específicamente por el widget de slides elementorFrontend.hooks.addAction(‘frontend/element_ready/slides.default’, function($scope) { // Buscamos el wrapper que debería tener la clase de swiper // En versiones recientes…Continue reading

Address Book.js

jQuery(function($){ const P = window.addressBookParams; if (!P) return; const $modal = $(‘#address_modal’).appendTo(‘body’), $grid = $(‘#address_book_grid’), $form = $(‘#address_form’), $header = $(‘.address-book-header’), $title = $(‘#modal_title’); function refresh(html){ $(‘.address-error-bar’).remove(); $grid.html(html); } function showError(msg){ $(‘.address-error-bar’).remove(); const $bar = $(` ${msg} `); $header.after($bar); }…Continue reading

Custom Checkout.js

/** * custom-checkout.js (canonical fields + live address refresh) * — Two-step navigation * — Ship-to-different handling via hidden input * — Address book modal (add/edit/delete) with instant UI refresh * — Address book integration on checkout * — Coupon…Continue reading

Shop Manager – View Only.js

add_action(‘admin_menu’, function () { $user = wp_get_current_user(); if (!in_array(‘shop_manager_-_view_only’, (array) $user->roles)) { return; } global $menu, $submenu; // Top-level menu whitelist $allowed_top = [ ‘index.php’, // Dashboard ‘woocommerce’, // WooCommerce ‘users.php’, // Users ‘woocommerce-marketing’, // Marketing ]; foreach ($menu as…Continue reading

Smash Ballon Content “load more” Link entfernen

jQuery(document).ready(function ($) { function unwrapSbiExpandLinks(context) { $(context).find(‘.sbi_expand > a’).each(function () { // entfernen, Inhalt behalten (z.B. …) $(this).replaceWith($(this).contents()); }); } // 1) initial unwrapSbiExpandLinks(document); // 2) nach Klick auf “Mehr laden” (zusätzliche Absicherung) $(document).on(‘click’, ‘#sbi_load .sbi_load_btn, .sbi_load_btn’, function () {…Continue reading

Smash Balloon Bild-Links Tabindex

jQuery(document).ready(function ($) { const observer = new MutationObserver(function () { $(‘.sbi_photo’).attr(‘tabindex’, ‘0’); }); observer.observe(document.body, { childList: true, subtree: true }); });Continue reading

HosaEna Header Solid Transition (copy)

(function(){ const header = document.querySelector(‘.site-header’); function setSolidByScroll(){ if(!header) return; if(window.scrollY > 50){ header.classList.add(‘he-solid’); } else { header.classList.remove(‘he-solid’); } } window.addEventListener(‘scroll’, setSolidByScroll, {passive:true}); document.addEventListener(‘DOMContentLoaded’, setSolidByScroll); if(header){ header.addEventListener(‘mouseenter’, ()=> header.classList.add(‘he-solid’)); header.addEventListener(‘mouseleave’, ()=> setSolidByScroll()); } })();Continue reading

HosaEna Header Solid Transition (copy)

(function(){ const header = document.querySelector(‘.site-header’); function setSolidByScroll(){ if(!header) return; if(window.scrollY > 50){ header.classList.add(‘he-solid’); } else { header.classList.remove(‘he-solid’); } } window.addEventListener(‘scroll’, setSolidByScroll, {passive:true}); document.addEventListener(‘DOMContentLoaded’, setSolidByScroll); if(header){ header.addEventListener(‘mouseenter’, ()=> header.classList.add(‘he-solid’)); header.addEventListener(‘mouseleave’, ()=> setSolidByScroll()); } })();Continue reading

Body on Scroll (copy)

;(function ($) { $(window).scroll(function() { var scroll = $(window).scrollTop(); if (scroll >= 5) { $(“body”).addClass(“scroll-500”); $(“.tm-header”).removeClass(“uk-blend-difference”); } else { $(“body”).removeClass(“scroll-500”); $(“.tm-header”).addClass(“uk-blend-difference”); } }); })(jQuery);Continue reading

SniffLightbox

document.addEventListener(‘envira_lightbox_open’, function(e) { console.log(“Lightbox si è aperto!”); console.log(“Dettagli dell’immagine:”, e.detail); // O e.data // e.detail conterrà informazioni come: // { src: “URL-immagine.jpg”, title: “Titolo”, caption: “Didascalia”, … } // Per trovare l’ID specifico dell’immagine (se disponibile o ricavabile dal contesto)…Continue reading