PATH:
home
/
thebhoeo
/
public_html
/
officepoint
/
wp-content
/
themes
/
woodmart-child
jQuery(function ($) { var $doc = $(document.documentElement); var $toggle = $('#vat-toggle'); function markCurrentAmounts(scope) { var $root = scope ? $(scope) : $(document); $root.find('.price').each(function () { var $p = $(this); // Clean previous marks $p.find('.vat-current-amount').removeClass('vat-current-amount'); var $current; // If on sale, the visible price is inside <ins> $current = $p.find('ins .woocommerce-Price-amount').first(); // If not on sale, pick the first amount NOT in <del> or suffix if (!$current.length) { $current = $p.find('.woocommerce-Price-amount').filter(function () { var $amt = $(this); return $amt.closest('del, .woocommerce-price-suffix, small.woocommerce-price-suffix').length === 0; }).first(); } if ($current && $current.length) { $current.addClass('vat-current-amount'); } }); } // Initial class from localStorage (set in wp_head), sync toggle var isEx = $doc.hasClass('vat-ex'); $toggle.prop('checked', !isEx); // Run once on load markCurrentAmounts(); function setMode(mode) { $doc.removeClass('vat-inc vat-ex').addClass(mode === 'ex' ? 'vat-ex' : 'vat-inc'); try { localStorage.setItem('vat_mode', mode); } catch (e) {} } $toggle.on('change', function () { setMode(this.checked ? 'inc' : 'ex'); }); // Re-mark after AJAX reloads / fragment updates $(document).on('woodmart-ajax-content-reloaded updated_wc_div wc_fragments_refreshed', function (e) { markCurrentAmounts(e.target); }); });
[-] style.css
[edit]
[-] vat-toggle.css
[edit]
[-] functions.php
[edit]
[+]
woocommerce
[+]
..
[-] screenshot.png
[edit]
[-] vat-toggle.js
[edit]