Download the PHP package logshub/ecommerce-synch without Composer
On this page you can find all versions of the php package logshub/ecommerce-synch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package ecommerce-synch
eCommerce Synch
This is NOT a plugin to any of eCommerce platform. This is standalone application that process data from store's database (by modules for specific platform) into other system eg. LogsHub.com search service.
Supported eCommerce platforms
- Magento 1 (1.6.2.0 - 1.9.4.1)
- Magento 2 (2.2 - 2.3.0)
- WooCommerce (5.1.1)
- PrestaShop (1.6.1.10 - 1.7.5.1)
- OpenCart (2.1.0.2 - X)
- osCommerce (2.3.4.1 - 2.4.2)
- Sylius (1.4.3)
Other versions might work as well, but was not tested.
How does it work
Cron executes synchronization command. It takes configuration file, determine what is input module. It executes its SQL SELECT statements and saves result into CSV files (products and categories). Output module push CSV data into remote system eg. LogsHub.com search service.
Requirements
- PHP 7 (PDO, pdo_mysql)
- Composer - https://getcomposer.org/
Installation (easy)
That way is OK for small and medium stores. It is easier to setup, but little bit less optimal, as CSV files will be generated by PHP code insetad of database itself.
composer require logshub/ecommerce-synch
cp ecommerce-synch/config.example.ini ecommerce-synch/config.ini
- Setup your
ecommerce-synch/config.ini
: logshub credentials, input module and database connection. Setgenerate_csv_by_database = 0
(easy configuration). - Add into your cron:
php vendor/bin/ecommerce-synch synch -c config.ini
. Frequency depends on configuration (seecheck_update_dates
).
Example:
Installation (experimental, advanced)
It is more advanced setup, but more optimal, as CSV files will be generated by database itself insetad of PHP code.
- Make sure you run this code on the same server with database - access to
/var/lib/mysql-files/
needed. - Your DB user must have
FILE
privilege in database (see below). - Process with the "easy" installation steps with this exception:
generate_csv_by_database = 1
.
AD 2
How to create input module?
There could be cases when your database structure is little bit different then the standard ones. You can create your own module, that match your database structre.
Example project structure
Content of composer.json
Content of modules.php
, that is loaded automatically by composer.
Content of src/Module/Input/MyStoreCom.php
file with your custom module.
Now, you can configure input.module
in config.ini
file to use your custom module (from MyStoreCom::getName
).
How to change data before synchronizing?
Create getProductCsvRowCallback
method in your custom module. See src/Module/Input/OpenCart.php
file for example:
OpenCart::getProductCsvRowCallback
, OpenCart::onCsvRow
.
Troubleshooting
- Last updated time is not calculated correctly? Make sure timezone is the same on the PHP and database side
TODO
- clear old CSV files (new command)
- callback for database dump
Input modules to do
- ShopWare
- Ubercart - https://www.drupal.org/project/ubercart
- Spree - https://github.com/spree/spree
- PimCore - https://pimcore.com/en
All versions of ecommerce-synch with dependencies
symfony/console Version ^4.2
symfony/process Version ^4.2
monolog/monolog Version ^1.24