Skip to content

Boost AI Search & Filter

Platmart Color Swatches works with Boost AI Search & Filter by Boost Commerce. Boost narrows the collection, and swatches show the color choices on each product card.

What you need to do depends on your Boost version:

  • Boost V3: nothing. Turn on the Collection swatches app embed, and swatches appear on Boost’s product cards and stay there when shoppers filter, sort, or paginate.
  • Boost V2: add the snippet below. Your store is on V2 if your theme has files that start with boost-pfs-.
  • Boost V1 or Turbo: contact support with your store URL, and we’ll send the right setup.

Boost V2 draws product cards from its own template and redraws them each time results change. Swatches need a container in that template and a reload call after each redraw.

  1. In your theme editor, open App embeds and turn on Collection swatches.

  2. Open boost-pfs-filter-html.liquid and add the swatch container where you want swatches to appear:

    <div data-pl-swatches-collection data-product-id="{{product.id}}" data-product-url="{{itemUrl}}"></div>

    If your theme doesn’t have that file, open boost-pfs-filter.js and add the same container to the productGridItemHtml variable, using Boost’s own variables:

    <div data-pl-swatches-collection data-product-id="{{itemId}}" data-product-url="{{itemUrl}}"></div>
  3. In boost-pfs-filter.js, add this to the Filter.prototype.afterRender function so swatches reload after Boost redraws the grid:

    if (typeof PlatmartSwatchesCollection != 'undefined') {
    PlatmartSwatchesCollection.load()
    }
    if (typeof PlatmartVariantSwatchesCollection != 'undefined') {
    PlatmartVariantSwatchesCollection.load()
    }

Swatches now stay on product cards when shoppers filter or paginate.