PS PrestaShop Intermediate

No Search Results Documentation: Rescue Page and Alerts

Install, configure and run dfzerosearch 1.3.0: rescue page, similar references, exact, contains and wildcard rules (M91650*), CSV import, automatic notify-me alerts and rescued revenue.

Updated Module version 1.3.0

Overview

The No Search Results module (dfzerosearch) takes over when a search on your shop finds nothing. Instead of an empty page, the visitor sees a rescue page: the target you chose for that query, products whose reference looks like the one typed, the corrected search, a broader search, the best sellers of the guessed category and a “notify me” form.

In the back office, every lost search is counted. You link it to a product, a category, another search or a URL, with an exact, “contains” or wildcard rule. The module then measures what these rescues bring in: rescue rate, orders and revenue excluding tax.

New in 1.3.0: a Similar references block (a search for M91650-0005 shows M91650-0001 and M91650-0002) and wildcard rules (M91650* covers a whole reference family with a single rule).

Installation and upgrade

First installation

  1. Open Modules > Module Manager and click Upload a module.
  2. Select the dfzerosearch.zip archive.
  3. The module creates its tables, its admin menu and its default settings. It is active straight away.
  4. Copy the scheduled task URL shown on the configuration page and schedule it every hour (see below).

Upgrading from a previous version

Upload the new ZIP over the old one, without uninstalling. PrestaShop runs the upgrade scripts: new columns, new settings with their default value, module cache cleared. Your lost queries, rules, subscribers and statistics are kept.

Do not uninstall the module to upgrade it: uninstalling deletes its tables and therefore all history.

Configuration

The Configure page starts with shortcuts to the module’s three screens, followed by three settings panels and the scheduled task panel.

Rescue page

  • Enable module: turns detection and the rescue page on or off.
  • Typo correction (“Did you mean…”): corrects typos word by word against your search index and shows the matching products.
  • Similar references: for a reference that is not in your catalog, shows the products whose reference starts the same way. Dashes, spaces and case are ignored, combination references are included.
  • Partial match: when a long query fails because of one word (“leather boots size 45”), shows the results of the closest shorter query.
  • Best sellers of the guessed category: matches the query against category names, subcategories included.
  • Global best sellers fallback: shown only when no other block found anything. Newest products are used if the shop has no sales yet.
  • “Notify me” form: visitors leave their email to be told when their search finds a product.
  • Use the theme product miniatures: products look exactly like your category pages (add to cart, quick view, labels). When disabled, the module uses its compact cards.
  • In-stock products only: hides out-of-stock products from every block.
  • Custom message (per language): text shown at the top of the rescue page, for example a phone number or a link to special orders. %query% is replaced by the searched words.
  • Popular searches: clickable chips with searches that work. Enter your own list per language, or leave it empty to use frequent searches that return results.
  • Products per block: 1 to 24 (8 by default).

Tracking and data

  • Minimum query length: shorter searches are neither logged nor rescued (2 by default).
  • Treat approximate-only results as lost: PrestaShop’s native fuzzy search often returns unrelated products for an unknown word. When a search only finds that kind of result, it is counted as lost and the rescue block is shown above them.
  • Ignore bots and crawlers: searches from search engines, SEO tools and scripts are not logged.
  • Attribution window (days) (7 by default): an order placed within this period after a rescue is credited to the query and block that brought the visitor back (last touch).
  • Cache rescue results: keeps the search work for 15 minutes per query. Prices and stock stay live. The cache is cleared as soon as you change a setting or a rule.
  • Retention (days) (180 by default): lost queries not seen for this long and subscriptions already notified are deleted by the scheduled task. 0 keeps everything. A button purges immediately.

Automation

  • Automatic notify-me emails: subscribers are emailed as soon as their query gets an active rule or the search finds products again.
  • Weekly digest: every 7 days, lost searches, rescue rate and top lost queries, sent by email.
  • Digest recipient: leave empty to use the shop email address.

