32 lines
959 B
PHP
Raw Normal View History

<?php
2017-09-01 10:14:13 +02:00
/**
* @author Retail Driver LCC
* @copyright RetailCRM
* @license GPL
* @version 2.2.0
2017-09-01 10:14:13 +02:00
* @link https://retailcrm.ru
*
*/
$_SERVER['HTTPS'] = 1;
require(dirname(__FILE__) . '/../../../config/config.inc.php');
require(dirname(__FILE__) . '/../../../init.php');
require(dirname(__FILE__) . '/../bootstrap.php');
2015-10-26 17:53:20 +03:00
$apiUrl = Configuration::get('RETAILCRM_ADDRESS');
$apiKey = Configuration::get('RETAILCRM_API_TOKEN');
$apiVersion = Configuration::get('RETAILCRM_API_VERSION');
RetailcrmHistory::$default_lang = (int) Configuration::get('PS_LANG_DEFAULT');
RetailcrmHistory::$apiVersion = $apiVersion;
2015-10-26 17:53:20 +03:00
if (!empty($apiUrl) && !empty($apiKey)) {
RetailcrmHistory::$api = new RetailcrmProxy($apiUrl, $apiKey, _PS_ROOT_DIR_ . '/retailcrm.log', $apiVersion);
2015-10-26 17:53:20 +03:00
} else {
error_log('orderHistory: set api key & url first', 3, _PS_ROOT_DIR_ . '/retailcrm.log');
2015-10-26 17:53:20 +03:00
exit();
}
RetailcrmHistory::customersHistory();
RetailcrmHistory::ordersHistory();