{
    const queryString = new URLSearchParams(new FormData($refs.filter_form)).toString()
    loading = true;
    fetch('/collections/all-products?' + queryString)
      .then(response => response.text())
      .then(data => {
        let html_div = document.createElement('div');
        html_div.innerHTML = data;
        let html_dom = html_div.querySelector('#ProductGridContainer').innerHTML;
        document.querySelector('#ProductGridContainer').innerHTML = html_dom;
        // update url without refreshing the page
        history.replaceState(null, null, '?' + queryString);
      })
      .catch(error => console.error('Error:', error))
      .finally(() => loading = false);
  })"
  >
    
    
          - Featured
- Best selling
- Alphabetically, A-Z
- Alphabetically, Z-A
- Price, low to high
- Price, high to low
- Date, old to new
- Date, new to old
- 
                
        Cat Recliner Cat BedRegular price $149.90
- 
                
        Refrigerator Storage BoxRegular price $19.99
- 
                
        Spray BottleRegular price $23.90
- 
                
        headphonesRegular price $43.99
- 
                
        Basketball LampRegular price $36.90
- 
                
        Upside down wine glass rackRegular price $139.99
- 
                
        Wine Bottle HolderRegular price $24.99
- 
                
        Intelligent Plant Growth LightRegular price $109.90
- 
                
        Solar Step LightRegular price $25.90
- 
                
    Sale    Hair Growth Products$34.99 $17.99
- 
                
        Electric \ To Blackheads Beauty InstrumentRegular price $32.00
- 
                
        Neck MassagerRegular price $44.90
- 
                
        Lumbar Spine CorrectorRegular price $35.99
- 
                
        cat humidifierRegular price $39.90
- 
                
        Dog Life Vest Summer SharkRegular price $33.99
- 
                
    Sale    Pet tactical collar$49.90 $25.99
 
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
               
            
           
            
              