Skip to content
Menu

OpenCart

Install the SeekGist module on OpenCart 2.x, 3.x or 4.x.

The SeekGist module works with OpenCart 2.x, 3.x and 4.x on PHP 7.4 or newer (with cURL and mysqli). It was tested on OpenCart 2.1.0.1, 3.0.4.0 and 4.0.2.3 with made-up test data.

What the module does

  • Search results page. Your search page asks SeekGist for product ids, then OpenCart shows its own product cards. Prices, specials, tax and customer-group prices stay exactly as OpenCart computes them. Your search URL does not change.
  • Safe fallback. If SeekGist does not answer within 300 ms, or answers with an error, the store's own search serves that request. After 5 errors in 60 seconds the module skips SeekGist for 30 seconds. See Store fallback.
  • Suggestions while typing, keyboard and screen-reader friendly, right-to-left for Arabic. Recent searches stay only in the shopper's browser.
  • Tracking of clicks on results, add-to-cart and orders, sent later by the cron job.
  • Product sync right after you save a product, from a cron job every 5 minutes (it also catches stock changes from orders), and a full sync once a day.
  • Translation write-back (optional): approved translations from SeekGist are written into your store's language rows. Text a person typed is never replaced.

1. Before you start

  1. Create your store in the SeekGist dashboard and choose OpenCart in the setup wizard.
  2. Open Settings > API keys and copy two keys: the public key (sg_pub_..., used in your pages) and the secret key (sg_sec_..., used only by your server for product sync).
  3. Make a backup of your store files and database.
  4. Pick the package for your OpenCart version:
OpenCartPackageHow it hooks in
2.0 - 2.3seekgist-opencart-2.x-1.0.0.ocmod.zipFiles + an OCMOD file that adds 4 small hooks
3.xseekgist-opencart-3.x-1.0.0.ocmod.zipEvents only. No core file is changed
4.xseekgist.ocmod.zip (keep this exact file name)Events only. No core file is changed

2. Install

OpenCart 4.x

  1. Extensions > Installer: upload seekgist.ocmod.zip, then click Install next to it.
  2. Extensions > Extensions, choose Modules, find SeekGist Search, click Install.
  3. Click Edit and go to Settings.

OpenCart 3.x

  1. Extensions > Installer: upload seekgist-opencart-3.x-1.0.0.ocmod.zip.
  2. Extensions > Extensions, choose Modules, find SeekGist Search, click Install (the green +).
  3. Click Edit (the pencil) and go to Settings.

OpenCart 2.x

OpenCart 2.x copies extension files only through FTP, and most stores do not set that up. So:

  1. Unzip the package. Upload the contents of the upload/ folder into your store's main folder (the one with index.php), with FTP, SFTP or your hosting file manager.
  2. Extensions > Extension Installer: upload seekgist.ocmod.xml (it is in the package, next to upload/).
  3. Extensions > Modifications: click Refresh (blue button, top right).
  4. Extensions > Modules: find SeekGist Search, click Install, then Edit.

If your theme or another extension changed catalog/model/catalog/product.php a lot, check Extensions > Modifications > Log after the refresh. Each of the 4 hooks must say it was found. If one says NOT FOUND, the store keeps working without SeekGist.

3. Settings

FieldWhat to enter
SeekGist searchOn to use SeekGist. Off = your store's own search, at once
API addresshttps://api.seekgist.com (leave as is)
Public keysg_pub_...
Secret keysg_sec_... (it is never shown again; leave the field empty to keep it)
Search results page / Suggestions / Tracking / Sync productsOn or off, one by one
Show only products in stockOn if your store hides out-of-stock products
Search box (CSS selector)Default input[name="search"] fits most themes
Write back translations forFor example ar. Leave empty to turn write-back off
Language mapOnly if your language codes are unusual, for example 1=en,2=ar

Click Save, then:

  1. Test connection. Both keys must say OK. This also adds your store to the SeekGist dashboard.
  2. Sync all products now. The status table shows how many products were sent.
  3. Search for something on your store, in Arabic and in English.

4. Cron job (needed)

The cron job sends changed products, events and approved translations. Add this line to your server's crontab (the admin page shows the exact path for your store):

*/5 * * * * php /path/to/your/store/system/library/seekgist/cron.php >/dev/null 2>&1

On OpenCart 4.x the file is extension/seekgist/system/library/seekgist/cron.php. Options: --task=all (default), delta, full, outbox, writeback, and --root=/path if the script cannot find your store folder.

If your host has no command-line cron, use the web address shown on the admin page with your host's "URL cron" tool. Keep its token secret: anyone with it can start a sync.

5. Check the fallback (optional)

The admin status table shows Fallbacks to the store search (24 hours) and the Safety switch state. To try it on a test copy of your store, set API address to an address that does not answer (for example https://localhost:9). Searches must still show results (your store's own), and the fallback counter goes up.

Uninstall

Extensions > Modules (2.x) or Extensions > Extensions > Modules (3.x, 4.x): Uninstall. This removes the module's events, settings and its 4 tables (seekgist_state, seekgist_outbox, seekgist_kv, seekgist_written). On 2.x also delete the modification in Extensions > Modifications and click Refresh. Your products and your own search are not changed.

Problems

You seeDo this
"Public key: not accepted, check the key"Copy the key again from the dashboard. A key may be locked to other websites (allowed origins)
Results look like the old searchIs the switch On? Is the Safety switch "paused"? Look at Fallbacks in the status table
Products missing in SeekGistRun Sync all products now and check the status line. Is the cron job running?
No suggestions boxYour theme's search box may have another name: set Search box (CSS selector)
Arabic searches use the wrong languageSet Language map, for example 1=en,2=ar

What is stored and sent

  • Sent to SeekGist: product data (names, descriptions, brand, model, SKU/EAN, price, special price, stock, categories, attributes, image and product URLs), search text, and anonymous events (a hash of the session id, never names, emails or addresses).
  • Stored in your database: sync state, an outbox of events waiting for the cron job (kept 7 days), run status, and which translations the module wrote.
  • The secret key stays on your server. Only the public key is put into your pages.