Connecting OpenCart
What the extension does
Veera Connector sends the OpenCart catalog to the cloud, adds the search window and results page and connects the AI shopping assistant. The extension does not modify the store core: it uses its own tables and the standard extension points, with no OCMOD patches. There are two packages: one for OpenCart 4.x and one for the 3.x branch.
Requirements
- OpenCart 4.0.2.0 or later, 4.0.2.x and 4.1 (package
veera_connector.ocmod.zip; the extension does not work on OpenCart 4.0.0.0–4.0.1.1), or OpenCart 3.0 and ocStore 3.0 (packageveera_connector-oc3.ocmod.zip). - PHP 7.4 or later.
- Server cron that can call a URL with
curl, recommended for even updates (see Cron).
This page describes extension version 0.2.6.
Installation
- Create a store in the Veera dashboard with OpenCart as the platform. The dashboard issues both keys and shows them on the Connection screen: the secret key (
sk_…) is shown once, while the storefront public key (pk_…) stays on the Store → Keys screen. A lost secret key is replaced there with Create key. - Download the extension on the same screen: the Download the module block is right under your keys. Take the
.ocmod.zippackage for your branch, 4.x or 3.x. Upload it in Extensions → Installer (on 4.x, also click Install next to it in the installer list), then install and open Veera Connector in Extensions → Extensions → Modules. - In the extension settings set Status to Enabled, Cloud address to
https://api.search.veera.spaceand paste the secret key into Secret key. The hint above the keys on the extension screen names the dashboard of the Russian region: for a veera.space store, take the keys from search.veera.space as described here. In the Storefronts block, paste the public key into Public key and turn on Search box for each OpenCart store: each storefront has its own public key. Save the settings: if the cloud has none of your products yet, this also requests the first full sync of the catalog (see The first full sync). - Click Test connection: the extension shows whether the cloud responds and whether the keys were accepted.
- Add the line from the Store cron field to the server cron. The cron job sends the catalog to the cloud and, after that, every product change.
The dashboard confirms that the catalog has arrived: the checklist on Overview ticks off Catalog received, and Store → Connection shows the extension version, the number of products in the cloud and the Pages and articles section with the number of texts by type.
The first full sync
When you save the settings with Status set to Enabled and a secret key filled in, the extension asks the cloud whether it holds any products of your store. If it holds none and no full sync has run yet, the extension requests the first full sync, and the save message gets the addition The keys work and the cloud holds no products of the store yet: the first full sync of the catalog has started, the store cron sends it in batches. On OpenCart 3.x the message appears on the module list you return to after saving.
The sync itself goes page by page with the sync steps, not while you wait on the settings page. With the server cron line, a step runs every 5 minutes, and a catalog of 10,000 products takes roughly eight steps, depending on the server. Without the line, the sync still goes, only slower: on OpenCart 4.x the built-in cron runs a step once an hour, and on hosting with PHP-FPM a short step runs after storefront page views. On OpenCart 3.x without the cron line and without PHP-FPM, nothing sends the requested sync until you click Send the whole catalog.
While the sync runs, the settings page shows Full sync, sent: … next to Waiting in the queue, and the log below it records The cloud holds no products of the store: the first full sync started by itself, then Full sync started, snapshot … and finally Full sync done: … products sent, … removed from the index.
- If the cloud does not accept the key, the save message says The first full sync of the catalog starts by itself once the cloud accepts the keys: followed by the reason. For a rejected key, the reason reminds you that keys issued on veera.space work only with
https://api.search.veera.space. Correct the field and save again: the extension asks the cloud right away. Otherwise the sync steps ask again about once an hour. - The decision is made once. If the cloud already holds products of your store, or a full sync has run before, the extension does not request one by itself, and saving the keys again never resends the catalog. Test connection only checks the keys and never starts a sync.
Send the whole catalog is optional now. It requests a full sync if none is running and drives the sync steps from the browser, showing the progress until The catalog is in the cloud. If you close the page, cron carries on. Clicking it while the first sync is running does not start it over; it only speeds it up. Use it also after an import that bypasses OpenCart, such as an exchange with an ERP or a CSV import.
Cron
Product changes collect in the extension’s queue. For them to reach search within five minutes, add to the server cron the line the extension shows in the Store cron field: */5 * * * * curl -s "…" with your store address and a service token. Without it, the extension runs a short sync step at most once every five minutes as store pages are viewed (on servers with PHP-FPM), and OpenCart 4.x also runs the sync once an hour with its own cron. This works, but updates arrive unevenly.
A full sync runs page by page and does not hit timeouts on a large catalog. If it has not finished within 20 hours of starting, it starts over with a new snapshot. Products the store no longer has leave the index after a grace period, 72 hours by default; see Catalog reconciliation. A product without a name is not indexed; the extension lists such products in its log.
What goes to the cloud
Products with prices, stock, categories, attributes and product codes: SKU, EAN, MPN and others. Along with products, the extension sends the store’s languages and currencies, information pages and blog articles: the search window searches them and the assistant answers from them. You don’t need to set the currency in the dashboard. Catalog languages are selected in Store settings; their number depends on your plan.
SKUs and product codes
Since version 0.2.5, search finds a product by its SKU and by the other codes from the product form (UPC, EAN, JAN, ISBN, MPN, and the model when it differs from the SKU), in full and by part: the query “CA16SW” finds the product with the code “CA16SWE641BW”. On OpenCart 4.1 the codes come from the product code list; on 4.0.2.x, 3.x and ocStore, from the UPC, EAN, JAN, ISBN and MPN fields on the Data tab. Shoppers don’t see these codes in the window. If a product on OpenCart 4.1 has several codes of one type, such as two EANs, one of them reaches the cloud.
Variants
On OpenCart 4.0.2 and later, a variant reaches the cloud as a separate product linked to its main product, with its own codes and its own option values, such as color and size. So a filter by color or size finds the right variant, not only the main product. Adding, editing and deleting a variant sends the main product again too: a deleted variant leaves search together with its values. OpenCart 3.x and ocStore have no variants.
Storefront
The extension adds the search window to the storefront without touching the theme. The results page is built by the extension’s route inside your store theme: the header, columns and footer stay yours. Add-to-carts and orders go to the dashboard analytics as shopper events. Since version 0.2.6 the extension tells the dashboard whether Search box and Veera consultant are on the storefront: a change of either checkbox reaches the dashboard with the next sync step, without sending the whole catalog.
The assistant
Turn on Veera AI Chat in the assistant dashboard: it takes the catalog and pages from the same cloud, and the extension places the chat window on the storefront itself. From extension version 0.2.0, the chat window adds products to the cart and shows shoppers their orders; which of these are on for your store is shown on the Actions screen.
Updating the extension
Update by copying the files of the new package over the installed ones, over FTP or in your hosting file manager:
- OpenCart 4.x: unpack
veera_connector.ocmod.zipand copy its contents over the store’sextension/veera_connector/folder, replacing the files. On OpenCart 4.0.x this is the only way: the extension installer does not update an installed extension and answers Extension already installed! - OpenCart 3.x and ocStore: copy the contents of the
upload/folder fromveera_connector-oc3.ocmod.zipover the store root.
The keys, storefronts, log, queue and the server cron line stay as they are: they live in the database, not in the files. When you update from 0.2.4 or earlier, click Send the whole catalog once: otherwise the codes and the variant option values of products already in the cloud reach it only when each product is saved. On 4.x the extension adds what the new version needs on its next sync step; on 3.x and ocStore, open its settings page once after copying the files. If your hosting caches PHP files (OPcache) with a long check interval, the new version starts working once PHP rereads the files.
Don’t uninstall and reinstall the extension to update it. Uninstalling erases the keys, the storefront settings, the log and the sync queue, and a new installation issues a new cron token, so the server cron line stops working until you replace it.
What’s new in version 0.2.6
- What is on the storefront. The extension tells the Veera dashboard whether Search box and Veera consultant are on the storefront. A change of these settings reaches the dashboard with the next sync step, without sending the whole catalog.
Version 0.2.5:
- Search by product codes. UPC, EAN, JAN, ISBN, MPN and the model find a product like its SKU, in full and by part. Before, a part of a code did not find the product. See SKUs and product codes.
- Variants on OpenCart 4.0.2 and later. Each variant has its own option values in the cloud: a filter by an option finds the variants. Before, a variant had no option values in the cloud, and the filter found only the main product. Deleting a variant sends the main product again too. See Variants.
Version 0.2.4:
- Test connection and Send the whole catalog work in the browser on OpenCart 4.x and 3.x: before, the admin panel answered their request with the login page, and they showed “Unexpected token ‘<’” instead of the result.
- Uninstalling the extension removes its permissions from the user groups: before, they stayed, and OpenCart 4.x added another copy with every installation.
- OpenCart 4.0.2.0 or later is required: the extension does not work on OpenCart 4.0.0.0–4.0.1.1.
- The extension’s English texts use American spelling: Send the whole catalog, Catalog sync, The catalog is in the cloud. and the other labels and messages. The keys of the language files, the event and cron codes and the Russian texts are unchanged.
Limitations of version 0.2.6
Specials with dates. Specials with dates (the Special tab; in OpenCart 4.1, a row on the Discount tab marked Special) reach search when the product is sent to the cloud: when you save the product, when the status of an order with this product changes, and when you click Send the whole catalog. A start or end date passing does not send the product by itself. Until the next send, the search window and the results page show the previous price: without the discount before the special starts and with the discount after it ends, while the product page, cart and order already use the new one. OpenCart starts and ends a special at 00:00 on the given dates in the store time zone, so a special lasts until the end of the day before its end date. To have the search price change on the right day, click Send the whole catalog or save the product on that day.
Troubleshooting
- “Secret key is empty: the catalog will not be sent.” after Test connection: save the secret key from the dashboard in Secret key.
- “Secret key rejected: the cloud … does not accept this key. Keys from veera.space work only with https://api.search.veera.space…” after Test connection: the Cloud address field holds the address of another region, or the key was revoked. Set Cloud address to
https://api.search.veera.spaceand check the key on the Store → Keys screen. - Changes arrive late or unevenly: the server cron line was not added, so sync steps depend on store traffic and, on 4.x, on the hourly OpenCart cron.
- A product is not found: check that it is enabled, has a name and is assigned to the storefront; the extension log shows whether the cloud accepted it. In the dashboard, the Product in the cloud catalog block on Search → Test search looks the product up by ID or SKU and shows whether it reached the cloud, and the query check shows how the cloud parses the words.