Access all opencart model's methods and invoke them remotely, use it like a api.
clone repository
composer install
- You must have minimum v2.3.0.2 installed opencart system. https://github.com/opencart/opencart/releases
- Copy all files in
opencart-put-catalog-controller
to"{OpencartRootPath}/catalog/controller/"
use OpencartApi\Http\ClientBuilder;
use OpencartApi\ModelInvoker;
require __DIR__ . '/vendor/autoload.php';
$config = include_once __DIR__ . '/config.php';
$invoker = new ModelInvoker((new ClientBuilder())
->setBaseUrl($config['v3037']['baseUrl'])
->setUsername($config['v3037']['adminUsername'])
->setPassword($config['v3037']['adminPassword'])
->build());
$models = new \OpencartApi\ModelContainer\v3037\OpencartModelContainer($invoker);
$res = $models->getAdminModelCatalogProduct()->getProducts();
print_r($res->getResult());