In Part 1, we covered the architecture and setup of integrating Searchspring with Optimizely.
Now let’s move into the practical side—how to render search results, implement merchandising features, and handle real-world challenges.
Unlike traditional Optimizely rendering, Searchspring integrations are typically frontend-driven.
Instead of server-side rendering:
const loadProducts = async () => {const response = await fetch(`/api/searchspring?q=${query}`);const data = await response.json();renderProducts(data.results);};
This approach improves performance and gives more flexibility for UI updates.
One of the most powerful features is inline banners inside product listings.
These are controlled via Searchspring and injected into the product grid.
products.forEach((product, index) => {if (banner && index === banner.position) {renderBanner(banner);}renderProduct(product);});
Important: This logic must run every time products are re-rendered.
Here are some common issues (and fixes) from real implementations:
Problem: Only a subset of products (e.g., 23 out of 90) appears.
Cause:
Incorrect resultsPerPage or page handling.
Fix: Ensure correct paging parameters are passed in API calls.
Problem: Banner appears on page 1 but disappears on page 2.
Cause: Product list is refreshed via AJAX.
Fix: Reapply banner logic after every API response.
Example:
WSHWHSFix: Add a transformation layer in feed generation to standardise values.
Problem: Changes not reflecting immediately.
Fix:
Searchspring + Optimizely is a powerful combination for composable commerce.
Together, they create a scalable and high-performance solution.
If you’re working with large product catalogs and need advanced merchandising capabilities, integrating Searchspring with Optimizely is a strong architectural choice.
Quick Links
Legal Stuff
