2015-10-23 17:41:05 +03:00
|
|
|
<?php
|
2017-09-01 10:14:13 +02:00
|
|
|
/**
|
|
|
|
* @author Retail Driver LCC
|
|
|
|
* @copyright RetailCRM
|
|
|
|
* @license GPL
|
2018-02-28 17:28:13 +03:00
|
|
|
* @version 2.2.0
|
2017-09-01 10:14:13 +02:00
|
|
|
* @link https://retailcrm.ru
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-08-29 15:59:19 +03:00
|
|
|
$_SERVER['HTTPS'] = 1;
|
2015-10-23 17:41:05 +03:00
|
|
|
|
2016-01-11 18:02:20 +03:00
|
|
|
require(dirname(__FILE__) . '/../../../config/config.inc.php');
|
|
|
|
require(dirname(__FILE__) . '/../../../init.php');
|
|
|
|
require(dirname(__FILE__) . '/../bootstrap.php');
|
2015-10-23 17:41:05 +03:00
|
|
|
|
2015-10-26 17:53:20 +03:00
|
|
|
$apiUrl = Configuration::get('RETAILCRM_ADDRESS');
|
|
|
|
$apiKey = Configuration::get('RETAILCRM_API_TOKEN');
|
2017-08-14 12:06:10 +02:00
|
|
|
$apiVersion = Configuration::get('RETAILCRM_API_VERSION');
|
2018-02-28 17:28:13 +03:00
|
|
|
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)) {
|
2018-02-28 17:28:13 +03:00
|
|
|
RetailcrmHistory::$api = new RetailcrmProxy($apiUrl, $apiKey, _PS_ROOT_DIR_ . '/retailcrm.log', $apiVersion);
|
2015-10-26 17:53:20 +03:00
|
|
|
} else {
|
2016-01-11 18:02:20 +03:00
|
|
|
error_log('orderHistory: set api key & url first', 3, _PS_ROOT_DIR_ . '/retailcrm.log');
|
2015-10-26 17:53:20 +03:00
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
2018-02-28 17:28:13 +03:00
|
|
|
RetailcrmHistory::customersHistory();
|
|
|
|
RetailcrmHistory::ordersHistory();
|