// File: shop-filter-presets.js jQuery(function($){ console.log('⚙️ shop-filter-presets.js loaded'); // ======================================================== // APPLY FILTERS (SIZES + SEASON) // ======================================================== function applyFilters(options) { var sizes = options.sizes || [], season = options.season || null; console.log('→ applyFilters()', sizes, season); // ~ Clear all checkboxes first $('.wlpf-group-filters-list input[type="checkbox"]').each(function(){ $(this).prop('checked', false); }); // ~ Check the matching tire sizes sizes.forEach(function(size){ $('.wlpf-group-filters-list input[type="checkbox"]').each(function(){ if ($(this).val() === size) { $(this).prop('checked', true); } }); }); // ~ Check the season if provided if (season) { $('.wlpf-group-filters-list input[type="checkbox"]').each(function(){ if ($(this).val() === season) { $(this).prop('checked', true); } }); } // ~ Trigger Woolentor refresh console.log('↻ triggering wlpf.update'); $('body').trigger('wlpf.update'); } // ======================================================== // PRESET BUTTONS // ======================================================== $(document).on('click', '.preset-button', function(e){ e.preventDefault(); // — Activate only the clicked button — $('.preset-button').removeClass('active'); $(this).addClass('active'); // — Gather filters from data attributes — var rawSizes = $(this).attr('data-sizes') || '', arr = rawSizes.split(','), sizes = [], season = $(this).attr('data-season') || ''; for (var i = 0; i < arr.length; i++) { var s = arr[i].trim(); if (s) sizes.push(s); } season = season.trim() || null; console.log('✋ preset-button clicked:', { sizes: sizes, season: season }); // — Apply the filters — applyFilters({ sizes: sizes, season: season }); }); // ======================================================== // CLEAR BUTTON (RESET EVERYTHING) // ======================================================== $(document).on('click', '.wlpf-group-clear-action-button', function(e){ e.preventDefault(); console.log('🧹 Clear All clicked – resetting buttons'); // ~ Remove active state from all preset buttons $('.preset-button').removeClass('active'); // ~ Uncheck all filters $('.wlpf-group-filters-list input[type="checkbox"]').each(function(){ if ($(this).prop('checked')) { $(this).prop('checked', false).trigger('change'); } }); // ~ Trigger Woolentor update $('body').trigger('wlpf.update'); }); }); Filter Section – Chinook Tire

Season And Size

Season

Tread Width

Aspect Ratio

Rim

Tire Size

ROADCRUZA 235/55/R19

Roadcruza RA-710 UHP All Season/Summer

$162.50 +GST

ROADCRUZA 235/40/ZR19

Original price was: $162.50.Current price is: $149.75. +GST
Sale!

ROADCRUZA 235/40/ZR19

Roadcruza RA-710 UHP All Season/Summer

Original price was: $162.50.Current price is: $149.75. +GST

ROADCRUZA 225/55/R19

Original price was: $162.25.Current price is: $137.50. +GST
Sale!

ROADCRUZA 225/55/R19

Roadcruza RA-710 UHP All Season/Summer

Original price was: $162.25.Current price is: $137.50. +GST

ROADCRUZA 215/50/R17

Roadcruza RA-710 UHP All Season/Summer

$112.50 +GST

ROADCRUZA 10PLY LT285/70/R17

Roadcruza 10Ply RA-1100 A/T All Terrain / All Season

$274.75 +GST

RAPID LT285/55R20

Rapid XTERRAIN Mud Terrain

$180.00 +GST