Scheduled task

The Scheduled task (cron) panel shows a token-protected URL. Call it every hour from cPanel, Plesk or any cron service, for example:

0 * * * * curl -s "https://www.your-shop.com/module/dfzerosearch/cron?token=..." > /dev/null

It sends the automatic notify-me emails, applies retention and sends the weekly digest. The panel shows the date of the last run, a Run now button starts the task by hand and Generate a new token replaces the URL if it has leaked. In multistore, set up one task per shop with the URL shown in each shop context.

If the task has not run for 48 hours, a warning appears on the dashboard: automatic emails and the weekly digest are on hold until it runs again.

The rescue page

When the results grid is empty, a script loads the rescue page through AJAX. Searches that do find products are not slowed down. Blocks appear in this order, with no duplicate product from one block to the next:

  1. Your rule: if an active rule matches the query, its target is highlighted. In redirect mode, the visitor lands directly on the target. A synonym also shows its products.
  2. Similar references: products from the same reference family.
  3. “Did you mean…”: the corrected query and its products, with a link to the corrected search. This block only appears when the previous blocks showed nothing.
  4. Partial match: results of the shortened query, only if nothing has been found yet.
  5. Best sellers of the guessed category.
  6. Global best sellers: last resort only.

The custom message is shown above the blocks, popular searches and the notify-me form below them.

Similar references

Many customers search for a product by its exact reference. When that reference does not exist in your catalog, the module offers the products of the same family.

  • The module picks the word in the query that looks like a reference: at least 5 characters, including at least 2 digits.
  • It compares that word with product and combination references, ignoring dashes, spaces, dots and case. M91650-0005, m91650 0005 and M916500005 are treated the same way.
  • Only products sharing a long enough reference start are kept (at least 5 characters and 60% of the searched reference). The closest ones come first.
  • Example: a search for M91650-0005 shows M91650-0001 and M91650-0002, but not M91651-0003.

Typo correction never touches a word containing at least 2 digits: a reference is not “corrected” into another one.

Rules: mappings and synonyms

The Mappings & synonyms screen lists your rules. To create one, click Add a mapping, or use the Map action on a lost query, which prefills the form.

Match types

  • Exact: the query must be identical to the rule. Case, accents and extra spaces are ignored.
  • Contains: the rule must appear as a word or sequence of words in the query. Dashes, slashes, dots and other separators count as spaces: the rule m91651 applies to M91651-0003.
  • Wildcard: * stands for any sequence of characters and ? for a single character. M91650* covers M91650-0001, M91650-0007 or m916500009, but not M91659-0001. Any rule containing * or ? is saved as a wildcard automatically.

A wildcard rule needs at least 3 characters besides the wildcards, and ** is rejected. Write M91650* rather than M91650-* if your customers also type the reference without a dash.

Priorities

When several rules match a query, the most precise one wins: an exact rule comes before a wildcard rule, which comes before a “contains” rule. For the same type, a rule for a specific language comes before an “all languages” rule, then the longest rule wins.

Targets and modes

  • Product: search by name, reference or ID in the form.
  • Category.
  • Synonym (other search): other words that do return products (“sweatshirt” for “pullover”). The products of that search are shown on the rescue page.
  • Custom URL: absolute URL or path starting with a slash.

Each rule works in Suggest mode (target highlighted on the rescue page) or Redirect mode (the visitor lands directly on the target). A rule can target one language or all languages.

CSV import and export

The Import / export (CSV) panel on the rules screen imports up to 5,000 rows and exports all your rules. Separator ; or ,, header row optional. Columns:

