# Home

Source: https://ballaratscheapestcars.com.au/

### Ready to find

### your next car?

Family owned and operated since 1992, providing the Ballarat community with quality used vehicles and personalised service.

## Ballarats most affordable, trusted car dealer

### Search our Cars

Make

Model

Badge

## Price

## Year

## Keywords

[![Dual Cab Chassis](https://via.placeholder.com/80x40?text=Car) Dual Cab Chassis (1)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:619) [![Hatchback](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/10/Hatchback.svg) Hatchback (6)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:58) [![Sedan](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/09/Ballarats-Cheapest-cars-icons-Sedan.svg) Sedan (5)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:9) [![Sportswagon](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/09/Ballarats-Cheapest-cars-icons-wagon.svg) Sportswagon (1)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:95) [![SUV](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/10/SUV.svg) SUV (1)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:110) [![Utility](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/10/Ute.svg) Utility (10)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:101) [![Wagon](https://ballaratscheapestcars.com.au/wp-content/uploads/2025/09/Ballarats-Cheapest-cars-icons-wagon.svg) Wagon (42)](https://ballaratscheapestcars.com.au/our-vehicles/?jsf=jet-engine:vehicles&tax=body-type:19)

Show 66 Results

Reset

in your HTML const selectors = { make: 'select[name="make"]', model: 'select[name="model"]', badge: 'select[name="badge"]', keywords: 'input[name="query"]' }; function buildParams() { const usp = new URLSearchParams(); usp.set('jsf', 'jet-engine:vehicles'); for (const key in selectors) { const el = document.querySelector(selectors[key]); if (!el || !el.value || el.value === 'Any') continue; if (key === 'keywords') { usp.set('_s', el.value); } else { usp.append('tax[]', key + ':' + el.value); // ✅ taxonomy filter } } // Price range const priceSelects = document.querySelectorAll('select[name="price"]'); if (priceSelects.length === 2) { const minPrice = priceSelects[0].value; const maxPrice = priceSelects[1].value; if (minPrice && maxPrice && minPrice !== 'Minimum' && maxPrice !== 'Maximum') { usp.append('meta', `price!range:${minPrice}_${maxPrice}`); } } // Year range const yearSelects = document.querySelectorAll('select[name="year"]'); if (yearSelects.length === 2) { const minYear = yearSelects[0].value; const maxYear = yearSelects[1].value; if (minYear && maxYear && minYear !== 'Minimum' && maxYear !== 'Maximum') { usp.append('meta', `year!range:${minYear}_${maxYear}`); } } return usp.toString(); } async function updateResultCount() { const query = buildParams(); if (!query) { resultCountEl.textContent = ''; return; } try { const res = await fetch('/wp-json/myplugin/v1/vehicle-count?' + query); const data = await res.json(); resultCountEl.textContent = `Show ${data.count} Results`; } catch (e) { console.error(e); resultCountEl.textContent = '…'; } } // Watch for changes document.querySelectorAll('select, input').forEach(el => { el.addEventListener('change', updateResultCount); el.addEventListener('keyup', updateResultCount); }); // Run once on load updateResultCount(); const resetBtn = document.getElementById('filters-reset-btn'); if (resetBtn) { resetBtn.addEventListener('click', function (e) { e.preventDefault(); document.querySelectorAll('select, input').forEach(el => { if (el.tagName === 'SELECT') { el.selectedIndex = 0; } else if (el.type === 'text' || el.type === 'search') { el.value = ''; } }); updateResultCount(); // <--- should run here }); } });
