Skip to content

Reference

The enumerable part of this section is written from Product Search's own code by oce docs:reference, so it cannot drift away from what the version you installed does:

  • Settings: every setting, whether it is a key in OpenCart's own table or a column of a synonym group or a merchandising rule, what each one decides, where it applies, and what Product Search fixes on purpose.
  • The API: the one read resource an integration may call, every field on it, and what the promise covers.
  • What this holds about a person: every column of the four tables, and why none of them is about anybody.
  • Security verdict: how Product Search answers the shared security baseline.
  • What it costs: the queries, bytes and requests it adds to nineteen stock storefront pages.

The rest of this page is the part a generated list cannot say: what Product Search puts in your database, what it hangs off, and what each screen is for.

The screens

All four are tabs of one screen, at Extensions → Extensions → Modules → Product Search → Edit.

Tab What it holds
Settings The settings, with typo tolerance answered once per language and a shopfront picker on a multi-store install.
Synonyms One row per group: the language, the terms, and whether the group is live. Rows are added and removed on the form and stored by the header Save, which stores the settings in the same press.
Merchandising The rule list, filtered by keyword and language. Add and Edit open a rule editor of its own; Delete acts on one rule, after asking.
Reports The search counters for one store and one language, over a date range, with a switch for zero-result terms only. Each row links to the two things you can do about it.

A rule is saved from its own editor rather than from the header Save, so that one button means the same thing whichever tab is showing.

The four tables

Named without your store's table prefix, which is oc_ unless you changed it:

Table Holds Scope
product_search_synonym One row per synonym group: its language, its terms newline-delimited, and its status. Per language
product_search_merchandising One row per merchandising rule: its language, its keyword, and its pinned product ids in order. Per language, one rule per keyword
product_search_stat One row per store, language, category, keyword and day, carrying two counters. Per store and language
product_search_setting Product Search's own copy of your settings, which is what survives an update. Per store

None of them is dropped when the extension is uninstalled. Emptying them is something you do on purpose; see limits and guarantees.

The counters table holds a keyword, a day and two numbers. There is no IP address, no customer id and no session id, and no column to put one in.

The permission

extension/product_search/module/product_search

One entry for Product Search's own screen. OpenCart checks the route up to its last dot, so every screen and every save above is checked against this one string. The two data-protection screens under Customers have routes of their own, which enabling the extension grants to your user group. See requirements and install.

What it hangs off

Product Search edits no OpenCart file. Its search work hangs off two of OpenCart's own events, under the code product_search:

Trigger What the listener does
after model/catalog/product getProducts Replaces the rows a storefront search came back with, with your pins in front of them.
after model/catalog/product getTotalProducts Replaces the number the storefront paginates on, and counts the search.

You will see four rows for those two. OpenCart 4.0.2.x and 4.1.x spell the same trigger differently (one with a slash before the method name and one with a dot), so both spellings are registered and each store fires one of each pair. Registering both stops the extension going silently inert the day you take OpenCart's next point release. All four run at sort order 0, ahead of other extensions' listeners on the same events, so a price rewrite such as B2B Pricing's is applied to the rows Product Search returns rather than thrown away with the rows core returned.

Four more rows serve the extension's own housekeeping: two under product_search that pick which of its translations the admin and the storefront are served (it ships no storefront text, so only the admin one ever has anything to serve), and product_search_personal_data and product_search_personal_data_menu, which answer the Personal Data screen and put it on the Customers menu. That is eight rows in all.

Both listeners stand aside unless the request is a shopper searching and the module is switched on. The same events fire from category pages, manufacturer pages, order tracking and the menu's product counts, and Product Search answers none of them.

Uninstalling deletes all eight rows, and the storefront is OpenCart's again in the same request.