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

Targeting your product grid

2 min read
Published

Filters updates one region of the page rather than reloading it, so it has to know which region holds your products. By default it looks for the SureCart product list. If your grid comes from a page builder or a custom template, tell Filters where it is.

The symptom
The filter renders, the counts look right, the address bar updates - and the products never change. That is almost always a targeting problem, not a broken filter.

Pointing at your own grid

Give results_target the CSS selector of the element that wraps all of your products - the container, not one card.

Narrow the element with class my-own-grid
[ivasure results_target=".my-own-grid"]
A product grid inside a custom container, showing the seven products that remain after a Bedroom filter has been applied.
A filter narrowing a grid it did not create.
  1. The targeted container. Filters replaced what is inside it and left the rest of the page alone.

Choosing the right selector

  • Wrap all the products, not each one. A selector matching every card gives Filters nothing to replace.
  • Prefer a class you control over one your theme generates. Generated class names change when the theme updates, and your filter stops working with no error.
  • If several elements match, the first is used. Make it unique.

When the grid still does not update

If the target is right and the products still do not change, the grid is probably rendering in a way Filters cannot swap in place. Switch that placement to the document fetch mode, which re-fetches the page and swaps the region from the response:

The escape hatch for custom and page-builder grids
[ivasure results_target=".my-own-grid" results_fetch_mode="document"]

It is slightly slower than the default because it fetches the whole document, but it works with grids that nothing else can reach - which is why it exists.

No JavaScript, no problem
Every option is a real link and every control is a real form, so filtering still works with JavaScript off. It falls back to a normal page load rather than doing nothing.

Save to list