Skip to content

moust/prestashop-webservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moust/prestashop-webservice

PHP wrapper for Prestashop web service

Installation

  1. Clone this repository in your new working directory.

  2. Download the composer.phar executable or use the installer.

    curl -s https://getcomposer.org/installer | php
  3. Run Composer: php composer.phar update

How to use it

// initialize WebService
$webservice = new PrestashopWebservice\Webservice('http://mystore.com/', 'your-prestashop-api-key', false);

// initialize CacheProvider (optional)
$cache = new Doctrine\Common\Cache\PhpFileCache(__DIR__.'/cache');
$webservice->setCacheProvider($cache);
$webservice->setTtl(60);

// initialize Logger with Monolog (optional)
$logger = new Monolog\Logger('prestashop');
$handler = new Monolog\Handler\StreamHandler(__DIR__.'/logs/prestashop.log');
$logger->pushHandler($handler);
$webservice->setLogger($logger);

$products = $webservice->getProducts();

echo '<ul>';
foreach ($products as $product) {
    echo '<li>' . $product->id . ' - ' . $product->name[1] . '</li>';
}
echo '</ul>';

About

PHP wrapper for Prestashop web service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages