Skip to content
IvaSure add-ons and services for SureCart storesJoin the POD waitlist

AJAX is not refreshing

2 min read
Published

If clicking a filter changes the address bar but not the products, the filter is working and the results target is wrong. Everything else in this article is a variation on that.

The results target

A filter updates whatever element you point it at. The default suits SureCart’s own product list; a custom grid needs the class you gave it.

Point at your own container
[ivasure results_target=".my-own-grid"]
  1. Open the storefront and inspect the element wrapping your products.
  2. Take the class actually on that element - not the one you meant to add.
  3. Set results_target to it, including the leading dot.
A target that matches nothing fails silently
The filter has nowhere to put the results, so it puts them nowhere. There is no error, which is exactly why this is worth checking first rather than last.

Custom markup needs document mode

If the grid is your own - an Etch loop, a custom template - the filter cannot know how to rebuild your cards. Document mode fetches the filtered page and swaps your grid out of it, so your markup is preserved exactly.

Keep your own card design
[ivasure results_target=".my-own-grid" results_fetch_mode="document"]

Without it, a custom grid may be replaced by generic markup - which usually reads as “my design disappeared” rather than “the fetch mode is wrong”.

If the target is right

  • Check the browser console. A JavaScript error from another plugin stops IvaSure’s script along with everything else on the page.
  • Check for a 429. Live filtering is rate limited. On a trip the grid keeps what it has rather than erroring, which can look like nothing happening. The next request works.
  • Try with JavaScript off. Every option is a real link, so filtering still works - if it works there and not with JavaScript on, the problem is on the client, not the server.
That last check is the fastest way to split the problem in half
Server-side filtering and client-side updating are separate mechanisms. Proving one of them works tells you which half to look at.

Save to list