Plugin features
- Import of catalog with subcategories and products.
- Import of pictures, videos and product descriptions.
- Import of product attributes.
- Import of product configurations with aliases and pictures.
- Import of product price ranges and old/discount price.
- Import of product reviews and ratings.
System requirements
- Otapiphpclient library (https://github.com/OTCommerce/otapiphpclient.git). Already available installation archive of the module with all dependencies for php 7.4.
- PHP 7.4 for OpenCart3.
- To automatically update products on a schedule: scheduler (cron).
- MySQL Database.
Installation
Before plugin installation it is strongly recommended to create backup copy of website and database files.
Go to “Extensions” section → “Installer” in admin panel of your OpenCart store and click “Upload” button.
Select downloaded module archive and confirm installation. Wait for a message about successful installation.
Go to "Sуstem" section → "Users" → "User Groups"
Go to administrator group settings and check boxes extension/module/otapi_import and extension/module/otapi_import_cron in “Access Permission” and “Modify Permission” sections. Save settings.
Go to “Extensions” section → “Extensions”.
Choose extension type "Modules" in drop-down menu.
Click "Install" button for "OT API Import" module.
Go to “Extensions” section → “Modifications” and click "Refresh" button on top right.
Module is installed.
Scheduled product update
- Manually copy cli directory from the module archive to the directory where admin folder is located.
- To automatically update products on a schedule, you need to set up cron job to run with a frequency equal to or less than the value of product update launch period (this is Update interval parameter in module settings - update interval in minutes).
- Example of running cron job every hour:
@hourly cd "opencart directory"/cli && php7.4 otapi_import_cli.php > /dev/null 2>&1 - Importing a large number of goods can take a long time - from several hours to several days, depending on server computing resources, especially database server. Therefore, too frequent launch intervals do not make sense: if the previous import has not yet been completed, the new one will still not be launched.
Work with plugin
Go to “Extensions” section → “Extensions”.
- Click "Edit" button for "OT API Import" module. (A shorter path to the module settings is also available through “Catalog” → “OT API Import”.)
- Go to "Settings" tab, make necessary settings and click "Save settings". Note that Access Key and Secret Key are provided by OpenTrade Commerce for a fee.
- To add catalogs with products for test, it is recommended to set parameters "Frame size" - 5-10 and "Category products limit" (limit for a category) - 5-10 products.
- Make initial uploading of product catalogue: go to "Catalog" → "OT API Import" and click "Catalog import".
- Check that all catalogs have loaded and contain products.
- Set "Frame size" to 200-500 after initial uploading of product catalogue, remove limit for category and perform full import of catalog.
- Once the import is complete, a message that catalog has been successfully loaded will be displayed.
Important notes:
- Import will continue as long as the page is open in the browser.
- If you refresh the page or log in again, you must click "Catalog import" button again to resume importing.
- In this case system will prompt you to select “New import” (Start import from the beginning) or “Continue import” (continue work from the point where the import was suspended).
- In some cases, “Failed to get "otapi_import_lock" on sql connection, another import is running" message may appear when import starts - this means that import has already started by another process, for example, via cron, or was launched earlier in another browser tab.
- Import via cron works cyclically, i.e. once completed, import will be started again. If you don’t need this behavior, you can disable import in module settings after a complete catalogue import: status field or simply set cron to a larger interval, for example, 1 week.
Removal
- Remove the task from cron to run product updates.
- Go to “Extensions” section → “Extensions” and click "Uninstall" button for "OT API Import" module.
- Go to “Extensions” section → “Installer" and click "Uninstall" button for "OT API Import" module.
- Go to “Extensions” section → “Modifications" and click "Update" button.
- Delete cli directory if you added it.