PHP code example of magicalella / yii2-prestashop

1. Go to this page and download the library: Download magicalella/yii2-prestashop library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

magicalella / yii2-prestashop example snippets


 'components' => [
     // ...
     'prestashop' => [
         'class' => 'magicalella\prestashop\Prestashop',
         'url' => 'URL Site prestashop',
         'key' => 'API Keyu WebService PS',
         'debug' => true/false,
         'version' => 'version PS'
     ],
 ]
 

 $prestashop = Yii::$app->prestashop;
 $prestashop->$url = $this->$url;
 $prestashop->key = $this->key;
 $prestashop->debug = $this->debug;
 try
  {
     $xml = $prestashop->get(['resource' => 'orders','limit'=> $off_set.','.$limit,'sort'=>'id_ASC']);
  }
 catch (BridgePSException $ex)
  {
     echo 'Error : '.$ex->getMessage();
 }