query ; match ; language ; type ; target ; mode ; active
M91650* ; wildcard ; all ; category ; 12 ; redirect ; 1
pullover ; exact ; en ; search ; sweatshirt ; suggest ; 1
M91651 ; contains ; all ; product ; M91651-0003 ; suggest ; 1
  • match: exact, contains or wildcard (exact by default, wildcard detected automatically when the rule contains * or ?).
  • language: ISO code, or empty, * or all for all languages.
  • type: product, category, search or url.
  • target: product ID or reference, category ID, words to search or URL.
  • mode: suggest or redirect (suggest by default). active: 1 or 0 (1 by default).

An existing rule with the same query and language is updated. The import report lists created, updated and rejected rows with their line number.

Notify-me alerts

The form on the rescue page has a consent box unchecked by default and a hidden trap field against bots. For a logged-in customer, the email is prefilled. Requests are listed on the Notify-me requests screen with their status.

With the scheduled task and the Automatic notify-me emails option, the subscriber receives the dfzerosearch_alert email in their language as soon as their query gets an active rule or the search finds products again. You can also send it by hand with the Notify action on a rule. Every email contains an unsubscribe link.

Dashboard and rescued revenue

The Lost queries screen shows the figures for the last 30 days: lost searches, rescue rate, orders after rescue, rescued revenue excluding tax, new subscriptions and pending emails. One chart compares lost and rescued searches day by day, another shows clicks per rescue block (rule, similar references, correction, partial match, category, best sellers, popular searches).

The lost query list is sorted by volume. Each row offers Map, Ignore / restore and, when a correction was found, Create a synonym from this correction. The Latest orders after a rescue table shows the credited query and block.

Attribution is last touch: the order is credited to the latest rescue of the same visitor within the attribution window set in the configuration.

Weekly digest

Every 7 days, the scheduled task sends the dfzerosearch_digest email: lost searches, rescued visitors, rescue rate, orders and revenue excluding tax after rescue, new notify-me requests and the most frequent lost queries. If nothing happened during the week, no email is sent.

GDPR

  • Explicit consent: box unchecked by default and a clear consent text.
  • Official GDPR module: the module is registered with psgdpr. Exporting and deleting a customer’s data covers their notify-me requests.
  • Unsubscribe: a link in every email.
  • Retention: automatic purge of old queries and notified subscriptions.
  • Self-hosted: no data is sent to a third-party service.

Compatibility and technical information

  • PrestaShop 8.0 to 9.x, multistore.
  • Interface and emails in English, French, Spanish, German and Italian.
  • Hooks: actionSearch, actionFrontControllerSetMedia, actionValidateOrder, registerGDPRConsent, actionDeleteGDPRCustomer, actionExportGDPRData.
  • Tables: dfzerosearch_query, dfzerosearch_mapping, dfzerosearch_alert, dfzerosearch_stat, dfzerosearch_session, dfzerosearch_conversion.
  • AdminDfZeroSearch menu under Modules, with three screens: lost queries, mappings and synonyms, notify-me requests.
  • Front controllers: rescue (rescue page, JSON), cron (scheduled task, token) and unsubscribe.
  • No dependencies: no Composer, JavaScript without jQuery, no external service.

Troubleshooting

  • The rescue page does not appear: check that the module is enabled and that the search really returns zero results, then clear the PrestaShop and browser caches. With a heavily customized theme, contact us with the theme name.
  • A search shows unrelated products and is not counted as lost: enable Treat approximate-only results as lost.
  • No similar references: the searched word needs at least 5 characters including 2 digits, and active products visible in search must share the start of that reference.
  • A wildcard rule does not apply: check that it is active, in the right language, and that no exact rule takes priority. Try it without a separator (M91650*) if customers type the reference in several ways.
  • No correction is offered: correction only suggests words found in the index; rebuild the PrestaShop search index if your catalog changed a lot.
  • Automatic emails or the digest are not sent: check the last run date of the scheduled task and the PrestaShop email settings. The Notify button shows an explicit error when sending fails.
  • The dashboard stays empty: check the minimum query length and test from a regular browser, since bots are ignored.
Was this page helpful?

Still stuck? Contact support