Implement the new settings page (on VueJS)
1
.gitignore
vendored
@ -7,6 +7,7 @@ retailcrm/views/css/*.map
|
||||
retailcrm/views/js/*.map
|
||||
retailcrm/config*.xml
|
||||
retailcrm/custom
|
||||
retailcrm/override
|
||||
upgrade/upgrade-*.php
|
||||
!upgrade/upgrade-sample.php
|
||||
coverage.xml
|
||||
|
10
CHANGELOG.md
@ -1,8 +1,16 @@
|
||||
## v3.4.0
|
||||
* Обновлен дизайн настроек модуля
|
||||
* Добавлена возможность выгружать в CRM только невыгруженные заказы
|
||||
* Рефакторинг RetailcrmHistory, улучшена работа с адресами
|
||||
* Добавлена очистка старых файлов модуля при обновлении
|
||||
* Добавлен фильтр RetailcrmFilterOrderStatusUpdate
|
||||
* Улучшена обработка исключений на новых версиях PHP
|
||||
|
||||
## v3.3.5
|
||||
* Рефакторинг RetailcrmProxy для работы с API
|
||||
* Улучшена синхронизация типов оплат
|
||||
* Атрибуты товаров добавлены в ICML
|
||||
* Дабвлено списание остатков товаров при обратной синхронизации заказов
|
||||
* Добавлено списание остатков товаров при обратной синхронизации заказов
|
||||
* Рефакторинг выгрузки заказов в CRM
|
||||
* Добавлен CS Fixer в проект
|
||||
* Добавлено конвертирование единиц измерения веса товаров при генерации ICML
|
||||
|
@ -1,2 +1,17 @@
|
||||
# Templates & Views
|
||||
|
||||
Начиная с версии 3.4.0 frontend-часть страницы настроек модуля разрабатывается в виде отдельного приложения на VueJs (далее – приложение)
|
||||
|
||||
Код приложения хранится в отдельном закрытом репозитории
|
||||
|
||||
В момент загрузки страницы настроек PrestaShop вызывает метод `RetailCRM::getContent`, который отвечает за рендер страницы.
|
||||
Данные для приложения и указание на файл шаблона подготавливаются в классе `RetailcrmSettingsTemplate`
|
||||
|
||||
Подключение приложения производится в файле шаблона `retailcrm/views/templates/admin/index.tpl`.
|
||||
Там же передаются все необходимые данные в объект `window.$appData`
|
||||
|
||||
Для динамического обновления информации на странице приложение делает запросы в контроллеры.
|
||||
Контроллеры находятся в папке `retailcrm/controllers/admin`
|
||||
|
||||
Для работы контроллеров их необходимо зарегистрировать в БД PrestaShop.
|
||||
Модуль делает это при установке и обновлении в методе `RetailCRM::installTab`
|
||||
|
@ -38,6 +38,11 @@
|
||||
|
||||
class RetailcrmAdminAbstractController extends ModuleAdminController
|
||||
{
|
||||
/**
|
||||
* @var RetailCRM
|
||||
*/
|
||||
public $module;
|
||||
|
||||
public static function getId()
|
||||
{
|
||||
$tabId = (int) Tab::getIdFromClassName(static::getClassName());
|
||||
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmAdminPostAbstractController extends RetailcrmAdminAbstractController
|
||||
{
|
||||
public function postProcess()
|
||||
{
|
||||
$this->ajaxDie(json_encode($this->getData()));
|
||||
}
|
||||
|
||||
protected function getData()
|
||||
{
|
||||
try {
|
||||
switch ($_SERVER['REQUEST_METHOD']) {
|
||||
case 'POST':
|
||||
return $this->postHandler();
|
||||
case 'GET':
|
||||
return $this->getHandler();
|
||||
default:
|
||||
return [];
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
return RetailcrmJsonResponse::invalidResponse($e->getMessage());
|
||||
} catch (Error $e) {
|
||||
return RetailcrmJsonResponse::invalidResponse($e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception|Error
|
||||
*/
|
||||
protected function postHandler()
|
||||
{
|
||||
throw new Exception('Method not allowed');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception|Error
|
||||
*/
|
||||
protected function getHandler()
|
||||
{
|
||||
throw new Exception('Method not allowed');
|
||||
}
|
||||
}
|
88
retailcrm/controllers/admin/RetailcrmExportController.php
Normal file
@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmExportController extends RetailcrmAdminPostAbstractController
|
||||
{
|
||||
protected function postHandler()
|
||||
{
|
||||
$api = RetailcrmTools::getApiClient();
|
||||
|
||||
if (empty($api)) {
|
||||
throw new Exception('Set API key & URL first');
|
||||
}
|
||||
|
||||
RetailcrmExport::init();
|
||||
RetailcrmExport::$api = $api;
|
||||
RetailcrmHistory::$api = $api;
|
||||
|
||||
if (Tools::getIsset('stepOrders')) {
|
||||
$skipUploaded = Tools::getIsset('skipUploaded') && 'true' === Tools::getValue('skipUploaded');
|
||||
|
||||
RetailcrmExport::export(Tools::getValue('stepOrders'), 'order', $skipUploaded);
|
||||
} elseif (Tools::getIsset('stepCustomers')) {
|
||||
RetailcrmExport::export(Tools::getValue('stepCustomers'), 'customer');
|
||||
} elseif (Tools::getIsset('stepSinceId')) {
|
||||
RetailcrmHistory::updateSinceId('customers');
|
||||
RetailcrmHistory::updateSinceId('orders');
|
||||
} else {
|
||||
throw new Exception('Invalid request data');
|
||||
}
|
||||
|
||||
return RetailcrmJsonResponse::successfullResponse();
|
||||
}
|
||||
|
||||
protected function getHandler()
|
||||
{
|
||||
// todo move to helper
|
||||
return [
|
||||
'success' => true,
|
||||
'orders' => [
|
||||
'count' => RetailcrmExport::getOrdersCount(),
|
||||
'exportCount' => RetailcrmExport::getOrdersCount(true),
|
||||
'exportStepSize' => RetailcrmExport::RETAILCRM_EXPORT_ORDERS_STEP_SIZE_WEB,
|
||||
],
|
||||
'customers' => [
|
||||
'count' => RetailcrmExport::getCustomersCount(),
|
||||
'exportCount' => RetailcrmExport::getCustomersCount(false),
|
||||
'exportStepSize' => RetailcrmExport::RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE_WEB,
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
@ -36,43 +36,57 @@
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmBaseTemplate extends RetailcrmAbstractTemplate
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmJobsController extends RetailcrmAdminPostAbstractController
|
||||
{
|
||||
protected function buildParams()
|
||||
protected function postHandler()
|
||||
{
|
||||
switch ($this->getCurrentLanguageISO()) {
|
||||
case 'ru':
|
||||
$promoVideoUrl = 'VEatkEGJfGw';
|
||||
$registerUrl = 'https://account.simla.com/lead-form/?cp=https%3A%2F%2Faccount.simla.com%2Flead-form%2F';
|
||||
$supportEmail = 'help@simla.com';
|
||||
break;
|
||||
case 'es':
|
||||
$promoVideoUrl = 'LdJFoqOkLj8';
|
||||
$registerUrl = 'https://account.simla.com/lead-form/?cp=https%3A%2F%2Faccount.simla.com%2Flead-form%2F';
|
||||
$supportEmail = 'help@simla.com';
|
||||
break;
|
||||
default:
|
||||
$promoVideoUrl = 'wLjtULfZvOw';
|
||||
$registerUrl = 'https://account.simla.com/lead-form/?cp=https%3A%2F%2Faccount.simla.com%2Flead-form%2F';
|
||||
$supportEmail = 'help@simla.com';
|
||||
break;
|
||||
if (!Tools::getIsset('jobName') && !Tools::getIsset('reset')) {
|
||||
throw new Exception('Invalid request data');
|
||||
}
|
||||
|
||||
$this->data = [
|
||||
'assets' => $this->assets,
|
||||
'apiUrl' => RetailCRM::API_URL,
|
||||
'apiKey' => RetailCRM::API_KEY,
|
||||
'promoVideoUrl' => $promoVideoUrl,
|
||||
'registerUrl' => $registerUrl,
|
||||
'supportEmail' => $supportEmail,
|
||||
if (Tools::getIsset('reset')) {
|
||||
return $this->resetJobManager();
|
||||
}
|
||||
|
||||
$jobName = Tools::getValue('jobName');
|
||||
|
||||
return $this->runJob($jobName);
|
||||
}
|
||||
|
||||
protected function getHandler()
|
||||
{
|
||||
return [
|
||||
'success' => true,
|
||||
'result' => RetailcrmSettingsHelper::getJobsInfo(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Set template data
|
||||
*/
|
||||
protected function setTemplate()
|
||||
private function resetJobManager()
|
||||
{
|
||||
$this->template = 'index.tpl';
|
||||
$errors = [];
|
||||
if (!RetailcrmJobManager::reset()) {
|
||||
$errors[] = 'Job manager internal state was NOT cleared.';
|
||||
}
|
||||
if (!RetailcrmCli::clearCurrentJob(null)) {
|
||||
$errors[] = 'CLI job was NOT cleared';
|
||||
}
|
||||
|
||||
if (!empty($errors)) {
|
||||
throw new Exception(implode(' ', $errors));
|
||||
}
|
||||
|
||||
return RetailcrmJsonResponse::successfullResponse();
|
||||
}
|
||||
|
||||
private function runJob($jobName)
|
||||
{
|
||||
$result = RetailcrmJobManager::execManualJob($jobName);
|
||||
|
||||
return [
|
||||
'success' => true,
|
||||
'result' => $result,
|
||||
];
|
||||
}
|
||||
}
|
65
retailcrm/controllers/admin/RetailcrmLogsController.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmLogsController extends RetailcrmAdminPostAbstractController
|
||||
{
|
||||
protected function postHandler()
|
||||
{
|
||||
if (!Tools::getIsset('logName') && !Tools::getIsset('all')) {
|
||||
throw new Exception('Invalid request data');
|
||||
}
|
||||
|
||||
if (Tools::getIsset('all')) {
|
||||
return RetailcrmLoggerHelper::downloadAll();
|
||||
}
|
||||
|
||||
$logName = Tools::getValue('logName');
|
||||
|
||||
return RetailcrmLoggerHelper::download($logName);
|
||||
}
|
||||
|
||||
protected function getHandler()
|
||||
{
|
||||
return [
|
||||
'success' => true,
|
||||
'result' => RetailcrmSettingsHelper::getLogFilesInfo(),
|
||||
];
|
||||
}
|
||||
}
|
@ -38,14 +38,18 @@
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmOrdersController extends RetailcrmAdminAbstractController
|
||||
class RetailcrmOrdersController extends RetailcrmAdminPostAbstractController
|
||||
{
|
||||
public function postProcess()
|
||||
protected function postHandler()
|
||||
{
|
||||
$this->ajaxDie(json_encode($this->getData()));
|
||||
$orderIds = Tools::getValue('orders');
|
||||
|
||||
RetailcrmExport::$api = RetailcrmTools::getApiClient();
|
||||
|
||||
return RetailcrmExport::uploadOrders($orderIds);
|
||||
}
|
||||
|
||||
protected function getData()
|
||||
protected function getHandler()
|
||||
{
|
||||
$orders = Tools::getValue('orders', []);
|
||||
$page = (int) (Tools::getValue('page', 1));
|
||||
@ -61,20 +65,8 @@ class RetailcrmOrdersController extends RetailcrmAdminAbstractController
|
||||
$withErrors = null;
|
||||
}
|
||||
|
||||
try {
|
||||
return array_merge([
|
||||
'success' => true,
|
||||
], RetailcrmExportOrdersHelper::getOrders($orders, $withErrors, $page));
|
||||
} catch (Exception $e) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => $e->getMessage(),
|
||||
];
|
||||
} catch (Error $e) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => $e->getMessage(),
|
||||
];
|
||||
}
|
||||
return array_merge([
|
||||
'success' => true,
|
||||
], RetailcrmExportOrdersHelper::getOrders($orders, $withErrors, $page));
|
||||
}
|
||||
}
|
||||
|
@ -1,114 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmOrdersUploadController extends RetailcrmAdminAbstractController
|
||||
{
|
||||
private $api;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->api = RetailcrmTools::getApiClient();
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
$this->ajaxDie(json_encode($this->getData()));
|
||||
}
|
||||
|
||||
protected function getData()
|
||||
{
|
||||
if (!($this->api instanceof RetailcrmProxy)) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => "Can't upload orders - set API key and API URL first!",
|
||||
];
|
||||
}
|
||||
|
||||
$orderIds = Tools::getValue('orders');
|
||||
try {
|
||||
$isSuccessful = true;
|
||||
$skippedOrders = [];
|
||||
$uploadedOrders = [];
|
||||
$errors = [];
|
||||
|
||||
RetailcrmExport::$api = $this->api;
|
||||
foreach ($orderIds as $orderId) {
|
||||
$id_order = (int) $orderId;
|
||||
$response = false;
|
||||
|
||||
try {
|
||||
$response = RetailcrmExport::exportOrder($id_order);
|
||||
|
||||
if ($response) {
|
||||
$uploadedOrders[] = $id_order;
|
||||
}
|
||||
} catch (PrestaShopObjectNotFoundExceptionCore $e) {
|
||||
$skippedOrders[] = $id_order;
|
||||
} catch (Exception $e) {
|
||||
$errors[$id_order][] = $e->getMessage();
|
||||
} catch (Error $e) {
|
||||
$errors[$id_order][] = $e->getMessage();
|
||||
}
|
||||
|
||||
$isSuccessful = $isSuccessful ? $response : false;
|
||||
time_nanosleep(0, 50000000);
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => $isSuccessful,
|
||||
'uploadedOrders' => $uploadedOrders,
|
||||
'skippedOrders' => $skippedOrders,
|
||||
'errors' => $errors,
|
||||
];
|
||||
} catch (Exception $e) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => $e->getMessage(),
|
||||
];
|
||||
} catch (Error $e) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => $e->getMessage(),
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
@ -38,44 +38,44 @@
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmSettingsController extends RetailcrmAdminAbstractController
|
||||
class RetailcrmSettingsController extends RetailcrmAdminPostAbstractController
|
||||
{
|
||||
public static function getParentId()
|
||||
protected function postHandler()
|
||||
{
|
||||
return (int) Tab::getIdFromClassName('IMPROVE');
|
||||
$settings = new RetailcrmSettings($this->module);
|
||||
|
||||
return $settings->save();
|
||||
}
|
||||
|
||||
public static function getIcon()
|
||||
protected function getHandler()
|
||||
{
|
||||
return 'shop';
|
||||
}
|
||||
|
||||
public static function getPosition()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
public static function getName()
|
||||
{
|
||||
$name = [];
|
||||
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$name[$lang['id_lang']] = 'Simla.com';
|
||||
if (null === $this->module->reference) {
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => 'Set api key & url first',
|
||||
];
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
$result = [
|
||||
'success' => true,
|
||||
];
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
$link = $this->context->link->getAdminLink('AdminModules', true, [], [
|
||||
'configure' => 'retailcrm',
|
||||
]);
|
||||
|
||||
if (version_compare(_PS_VERSION_, '1.7.0.3', '<')) {
|
||||
$link .= '&module_name=retailcrm&configure=retailcrm';
|
||||
if (Tools::getIsset('catalog')) {
|
||||
$result['catalog'] = RetailcrmSettingsHelper::getIcmlFileInfo();
|
||||
}
|
||||
if (Tools::getIsset('delivery')) {
|
||||
$result['delivery'] = $this->module->reference->getApiDeliveryTypes(
|
||||
); // todo replace with helper function
|
||||
}
|
||||
if (Tools::getIsset('payment')) {
|
||||
$result['payment'] = $this->module->reference->getApiPaymentTypes(
|
||||
); // todo replace with helper function
|
||||
}
|
||||
if (Tools::getIsset('status')) {
|
||||
$result['status'] = $this->module->reference->getApiStatusesWithGroup(
|
||||
); // todo replace with helper function
|
||||
}
|
||||
|
||||
$this->setRedirectAfter($link);
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,81 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
require_once dirname(__FILE__) . '/../../bootstrap.php';
|
||||
|
||||
class RetailcrmSettingsLinkController extends RetailcrmAdminAbstractController
|
||||
{
|
||||
public static function getParentId()
|
||||
{
|
||||
return (int) Tab::getIdFromClassName('IMPROVE');
|
||||
}
|
||||
|
||||
public static function getIcon()
|
||||
{
|
||||
return 'shop';
|
||||
}
|
||||
|
||||
public static function getPosition()
|
||||
{
|
||||
return 7;
|
||||
}
|
||||
|
||||
public static function getName()
|
||||
{
|
||||
$name = [];
|
||||
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$name[$lang['id_lang']] = 'Simla.com';
|
||||
}
|
||||
|
||||
return $name;
|
||||
}
|
||||
|
||||
public function postProcess()
|
||||
{
|
||||
$link = $this->context->link->getAdminLink('AdminModules', true, [], [
|
||||
'configure' => 'retailcrm',
|
||||
]);
|
||||
|
||||
if (version_compare(_PS_VERSION_, '1.7.0.3', '<')) {
|
||||
$link .= '&module_name=retailcrm&configure=retailcrm';
|
||||
}
|
||||
|
||||
$this->setRedirectAfter($link);
|
||||
}
|
||||
}
|
@ -204,7 +204,8 @@ class RetailcrmAddressBuilder extends RetailcrmAbstractDataBuilder
|
||||
[
|
||||
'address' => $this->address,
|
||||
'mode' => $this->mode,
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -87,56 +87,6 @@ class RetailcrmCatalogHelper
|
||||
return _PS_ROOT_DIR_ . '/' . self::getIcmlFileName();
|
||||
}
|
||||
|
||||
public static function getIcmlFileInfo()
|
||||
{
|
||||
$icmlInfo = json_decode((string) Configuration::get(self::ICML_INFO_NAME), true);
|
||||
|
||||
if (null === $icmlInfo || JSON_ERROR_NONE !== json_last_error()) {
|
||||
$icmlInfo = [];
|
||||
}
|
||||
|
||||
$lastGenerated = self::getIcmlFileDate();
|
||||
|
||||
if (false === $lastGenerated) {
|
||||
return $icmlInfo;
|
||||
}
|
||||
|
||||
$icmlInfo['lastGenerated'] = $lastGenerated;
|
||||
$now = new DateTimeImmutable();
|
||||
/** @var DateInterval $diff */
|
||||
$diff = $lastGenerated->diff($now);
|
||||
|
||||
$icmlInfo['lastGeneratedDiff'] = [
|
||||
'days' => $diff->days,
|
||||
'hours' => $diff->h,
|
||||
'minutes' => $diff->i,
|
||||
];
|
||||
|
||||
$icmlInfo['isOutdated'] = (
|
||||
0 < $icmlInfo['lastGeneratedDiff']['days']
|
||||
|| 4 < $icmlInfo['lastGeneratedDiff']['hours']
|
||||
);
|
||||
|
||||
$api = RetailcrmTools::getApiClient();
|
||||
|
||||
if (null !== $api) {
|
||||
$reference = new RetailcrmReferences($api);
|
||||
|
||||
$site = $reference->getSite();
|
||||
$icmlInfo['isUrlActual'] = !empty($site['ymlUrl']) && $site['ymlUrl'] === self::getIcmlFileLink();
|
||||
if (!empty($site['catalogId'])) {
|
||||
$icmlInfo['siteId'] = $site['catalogId'];
|
||||
}
|
||||
}
|
||||
|
||||
return $icmlInfo;
|
||||
}
|
||||
|
||||
public static function getIcmlFileInfoMultistore()
|
||||
{
|
||||
return RetailcrmContextSwitcher::runInContext([self::class, 'getIcmlFileInfo']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $productsCount
|
||||
* @param int $offersCount
|
||||
|
@ -218,14 +218,16 @@ class RetailcrmCorporateCustomerBuilder extends RetailcrmAbstractBuilder impleme
|
||||
$this->corporateCustomer,
|
||||
[
|
||||
'dataCrm' => $this->dataCrm,
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
$this->corporateAddress = RetailcrmTools::filter(
|
||||
'RetailcrmFilterSaveCorporateCustomerAddress',
|
||||
$this->corporateAddress,
|
||||
[
|
||||
'dataCrm' => $this->dataCrm,
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -166,7 +166,8 @@ class RetailcrmCustomerBuilder extends RetailcrmAbstractBuilder implements Retai
|
||||
$this->customer,
|
||||
[
|
||||
'dataCrm' => $this->dataCrm,
|
||||
]);
|
||||
]
|
||||
);
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
@ -73,12 +73,16 @@ class RetailcrmExport
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public static function getOrdersCount()
|
||||
public static function getOrdersCount($skipUploaded = false)
|
||||
{
|
||||
$sql = 'SELECT count(o.id_order)
|
||||
FROM `' . _DB_PREFIX_ . 'orders` o
|
||||
FROM `' . _DB_PREFIX_ . 'orders` o' . ($skipUploaded ? '
|
||||
LEFT JOIN `' . _DB_PREFIX_ . 'retailcrm_exported_orders` reo ON o.`id_order` = reo.`id_order`
|
||||
' : '') . '
|
||||
WHERE 1
|
||||
' . Shop::addSqlRestriction(false, 'o');
|
||||
' . Shop::addSqlRestriction(false, 'o') . ($skipUploaded ? '
|
||||
AND (reo.`last_uploaded` IS NULL OR reo.`errors` IS NOT NULL)
|
||||
' : '');
|
||||
|
||||
return (int) Db::getInstance(_PS_USE_SQL_SLAVE_)->getValue($sql);
|
||||
}
|
||||
@ -93,10 +97,10 @@ class RetailcrmExport
|
||||
*
|
||||
* @throws PrestaShopDatabaseException
|
||||
*/
|
||||
public static function getOrdersIds($start = 0, $count = null)
|
||||
public static function getOrdersIds($start = 0, $count = null, $skipUploaded = false)
|
||||
{
|
||||
if (null === $count) {
|
||||
$to = static::getOrdersCount();
|
||||
$to = static::getOrdersCount($skipUploaded);
|
||||
$count = $to - $start;
|
||||
} else {
|
||||
$to = $start + $count;
|
||||
@ -104,9 +108,13 @@ class RetailcrmExport
|
||||
|
||||
if (0 < $count) {
|
||||
$predefinedSql = 'SELECT o.`id_order`
|
||||
FROM `' . _DB_PREFIX_ . 'orders` o
|
||||
FROM `' . _DB_PREFIX_ . 'orders` o' . ($skipUploaded ? '
|
||||
LEFT JOIN `' . _DB_PREFIX_ . 'retailcrm_exported_orders` reo ON o.`id_order` = reo.`id_order`
|
||||
' : '') . '
|
||||
WHERE 1
|
||||
' . Shop::addSqlRestriction(false, 'o') . '
|
||||
' . Shop::addSqlRestriction(false, 'o') . ($skipUploaded ? '
|
||||
AND (reo.`last_uploaded` IS NULL OR reo.`errors` IS NOT NULL)
|
||||
' : '') . '
|
||||
ORDER BY o.`id_order` ASC';
|
||||
|
||||
while ($start < $to) {
|
||||
@ -137,14 +145,14 @@ class RetailcrmExport
|
||||
* @param int $from
|
||||
* @param int|null $count
|
||||
*/
|
||||
public static function exportOrders($from = 0, $count = null)
|
||||
public static function exportOrders($from = 0, $count = null, $skipUploaded = false)
|
||||
{
|
||||
if (!static::validateState()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$orders = [];
|
||||
$orderRecords = static::getOrdersIds($from, $count);
|
||||
$orderRecords = static::getOrdersIds($from, $count, $skipUploaded);
|
||||
$orderBuilder = new RetailcrmOrderBuilder();
|
||||
$orderBuilder->defaultLangFromConfiguration()->setApi(static::$api);
|
||||
|
||||
@ -371,7 +379,7 @@ class RetailcrmExport
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @throws PrestaShopObjectNotFoundExceptionCore
|
||||
* @throws RetailcrmNotFoundException
|
||||
* @throws PrestaShopDatabaseException
|
||||
* @throws PrestaShopException
|
||||
* @throws Exception
|
||||
@ -383,6 +391,11 @@ class RetailcrmExport
|
||||
}
|
||||
|
||||
$object = new Order($id);
|
||||
|
||||
if (!Validate::isLoadedObject($object)) {
|
||||
throw new RetailcrmNotFoundException('Order not found');
|
||||
}
|
||||
|
||||
$customer = new Customer($object->id_customer);
|
||||
$apiResponse = static::$api->ordersGet($object->id);
|
||||
$existingOrder = [];
|
||||
@ -391,10 +404,6 @@ class RetailcrmExport
|
||||
$existingOrder = $apiResponse['order'];
|
||||
}
|
||||
|
||||
if (!Validate::isLoadedObject($object)) {
|
||||
throw new PrestaShopObjectNotFoundExceptionCore('Order not found');
|
||||
}
|
||||
|
||||
$orderBuilder = new RetailcrmOrderBuilder();
|
||||
$crmOrder = $orderBuilder
|
||||
->defaultLangFromConfiguration()
|
||||
@ -436,6 +445,52 @@ class RetailcrmExport
|
||||
return $response->isSuccessful();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $orderIds
|
||||
*
|
||||
* @return array
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function uploadOrders($orderIds)
|
||||
{
|
||||
if (!static::$api || !(static::$api instanceof RetailcrmProxy)) {
|
||||
throw new Exception('Set API key and API URL first');
|
||||
}
|
||||
|
||||
$isSuccessful = true;
|
||||
$skippedOrders = [];
|
||||
$uploadedOrders = [];
|
||||
$errors = [];
|
||||
|
||||
foreach ($orderIds as $orderId) {
|
||||
$id_order = (int) $orderId;
|
||||
$response = false;
|
||||
|
||||
try {
|
||||
$response = self::exportOrder($id_order);
|
||||
|
||||
if ($response) {
|
||||
$uploadedOrders[] = $id_order;
|
||||
}
|
||||
} catch (RetailcrmNotFoundException $e) {
|
||||
$skippedOrders[] = $id_order;
|
||||
} catch (Exception $e) {
|
||||
$errors[$id_order][] = $e->getMessage();
|
||||
}
|
||||
|
||||
$isSuccessful = $isSuccessful ? $response : false;
|
||||
time_nanosleep(0, 50000000);
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => $isSuccessful,
|
||||
'uploadedOrders' => $uploadedOrders,
|
||||
'skippedOrders' => $skippedOrders,
|
||||
'errors' => $errors,
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false if inner state is not correct
|
||||
*
|
||||
@ -453,6 +508,35 @@ class RetailcrmExport
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $step
|
||||
* @param string $entity
|
||||
* @param bool $skipUploaded
|
||||
*
|
||||
* @throws Exception
|
||||
*/
|
||||
public static function export($step, $entity = 'order', $skipUploaded = false)
|
||||
{
|
||||
--$step;
|
||||
if (0 > $step) {
|
||||
throw new Exception('Invalid request data');
|
||||
}
|
||||
|
||||
if ('order' === $entity) {
|
||||
$stepSize = RetailcrmExport::RETAILCRM_EXPORT_ORDERS_STEP_SIZE_WEB;
|
||||
|
||||
RetailcrmExport::$ordersOffset = $stepSize;
|
||||
RetailcrmExport::exportOrders($step * $stepSize, $stepSize, $skipUploaded);
|
||||
// todo maybe save current step to database
|
||||
} elseif ('customer' === $entity) {
|
||||
$stepSize = RetailcrmExport::RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE_WEB;
|
||||
|
||||
RetailcrmExport::$customersOffset = $stepSize;
|
||||
RetailcrmExport::exportCustomers($step * $stepSize, $stepSize);
|
||||
// todo maybe save current step to database
|
||||
}
|
||||
}
|
||||
|
||||
private static function handleError($entityId, $exception)
|
||||
{
|
||||
RetailcrmLogger::writeException('export', $exception, sprintf(
|
||||
|
@ -88,23 +88,22 @@ class RetailcrmExportOrdersHelper
|
||||
return [];
|
||||
}
|
||||
|
||||
$sqlOrdersInfo = 'SELECT * FROM `' . _DB_PREFIX_ . 'retailcrm_exported_orders` WHERE 1';
|
||||
$sqlPagination = 'SELECT COUNT(*) FROM `' . _DB_PREFIX_ . 'retailcrm_exported_orders` WHERE 1';
|
||||
$sqlOrdersInfo = 'FROM `' . _DB_PREFIX_ . 'retailcrm_exported_orders` eo
|
||||
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o on o.`id_order` = eo.`id_order`
|
||||
WHERE 1 ' . Shop::addSqlRestriction(false, 'o')
|
||||
;
|
||||
|
||||
if (0 < count($ordersIds)) {
|
||||
$sqlOrdersInfo .= ' AND (`id_order` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
OR `id_order_crm` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
)';
|
||||
$sqlPagination .= ' AND (`id_order` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
OR `id_order_crm` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
$sqlOrdersInfo .= ' AND (eo.`id_order` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
OR eo.`id_order_crm` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||
)';
|
||||
}
|
||||
|
||||
if (null !== $withErrors) {
|
||||
$sqlOrdersInfo .= ' AND errors IS ' . ($withErrors ? 'NOT' : '') . ' NULL';
|
||||
$sqlPagination .= ' AND errors IS ' . ($withErrors ? 'NOT' : '') . ' NULL';
|
||||
$sqlOrdersInfo .= ' AND eo.`errors` IS ' . ($withErrors ? 'NOT' : '') . ' NULL';
|
||||
}
|
||||
|
||||
$sqlPagination = 'SELECT COUNT(*) ' . $sqlOrdersInfo;
|
||||
$totalCount = Db::getInstance()->getValue($sqlPagination);
|
||||
|
||||
$pagination = [
|
||||
@ -116,7 +115,9 @@ class RetailcrmExportOrdersHelper
|
||||
if ($page > $pagination['totalPageCount']) {
|
||||
$orderInfo = [];
|
||||
} else {
|
||||
$sqlOrdersInfo .= ' ORDER BY eo.`last_uploaded` DESC'; // todo order by function $orderBy argument
|
||||
$sqlOrdersInfo .= ' LIMIT ' . self::ROWS_PER_PAGE * ($page - 1) . ', ' . self::ROWS_PER_PAGE . ';';
|
||||
$sqlOrdersInfo = 'SELECT eo.* ' . $sqlOrdersInfo;
|
||||
$orderInfo = Db::getInstance()->executeS($sqlOrdersInfo);
|
||||
}
|
||||
|
||||
|
@ -58,12 +58,12 @@ class RetailcrmHistory
|
||||
{
|
||||
self::$receiveOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING));
|
||||
self::$sendOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_SENDING));
|
||||
self::$cartStatus = (string) (Configuration::get('RETAILCRM_API_SYNCHRONIZED_CART_STATUS'));
|
||||
self::$statuses = array_flip(array_filter(json_decode(Configuration::get('RETAILCRM_API_STATUS'), true)));
|
||||
self::$deliveries = array_flip(array_filter(json_decode(Configuration::get('RETAILCRM_API_DELIVERY'), true)));
|
||||
self::$payments = array_flip(array_filter(json_decode(Configuration::get('RETAILCRM_API_PAYMENT'), true)));
|
||||
self::$deliveryDefault = json_decode(Configuration::get('RETAILCRM_API_DELIVERY_DEFAULT'), true);
|
||||
self::$paymentDefault = json_decode(Configuration::get('RETAILCRM_API_PAYMENT_DEFAULT'), true);
|
||||
self::$cartStatus = (string) (Configuration::get(RetailCRM::SYNC_CARTS_STATUS));
|
||||
self::$statuses = array_flip(array_filter(json_decode(Configuration::get(RetailCRM::STATUS), true)));
|
||||
self::$deliveries = array_flip(array_filter(json_decode(Configuration::get(RetailCRM::DELIVERY), true)));
|
||||
self::$payments = array_flip(array_filter(json_decode(Configuration::get(RetailCRM::PAYMENT), true)));
|
||||
self::$deliveryDefault = Configuration::get(RetailCRM::DELIVERY_DEFAULT);
|
||||
self::$paymentDefault = Configuration::get(RetailCRM::PAYMENT_DEFAULT);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -86,7 +86,8 @@ class RetailcrmIcml
|
||||
';
|
||||
|
||||
$xml = new SimpleXMLElement(
|
||||
$string, LIBXML_NOENT | LIBXML_NOCDATA | LIBXML_COMPACT | LIBXML_PARSEHUGE
|
||||
$string,
|
||||
LIBXML_NOENT | LIBXML_NOCDATA | LIBXML_COMPACT | LIBXML_PARSEHUGE
|
||||
);
|
||||
|
||||
$this->dd = new DOMDocument();
|
||||
|
@ -412,6 +412,7 @@ class RetailcrmJobManager
|
||||
*/
|
||||
private static function setLastRunDetails($lastRuns = [])
|
||||
{
|
||||
RetailcrmLogger::writeCaller(__METHOD__ . ':before', json_encode($lastRuns));
|
||||
if (!is_array($lastRuns)) {
|
||||
$lastRuns = [];
|
||||
}
|
||||
@ -424,6 +425,7 @@ class RetailcrmJobManager
|
||||
}
|
||||
}
|
||||
|
||||
RetailcrmLogger::writeCaller(__METHOD__ . ':after', json_encode($lastRuns));
|
||||
Configuration::updateGlobalValue(self::LAST_RUN_DETAIL_NAME, (string) json_encode($lastRuns));
|
||||
}
|
||||
|
||||
|
@ -52,23 +52,17 @@ class RetailcrmJsonResponse
|
||||
{
|
||||
private static function jsonResponse($response)
|
||||
{
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$result = json_encode($response);
|
||||
|
||||
echo $result;
|
||||
|
||||
return $result;
|
||||
return json_encode($response);
|
||||
}
|
||||
|
||||
public static function invalidResponse($msg, $status = 404)
|
||||
{
|
||||
http_response_code($status);
|
||||
|
||||
return self::jsonResponse([
|
||||
return [
|
||||
'success' => false,
|
||||
'errorMsg' => $msg,
|
||||
]);
|
||||
];
|
||||
}
|
||||
|
||||
public static function successfullResponse($data = null, $key = null)
|
||||
@ -91,6 +85,6 @@ class RetailcrmJsonResponse
|
||||
}
|
||||
}
|
||||
|
||||
return self::jsonResponse($response);
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ class RetailcrmLogger
|
||||
*/
|
||||
public static function clearObsoleteLogs()
|
||||
{
|
||||
$logFiles = self::getLogFiles();
|
||||
$logFiles = RetailcrmLoggerHelper::getLogFiles();
|
||||
|
||||
foreach ($logFiles as $logFile) {
|
||||
if (filemtime($logFile) < strtotime('-30 days')) {
|
||||
@ -244,71 +244,6 @@ class RetailcrmLogger
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves log files basic info for advanced tab
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public static function getLogFilesInfo()
|
||||
{
|
||||
$fileNames = [];
|
||||
$logFiles = self::getLogFiles();
|
||||
|
||||
foreach ($logFiles as $logFile) {
|
||||
$fileNames[] = [
|
||||
'name' => basename($logFile),
|
||||
'path' => $logFile,
|
||||
'size' => number_format(filesize($logFile), 0, '.', ' ') . ' bytes',
|
||||
'modified' => date('Y-m-d H:i:s', filemtime($logFile)),
|
||||
];
|
||||
}
|
||||
|
||||
return $fileNames;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves log files paths
|
||||
*
|
||||
* @return Generator|void
|
||||
*/
|
||||
private static function getLogFiles()
|
||||
{
|
||||
$logDir = self::getLogDir();
|
||||
|
||||
if (!is_dir($logDir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$handle = opendir($logDir);
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (false !== self::checkFileName($file)) {
|
||||
yield "$logDir/$file";
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given logs filename relates to the module
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function checkFileName($file)
|
||||
{
|
||||
$logDir = self::getLogDir();
|
||||
if (preg_match('/^retailcrm[a-zA-Z0-9-_]+.log$/', $file)) {
|
||||
$path = "$logDir/$file";
|
||||
if (is_file($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reduces error array into string
|
||||
*
|
||||
|
126
retailcrm/lib/RetailcrmLoggerHelper.php
Normal file
@ -0,0 +1,126 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmLoggerHelper
|
||||
{
|
||||
public static function download($name)
|
||||
{
|
||||
if (empty($name)) {
|
||||
return false;
|
||||
}
|
||||
$filePath = self::checkFileName($name);
|
||||
|
||||
if (false === $filePath) {
|
||||
return false;
|
||||
}
|
||||
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Content-Disposition: attachment; filename=' . basename($filePath));
|
||||
header('Content-Length: ' . filesize($filePath));
|
||||
|
||||
readfile($filePath);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static function downloadAll()
|
||||
{
|
||||
$zipname = _PS_DOWNLOAD_DIR_ . '/retailcrm_logs_' . date('Y-m-d H-i-s') . '.zip';
|
||||
|
||||
$zipFile = new ZipArchive();
|
||||
$zipFile->open($zipname, ZipArchive::CREATE);
|
||||
|
||||
foreach (self::getLogFiles() as $logFile) {
|
||||
$zipFile->addFile($logFile, basename($logFile));
|
||||
}
|
||||
|
||||
$zipFile->close();
|
||||
|
||||
header('Content-Type: ' . mime_content_type($zipname));
|
||||
header('Content-disposition: attachment; filename=' . basename($zipname));
|
||||
header('Content-Length: ' . filesize($zipname));
|
||||
|
||||
readfile($zipname);
|
||||
unlink($zipname);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if given logs filename relates to the module
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @return false|string
|
||||
*/
|
||||
public static function checkFileName($file)
|
||||
{
|
||||
$logDir = RetailcrmLogger::getLogDir();
|
||||
if (preg_match('/^retailcrm[a-zA-Z0-9-_]+.log$/', $file)) {
|
||||
$path = "$logDir/$file";
|
||||
if (is_file($path)) {
|
||||
return $path;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieves log files paths
|
||||
*
|
||||
* @return Generator|void
|
||||
*/
|
||||
public static function getLogFiles()
|
||||
{
|
||||
$logDir = RetailcrmLogger::getLogDir();
|
||||
|
||||
if (!is_dir($logDir)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$handle = opendir($logDir);
|
||||
while (($file = readdir($handle)) !== false) {
|
||||
if (false !== self::checkFileName($file)) {
|
||||
yield "$logDir/$file";
|
||||
}
|
||||
}
|
||||
|
||||
closedir($handle);
|
||||
}
|
||||
}
|
@ -196,8 +196,7 @@ class RetailcrmOrderBuilder
|
||||
if (empty($this->apiSite)) {
|
||||
$response = $this->api->credentials();
|
||||
|
||||
if (
|
||||
$response->isSuccessful()
|
||||
if ($response->isSuccessful()
|
||||
&& $response->offsetExists('sitesAvailable')
|
||||
&& is_array($response['sitesAvailable'])
|
||||
&& !empty($response['sitesAvailable'])
|
||||
@ -894,7 +893,7 @@ class RetailcrmOrderBuilder
|
||||
$order,
|
||||
$customer = null,
|
||||
$orderCart = null,
|
||||
$isStatusExport = false,
|
||||
$isStatusExport = false, // todo always false -> remove unused parameter
|
||||
$preferCustomerAddress = false,
|
||||
$dataFromCart = false,
|
||||
$contactPersonId = '',
|
||||
@ -915,7 +914,7 @@ class RetailcrmOrderBuilder
|
||||
$paymentType = $order->payment;
|
||||
}
|
||||
|
||||
if (0 == $order->current_state) {
|
||||
if (0 == $order->current_state) { // todo refactor
|
||||
$order_status = $statusExport;
|
||||
|
||||
if (!$isStatusExport) {
|
||||
@ -1172,7 +1171,8 @@ class RetailcrmOrderBuilder
|
||||
'order' => $order,
|
||||
'customer' => $customer,
|
||||
'cart' => $cart,
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1271,7 +1271,8 @@ class RetailcrmOrderBuilder
|
||||
[
|
||||
'customer' => $object,
|
||||
'address' => $address,
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
public static function buildCrmCustomerCorporate(
|
||||
@ -1359,7 +1360,8 @@ class RetailcrmOrderBuilder
|
||||
RetailcrmTools::clearArray($customer),
|
||||
[
|
||||
'customer' => $object,
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -67,21 +67,13 @@ class RetailcrmReferences
|
||||
public function getDeliveryTypes()
|
||||
{
|
||||
$deliveryTypes = [];
|
||||
$apiDeliveryTypes = $this->getApiDeliveryTypes();
|
||||
|
||||
if (!empty($this->carriers)) {
|
||||
foreach ($this->carriers as $carrier) {
|
||||
$deliveryTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $carrier['name'],
|
||||
'name' => 'RETAILCRM_API_DELIVERY[' . $carrier['id_carrier'] . ']',
|
||||
'subname' => $carrier['id_carrier'],
|
||||
'id' => $carrier['id_carrier'],
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $apiDeliveryTypes,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -93,23 +85,14 @@ class RetailcrmReferences
|
||||
{
|
||||
$statusTypes = [];
|
||||
$states = OrderState::getOrderStates($this->default_lang, true);
|
||||
$this->apiStatuses = $this->apiStatuses ?: $this->getApiStatuses();
|
||||
|
||||
if (!empty($states)) {
|
||||
foreach ($states as $state) {
|
||||
if (' ' != $state['name']) {
|
||||
$key = $state['id_order_state'];
|
||||
$statusTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $state['name'],
|
||||
'name' => "RETAILCRM_API_STATUS[$key]",
|
||||
'subname' => $key,
|
||||
'id' => $state['id_order_state'],
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $this->apiStatuses,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
@ -118,117 +101,6 @@ class RetailcrmReferences
|
||||
return $statusTypes;
|
||||
}
|
||||
|
||||
public function getOutOfStockStatuses($arParams)
|
||||
{
|
||||
$statusTypes = [];
|
||||
$this->apiStatuses = $this->apiStatuses ?: $this->getApiStatuses();
|
||||
|
||||
foreach ($arParams as $key => $state) {
|
||||
$statusTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $state,
|
||||
'name' => "RETAILCRM_API_OUT_OF_STOCK_STATUS[$key]",
|
||||
'subname' => $key,
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $this->apiStatuses,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $statusTypes;
|
||||
}
|
||||
|
||||
public function getPaymentTypes()
|
||||
{
|
||||
$payments = $this->getSystemPaymentModules();
|
||||
$paymentTypes = [];
|
||||
$apiPaymentTypes = $this->getApiPaymentTypes();
|
||||
|
||||
if (!empty($payments)) {
|
||||
foreach ($payments as $payment) {
|
||||
$paymentTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $payment['name'],
|
||||
'name' => 'RETAILCRM_API_PAYMENT[' . $payment['code'] . ']',
|
||||
'subname' => $payment['code'],
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $apiPaymentTypes,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $paymentTypes;
|
||||
}
|
||||
|
||||
public function getPaymentAndDeliveryForDefault($arParams)
|
||||
{
|
||||
$paymentTypes = [];
|
||||
$deliveryTypes = [];
|
||||
|
||||
$paymentDeliveryTypes = [];
|
||||
|
||||
if (!empty($this->carriers)) {
|
||||
$deliveryTypes[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
];
|
||||
|
||||
foreach ($this->carriers as $valCarrier) {
|
||||
$deliveryTypes[] = [
|
||||
'id_option' => $valCarrier['id_carrier'],
|
||||
'name' => $valCarrier['name'],
|
||||
];
|
||||
}
|
||||
|
||||
$paymentDeliveryTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $arParams[0],
|
||||
'name' => 'RETAILCRM_API_DELIVERY_DEFAULT',
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $deliveryTypes,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
$paymentModules = $this->getSystemPaymentModules();
|
||||
if (!empty($paymentModules)) {
|
||||
$paymentTypes[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
];
|
||||
|
||||
foreach ($paymentModules as $valPayment) {
|
||||
$paymentTypes[$valPayment['id']] = [
|
||||
'id_option' => $valPayment['code'],
|
||||
'name' => $valPayment['name'],
|
||||
];
|
||||
}
|
||||
|
||||
$paymentDeliveryTypes[] = [
|
||||
'type' => 'select',
|
||||
'label' => $arParams[1],
|
||||
'name' => 'RETAILCRM_API_PAYMENT_DEFAULT',
|
||||
'required' => false,
|
||||
'options' => [
|
||||
'query' => $paymentTypes,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $paymentDeliveryTypes;
|
||||
}
|
||||
|
||||
public function getSystemPaymentModules($active = true)
|
||||
{
|
||||
$shop_id = (int) Context::getContext()->shop->id;
|
||||
@ -291,59 +163,52 @@ class RetailcrmReferences
|
||||
return $this->payment_modules;
|
||||
}
|
||||
|
||||
public function getStatuseDefaultExport()
|
||||
public function getApiStatusesWithGroup()
|
||||
{
|
||||
return $this->getApiStatuses();
|
||||
}
|
||||
|
||||
public function getApiDeliveryTypes()
|
||||
{
|
||||
$crmDeliveryTypes = [];
|
||||
$request = $this->api->deliveryTypesList();
|
||||
|
||||
if ($request) {
|
||||
$crmDeliveryTypes[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
];
|
||||
foreach ($request->deliveryTypes as $dType) {
|
||||
if (!$dType['active']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$crmDeliveryTypes[] = [
|
||||
'id_option' => $dType['code'],
|
||||
'name' => $dType['name'],
|
||||
];
|
||||
}
|
||||
if (!$this->api) {
|
||||
return [];
|
||||
}
|
||||
|
||||
return $crmDeliveryTypes;
|
||||
}
|
||||
|
||||
public function getApiStatuses()
|
||||
{
|
||||
$crmStatusTypes = [];
|
||||
$request = $this->api->statusesList();
|
||||
$requestGroups = $this->api->statusGroupsList();
|
||||
|
||||
if ($request) {
|
||||
$crmStatusTypes[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
'ordering' => '',
|
||||
];
|
||||
foreach ($request->statuses as $sType) {
|
||||
if (!$sType['active']) {
|
||||
continue;
|
||||
}
|
||||
if (!$request || !$requestGroups) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$crmStatusTypes[] = [
|
||||
'id_option' => $sType['code'],
|
||||
'name' => $sType['name'],
|
||||
'ordering' => $sType['ordering'],
|
||||
];
|
||||
$crmStatusTypes = [];
|
||||
foreach ($request->statuses as $sType) {
|
||||
if (!$sType['active']) {
|
||||
continue;
|
||||
}
|
||||
usort($crmStatusTypes, function ($a, $b) {
|
||||
|
||||
$crmStatusTypes[$sType['group']]['statuses'][] = [
|
||||
'code' => $sType['code'],
|
||||
'name' => $sType['name'],
|
||||
'ordering' => $sType['ordering'],
|
||||
];
|
||||
}
|
||||
|
||||
foreach ($requestGroups->statusGroups as $statusGroup) {
|
||||
if (!isset($crmStatusTypes[$statusGroup['code']])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$crmStatusTypes[$statusGroup['code']]['code'] = $statusGroup['code'];
|
||||
$crmStatusTypes[$statusGroup['code']]['name'] = $statusGroup['name'];
|
||||
$crmStatusTypes[$statusGroup['code']]['ordering'] = $statusGroup['ordering'];
|
||||
}
|
||||
|
||||
usort($crmStatusTypes, function ($a, $b) {
|
||||
if ($a['ordering'] == $b['ordering']) {
|
||||
return 0;
|
||||
} else {
|
||||
return $a['ordering'] < $b['ordering'] ? -1 : 1;
|
||||
}
|
||||
});
|
||||
|
||||
foreach ($crmStatusTypes as &$crmStatusType) {
|
||||
usort($crmStatusType['statuses'], function ($a, $b) {
|
||||
if ($a['ordering'] == $b['ordering']) {
|
||||
return 0;
|
||||
} else {
|
||||
@ -355,26 +220,95 @@ class RetailcrmReferences
|
||||
return $crmStatusTypes;
|
||||
}
|
||||
|
||||
public function getApiDeliveryTypes()
|
||||
{
|
||||
if (!$this->api) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$crmDeliveryTypes = [];
|
||||
$request = $this->api->deliveryTypesList();
|
||||
|
||||
if (!$request) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($request->deliveryTypes as $dType) {
|
||||
if (!$dType['active']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$crmDeliveryTypes[] = [
|
||||
'code' => $dType['code'],
|
||||
'name' => $dType['name'],
|
||||
];
|
||||
}
|
||||
|
||||
return $crmDeliveryTypes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Used in \RetailcrmSettings::validateStoredSettings to validate api statuses
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getApiStatuses()
|
||||
{
|
||||
if (!$this->api) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$crmStatusTypes = [];
|
||||
$request = $this->api->statusesList();
|
||||
|
||||
if (!$request) {
|
||||
return [];
|
||||
}
|
||||
|
||||
foreach ($request->statuses as $sType) {
|
||||
if (!$sType['active']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$crmStatusTypes[] = [
|
||||
'code' => $sType['code'],
|
||||
'name' => $sType['name'],
|
||||
'ordering' => $sType['ordering'],
|
||||
];
|
||||
}
|
||||
usort($crmStatusTypes, function ($a, $b) {
|
||||
if ($a['ordering'] == $b['ordering']) {
|
||||
return 0;
|
||||
} else {
|
||||
return $a['ordering'] < $b['ordering'] ? -1 : 1;
|
||||
}
|
||||
});
|
||||
|
||||
return $crmStatusTypes;
|
||||
}
|
||||
|
||||
public function getApiPaymentTypes()
|
||||
{
|
||||
if (!$this->api) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$crmPaymentTypes = [];
|
||||
$request = $this->api->paymentTypesList();
|
||||
|
||||
if ($request) {
|
||||
$crmPaymentTypes[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
];
|
||||
foreach ($request->paymentTypes as $pType) {
|
||||
if (!$pType['active']) {
|
||||
continue;
|
||||
}
|
||||
if (!$request) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$crmPaymentTypes[] = [
|
||||
'id_option' => $pType['code'],
|
||||
'name' => $pType['name'],
|
||||
];
|
||||
foreach ($request->paymentTypes as $pType) {
|
||||
if (!$pType['active']) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$crmPaymentTypes[] = [
|
||||
'code' => $pType['code'],
|
||||
'name' => $pType['name'],
|
||||
];
|
||||
}
|
||||
|
||||
return $crmPaymentTypes;
|
||||
@ -416,61 +350,4 @@ class RetailcrmReferences
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getStores()
|
||||
{
|
||||
$storesShop = $this->getShopStores();
|
||||
$retailcrmStores = $this->getApiStores();
|
||||
|
||||
foreach ($storesShop as $key => $storeShop) {
|
||||
$stores[] = [
|
||||
'type' => 'select',
|
||||
'name' => 'RETAILCRM_STORES[' . $key . ']',
|
||||
'label' => $storeShop,
|
||||
'options' => [
|
||||
'query' => $retailcrmStores,
|
||||
'id' => 'id_option',
|
||||
'name' => 'name',
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
return $stores;
|
||||
}
|
||||
|
||||
protected function getShopStores()
|
||||
{
|
||||
$stores = [];
|
||||
$warehouses = Warehouse::getWarehouses();
|
||||
|
||||
foreach ($warehouses as $warehouse) {
|
||||
$arrayName = explode('-', $warehouse['name']);
|
||||
$warehouseName = trim($arrayName[1]);
|
||||
$stores[$warehouse['id_warehouse']] = $warehouseName;
|
||||
}
|
||||
|
||||
return $stores;
|
||||
}
|
||||
|
||||
protected function getApiStores()
|
||||
{
|
||||
$crmStores = [];
|
||||
$response = $this->api->storesList();
|
||||
|
||||
if ($response) {
|
||||
$crmStores[] = [
|
||||
'id_option' => '',
|
||||
'name' => '',
|
||||
];
|
||||
|
||||
foreach ($response->stores as $store) {
|
||||
$crmStores[] = [
|
||||
'id_option' => $store['code'],
|
||||
'name' => $store['name'],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
return $crmStores;
|
||||
}
|
||||
}
|
||||
|
@ -227,20 +227,20 @@ class RetailcrmTools
|
||||
|
||||
$msg = '';
|
||||
if (null !== $relatedObject) {
|
||||
$msg = sprintf('for %s with id %s',
|
||||
$msg = sprintf(
|
||||
'for %s with id %s',
|
||||
get_class($relatedObject),
|
||||
$relatedObject->id
|
||||
);
|
||||
}
|
||||
|
||||
RetailcrmLogger::writeCaller(__METHOD__, sprintf(
|
||||
'Error validating %s with id %s%s: %s',
|
||||
get_class($object),
|
||||
$object->id,
|
||||
$msg,
|
||||
$validate
|
||||
)
|
||||
);
|
||||
'Error validating %s with id %s%s: %s',
|
||||
get_class($object),
|
||||
$object->id,
|
||||
$msg,
|
||||
$validate
|
||||
));
|
||||
|
||||
return false;
|
||||
}
|
||||
@ -383,7 +383,7 @@ class RetailcrmTools
|
||||
public static function validateCrmAddress($address)
|
||||
{
|
||||
if (preg_match("/https:\/\/(.*).(retailcrm.(pro|ru|es)|simla.com)/", $address)) {
|
||||
return true;
|
||||
return Validate::isGenericName($address);
|
||||
}
|
||||
|
||||
return false;
|
||||
@ -619,43 +619,117 @@ class RetailcrmTools
|
||||
} else {
|
||||
if (null !== $code) {
|
||||
switch ($code) {
|
||||
case 100: $text = 'Continue'; break;
|
||||
case 101: $text = 'Switching Protocols'; break;
|
||||
case 200: $text = 'OK'; break;
|
||||
case 201: $text = 'Created'; break;
|
||||
case 202: $text = 'Accepted'; break;
|
||||
case 203: $text = 'Non-Authoritative Information'; break;
|
||||
case 204: $text = 'No Content'; break;
|
||||
case 205: $text = 'Reset Content'; break;
|
||||
case 206: $text = 'Partial Content'; break;
|
||||
case 300: $text = 'Multiple Choices'; break;
|
||||
case 301: $text = 'Moved Permanently'; break;
|
||||
case 302: $text = 'Moved Temporarily'; break;
|
||||
case 303: $text = 'See Other'; break;
|
||||
case 304: $text = 'Not Modified'; break;
|
||||
case 305: $text = 'Use Proxy'; break;
|
||||
case 400: $text = 'Bad Request'; break;
|
||||
case 401: $text = 'Unauthorized'; break;
|
||||
case 402: $text = 'Payment Required'; break;
|
||||
case 403: $text = 'Forbidden'; break;
|
||||
case 404: $text = 'Not Found'; break;
|
||||
case 405: $text = 'Method Not Allowed'; break;
|
||||
case 406: $text = 'Not Acceptable'; break;
|
||||
case 407: $text = 'Proxy Authentication Required'; break;
|
||||
case 408: $text = 'Request Time-out'; break;
|
||||
case 409: $text = 'Conflict'; break;
|
||||
case 410: $text = 'Gone'; break;
|
||||
case 411: $text = 'Length Required'; break;
|
||||
case 412: $text = 'Precondition Failed'; break;
|
||||
case 413: $text = 'Request Entity Too Large'; break;
|
||||
case 414: $text = 'Request-URI Too Large'; break;
|
||||
case 415: $text = 'Unsupported Media Type'; break;
|
||||
case 500: $text = 'Internal Server Error'; break;
|
||||
case 501: $text = 'Not Implemented'; break;
|
||||
case 502: $text = 'Bad Gateway'; break;
|
||||
case 503: $text = 'Service Unavailable'; break;
|
||||
case 504: $text = 'Gateway Time-out'; break;
|
||||
case 505: $text = 'HTTP Version not supported'; break;
|
||||
case 100:
|
||||
$text = 'Continue';
|
||||
break;
|
||||
case 101:
|
||||
$text = 'Switching Protocols';
|
||||
break;
|
||||
case 200:
|
||||
$text = 'OK';
|
||||
break;
|
||||
case 201:
|
||||
$text = 'Created';
|
||||
break;
|
||||
case 202:
|
||||
$text = 'Accepted';
|
||||
break;
|
||||
case 203:
|
||||
$text = 'Non-Authoritative Information';
|
||||
break;
|
||||
case 204:
|
||||
$text = 'No Content';
|
||||
break;
|
||||
case 205:
|
||||
$text = 'Reset Content';
|
||||
break;
|
||||
case 206:
|
||||
$text = 'Partial Content';
|
||||
break;
|
||||
case 300:
|
||||
$text = 'Multiple Choices';
|
||||
break;
|
||||
case 301:
|
||||
$text = 'Moved Permanently';
|
||||
break;
|
||||
case 302:
|
||||
$text = 'Moved Temporarily';
|
||||
break;
|
||||
case 303:
|
||||
$text = 'See Other';
|
||||
break;
|
||||
case 304:
|
||||
$text = 'Not Modified';
|
||||
break;
|
||||
case 305:
|
||||
$text = 'Use Proxy';
|
||||
break;
|
||||
case 400:
|
||||
$text = 'Bad Request';
|
||||
break;
|
||||
case 401:
|
||||
$text = 'Unauthorized';
|
||||
break;
|
||||
case 402:
|
||||
$text = 'Payment Required';
|
||||
break;
|
||||
case 403:
|
||||
$text = 'Forbidden';
|
||||
break;
|
||||
case 404:
|
||||
$text = 'Not Found';
|
||||
break;
|
||||
case 405:
|
||||
$text = 'Method Not Allowed';
|
||||
break;
|
||||
case 406:
|
||||
$text = 'Not Acceptable';
|
||||
break;
|
||||
case 407:
|
||||
$text = 'Proxy Authentication Required';
|
||||
break;
|
||||
case 408:
|
||||
$text = 'Request Time-out';
|
||||
break;
|
||||
case 409:
|
||||
$text = 'Conflict';
|
||||
break;
|
||||
case 410:
|
||||
$text = 'Gone';
|
||||
break;
|
||||
case 411:
|
||||
$text = 'Length Required';
|
||||
break;
|
||||
case 412:
|
||||
$text = 'Precondition Failed';
|
||||
break;
|
||||
case 413:
|
||||
$text = 'Request Entity Too Large';
|
||||
break;
|
||||
case 414:
|
||||
$text = 'Request-URI Too Large';
|
||||
break;
|
||||
case 415:
|
||||
$text = 'Unsupported Media Type';
|
||||
break;
|
||||
case 500:
|
||||
$text = 'Internal Server Error';
|
||||
break;
|
||||
case 501:
|
||||
$text = 'Not Implemented';
|
||||
break;
|
||||
case 502:
|
||||
$text = 'Bad Gateway';
|
||||
break;
|
||||
case 503:
|
||||
$text = 'Service Unavailable';
|
||||
break;
|
||||
case 504:
|
||||
$text = 'Gateway Time-out';
|
||||
break;
|
||||
case 505:
|
||||
$text = 'HTTP Version not supported';
|
||||
break;
|
||||
default:
|
||||
exit('Unknown http status code "' . htmlentities($code) . '"');
|
||||
break;
|
||||
@ -918,10 +992,12 @@ class RetailcrmTools
|
||||
{
|
||||
$controllerName = str_replace('Controller', '', $className);
|
||||
|
||||
return sprintf('%s%s/index.php?controller=%s&token=%s',
|
||||
return sprintf(
|
||||
'%s%s/index.php?controller=%s&token=%s',
|
||||
Tools::getAdminUrl(),
|
||||
basename(_PS_ADMIN_DIR_),
|
||||
$controllerName,
|
||||
Tools::getAdminTokenLite($controllerName));
|
||||
Tools::getAdminTokenLite($controllerName)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,5 @@
|
||||
{**
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
@ -33,10 +34,8 @@
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*}
|
||||
<script>
|
||||
const retailcrmTranslates = {
|
||||
'orders-table.empty': '{l s='No orders found' mod='retailcrm'}',
|
||||
'orders-table.error': '{l s='An error occured while searching for the orders. Please try again' mod='retailcrm'}'
|
||||
};
|
||||
</script>
|
||||
*/
|
||||
|
||||
class RetailcrmNotFoundException extends Exception
|
||||
{
|
||||
}
|
109
retailcrm/lib/settings/RetailcrmSettings.php
Normal file
@ -0,0 +1,109 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettings
|
||||
{
|
||||
/**
|
||||
* @var RetailcrmSettingsItems
|
||||
*/
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* @var RetailcrmSettingsItemHtml
|
||||
*/
|
||||
private $consultantScript;
|
||||
|
||||
/**
|
||||
* @var RetailcrmSettingsValidator
|
||||
*/
|
||||
private $validator;
|
||||
|
||||
public function __construct(RetailCRM $module)
|
||||
{
|
||||
$this->settings = new RetailcrmSettingsItems();
|
||||
$this->consultantScript = new RetailcrmSettingsItemHtml('consultantScript', RetailCRM::CONSULTANT_SCRIPT);
|
||||
|
||||
$this->validator = new RetailcrmSettingsValidator($this->settings, $module->reference);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save settings handler
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
if ($this->validator->validate()) {
|
||||
$this->settings->updateValueAll();
|
||||
}
|
||||
|
||||
$changed = $this->settings->getChanged();
|
||||
|
||||
if ($this->consultantScript->issetValue()) {
|
||||
$this->updateConsultantCode();
|
||||
$changed['consultantScript'] = $this->consultantScript->getValueStored();
|
||||
}
|
||||
|
||||
return [
|
||||
'success' => $this->validator->getSuccess(),
|
||||
'errors' => $this->validator->getErrors(),
|
||||
'warnings' => $this->validator->getWarnings(),
|
||||
'changed' => $changed,
|
||||
];
|
||||
}
|
||||
|
||||
private function updateConsultantCode()
|
||||
{
|
||||
$consultantCode = $this->consultantScript->getValue();
|
||||
|
||||
if (!empty($consultantCode)) {
|
||||
$extractor = new RetailcrmConsultantRcctExtractor();
|
||||
$rcct = $extractor->setConsultantScript($consultantCode)->build()->getDataString();
|
||||
|
||||
if (!empty($rcct)) {
|
||||
$this->consultantScript->updateValue();
|
||||
Configuration::updateValue(RetailCRM::CONSULTANT_RCCT, $rcct);
|
||||
Cache::getInstance()->set(RetailCRM::CONSULTANT_RCCT, $rcct);
|
||||
} else {
|
||||
$this->consultantScript->deleteValue();
|
||||
Configuration::deleteByName(RetailCRM::CONSULTANT_RCCT);
|
||||
Cache::getInstance()->delete(RetailCRM::CONSULTANT_RCCT);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
138
retailcrm/lib/settings/RetailcrmSettingsHelper.php
Normal file
@ -0,0 +1,138 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettingsHelper
|
||||
{
|
||||
public static function getCartDelays()
|
||||
{
|
||||
return
|
||||
[
|
||||
'900',
|
||||
'1800',
|
||||
'2700',
|
||||
'3600',
|
||||
];
|
||||
}
|
||||
|
||||
public static function getJobsInfo()
|
||||
{
|
||||
$jobsInfo = [];
|
||||
|
||||
$lastRunDetails = RetailcrmJobManager::getLastRunDetails();
|
||||
$currentJob = Configuration::get(RetailcrmJobManager::CURRENT_TASK);
|
||||
$currentJobCli = Configuration::get(RetailcrmCli::CURRENT_TASK_CLI);
|
||||
|
||||
foreach ($lastRunDetails as $job => $detail) {
|
||||
$lastRunDetails[$job]['name'] = $job;
|
||||
$lastRunDetails[$job]['running'] = $job === $currentJob || $job === $currentJobCli;
|
||||
|
||||
$jobsInfo[] = $lastRunDetails[$job]; // todo refactor
|
||||
}
|
||||
|
||||
return $jobsInfo;
|
||||
}
|
||||
|
||||
public static function getLogFilesInfo()
|
||||
{
|
||||
$fileNames = [];
|
||||
$logFiles = RetailcrmLoggerHelper::getLogFiles();
|
||||
|
||||
foreach ($logFiles as $logFile) {
|
||||
$fileNames[] = [
|
||||
'name' => basename($logFile),
|
||||
'path' => $logFile,
|
||||
'size' => number_format(filesize($logFile), 0, '.', ' ') . ' bytes',
|
||||
'modified' => date('Y-m-d H:i:s', filemtime($logFile)),
|
||||
];
|
||||
}
|
||||
|
||||
return $fileNames;
|
||||
}
|
||||
|
||||
public static function getIcmlFileInfo()
|
||||
{
|
||||
$icmlInfo = json_decode((string) Configuration::get(RetailcrmCatalogHelper::ICML_INFO_NAME), true);
|
||||
|
||||
if (null === $icmlInfo || JSON_ERROR_NONE !== json_last_error()) {
|
||||
$icmlInfo = [];
|
||||
}
|
||||
|
||||
$icmlInfo['isCatalogConnected'] = false;
|
||||
$icmlInfo['isUrlActual'] = false;
|
||||
$icmlInfo['siteId'] = null;
|
||||
|
||||
$lastGenerated = RetailcrmCatalogHelper::getIcmlFileDate();
|
||||
|
||||
if (false === $lastGenerated) {
|
||||
return $icmlInfo;
|
||||
}
|
||||
|
||||
$icmlInfo['isCatalogConnected'] = true;
|
||||
|
||||
$icmlInfo['lastGenerated'] = $lastGenerated;
|
||||
$now = new DateTimeImmutable();
|
||||
/** @var DateInterval $diff */
|
||||
$diff = $lastGenerated->diff($now);
|
||||
|
||||
$icmlInfo['lastGeneratedDiff'] = [
|
||||
'days' => $diff->days,
|
||||
'hours' => $diff->h,
|
||||
'minutes' => $diff->i,
|
||||
];
|
||||
|
||||
$icmlInfo['isOutdated'] = (
|
||||
0 < $icmlInfo['lastGeneratedDiff']['days']
|
||||
|| 4 < $icmlInfo['lastGeneratedDiff']['hours']
|
||||
);
|
||||
|
||||
$api = RetailcrmTools::getApiClient();
|
||||
|
||||
if (null !== $api) {
|
||||
$reference = new RetailcrmReferences($api);
|
||||
|
||||
$site = $reference->getSite();
|
||||
$icmlInfo['isUrlActual'] = !empty($site['ymlUrl'])
|
||||
&& $site['ymlUrl'] === RetailcrmCatalogHelper::getIcmlFileLink();
|
||||
if (!empty($site['catalogId'])) {
|
||||
$icmlInfo['siteId'] = $site['catalogId'];
|
||||
}
|
||||
}
|
||||
|
||||
return $icmlInfo;
|
||||
}
|
||||
}
|
94
retailcrm/lib/settings/RetailcrmSettingsItem.php
Normal file
@ -0,0 +1,94 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettingsItem
|
||||
{
|
||||
private $paramKey;
|
||||
protected $configKey;
|
||||
|
||||
public function __construct($paramKey, $configKey)
|
||||
{
|
||||
$this->paramKey = $paramKey;
|
||||
$this->configKey = $configKey;
|
||||
}
|
||||
|
||||
public function updateValue()
|
||||
{
|
||||
if (!$this->issetValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $this->getValueForUpdate();
|
||||
|
||||
Configuration::updateValue($this->configKey, $value);
|
||||
}
|
||||
|
||||
public function issetValue()
|
||||
{
|
||||
return Tools::getIsset($this->paramKey);
|
||||
}
|
||||
|
||||
public function deleteValue()
|
||||
{
|
||||
return Configuration::deleteByName($this->configKey);
|
||||
}
|
||||
|
||||
public function getValue()
|
||||
{
|
||||
return Tools::getValue($this->paramKey);
|
||||
}
|
||||
|
||||
public function getValueForUpdate() // todo make protected
|
||||
{
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
public function getValueStored()
|
||||
{
|
||||
return Configuration::get($this->configKey, null, null, null, '');
|
||||
}
|
||||
|
||||
public function getValueWithStored()
|
||||
{
|
||||
if ($this->issetValue()) {
|
||||
return $this->getValue();
|
||||
}
|
||||
|
||||
return $this->getValueStored();
|
||||
}
|
||||
}
|
@ -36,10 +36,24 @@
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../');
|
||||
exit;
|
||||
class RetailcrmSettingsItemBool extends RetailcrmSettingsItem
|
||||
{
|
||||
public function getValue()
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
return false !== $value && 'false' !== $value;
|
||||
}
|
||||
|
||||
public function getValueForUpdate() // todo to protected
|
||||
{
|
||||
$valueForUpdate = parent::getValueForUpdate();
|
||||
|
||||
return $valueForUpdate ? '1' : '0';
|
||||
}
|
||||
|
||||
public function getValueStored()
|
||||
{
|
||||
return '1' === parent::getValueStored();
|
||||
}
|
||||
}
|
@ -36,10 +36,23 @@
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../');
|
||||
exit;
|
||||
class RetailcrmSettingsItemCache extends RetailcrmSettingsItem
|
||||
{
|
||||
public function updateValue()
|
||||
{
|
||||
if (!$this->issetValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $this->getValueForUpdate();
|
||||
|
||||
Configuration::updateValue($this->configKey, $value);
|
||||
Cache::getInstance()->set($this->configKey, $value);
|
||||
}
|
||||
|
||||
public function deleteValue()
|
||||
{
|
||||
return parent::deleteValue()
|
||||
&& Cache::getInstance()->delete($this->configKey);
|
||||
}
|
||||
}
|
@ -36,10 +36,16 @@
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../');
|
||||
exit;
|
||||
class RetailcrmSettingsItemHtml extends RetailcrmSettingsItem
|
||||
{
|
||||
public function updateValue()
|
||||
{
|
||||
if (!$this->issetValue()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$value = $this->getValueForUpdate();
|
||||
|
||||
Configuration::updateValue($this->configKey, $value, true);
|
||||
}
|
||||
}
|
73
retailcrm/lib/settings/RetailcrmSettingsItemJson.php
Normal file
@ -0,0 +1,73 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettingsItemJson extends RetailcrmSettingsItem
|
||||
{
|
||||
public function getValue()
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
if (is_string($value)) {
|
||||
return json_decode($value, true);
|
||||
}
|
||||
|
||||
if (is_array($value)) {
|
||||
return $value;
|
||||
}
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
public function getValueForUpdate() // todo change to protected
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
if (is_array($value)) {
|
||||
return json_encode($value);
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
|
||||
public function getValueStored()
|
||||
{
|
||||
$valueStored = parent::getValueStored();
|
||||
|
||||
return (array) json_decode($valueStored, true);
|
||||
}
|
||||
}
|
@ -36,10 +36,16 @@
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
|
||||
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
|
||||
header('Cache-Control: no-store, no-cache, must-revalidate');
|
||||
header('Cache-Control: post-check=0, pre-check=0', false);
|
||||
header('Pragma: no-cache');
|
||||
header('Location: ../');
|
||||
exit;
|
||||
class RetailcrmSettingsItemUrl extends RetailcrmSettingsItem
|
||||
{
|
||||
public function getValue()
|
||||
{
|
||||
$value = parent::getValue();
|
||||
|
||||
if ('/' !== $value[strlen($value) - 1]) {
|
||||
$value .= '/';
|
||||
}
|
||||
|
||||
return $value;
|
||||
}
|
||||
}
|
153
retailcrm/lib/settings/RetailcrmSettingsItems.php
Normal file
@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettingsItems
|
||||
{
|
||||
/**
|
||||
* @var RetailcrmSettingsItem[]
|
||||
*/
|
||||
private $settings;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->settings = [
|
||||
'url' => new RetailcrmSettingsItemUrl('url', RetailCRM::API_URL),
|
||||
'apiKey' => new RetailcrmSettingsItem('apiKey', RetailCRM::API_KEY),
|
||||
|
||||
'delivery' => new RetailcrmSettingsItemJson('delivery', RetailCRM::DELIVERY),
|
||||
'payment' => new RetailcrmSettingsItemJson('payment', RetailCRM::PAYMENT),
|
||||
'status' => new RetailcrmSettingsItemJson('status', RetailCRM::STATUS),
|
||||
'outOfStockStatus' => new RetailcrmSettingsItemJson('outOfStockStatus', RetailCRM::OUT_OF_STOCK_STATUS),
|
||||
|
||||
'enableHistoryUploads' => new RetailcrmSettingsItemBool('enableHistoryUploads', RetailCRM::ENABLE_HISTORY_UPLOADS),
|
||||
'enableBalancesReceiving' => new RetailcrmSettingsItemBool('enableBalancesReceiving', RetailCRM::ENABLE_BALANCES_RECEIVING),
|
||||
'collectorActive' => new RetailcrmSettingsItemBool('collectorActive', RetailCRM::COLLECTOR_ACTIVE),
|
||||
'synchronizeCartsActive' => new RetailcrmSettingsItemBool('synchronizeCartsActive', RetailCRM::SYNC_CARTS_ACTIVE),
|
||||
'enableCorporate' => new RetailcrmSettingsItemBool('enableCorporate', RetailCRM::ENABLE_CORPORATE_CLIENTS),
|
||||
'enableOrderNumberSending' => new RetailcrmSettingsItemBool('enableOrderNumberSending', RetailCRM::ENABLE_ORDER_NUMBER_SENDING),
|
||||
'enableOrderNumberReceiving' => new RetailcrmSettingsItemBool('enableOrderNumberReceiving', RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING),
|
||||
'webJobs' => new RetailcrmSettingsItemBool('webJobs', RetailCRM::ENABLE_WEB_JOBS),
|
||||
'debugMode' => new RetailcrmSettingsItemBool('debugMode', RetailCRM::ENABLE_DEBUG_MODE),
|
||||
|
||||
'deliveryDefault' => new RetailcrmSettingsItem('deliveryDefault', RetailCRM::DELIVERY_DEFAULT),
|
||||
'paymentDefault' => new RetailcrmSettingsItem('paymentDefault', RetailCRM::PAYMENT_DEFAULT),
|
||||
'synchronizedCartStatus' => new RetailcrmSettingsItem('synchronizedCartStatus', RetailCRM::SYNC_CARTS_STATUS),
|
||||
'synchronizedCartDelay' => new RetailcrmSettingsItem('synchronizedCartDelay', RetailCRM::SYNC_CARTS_DELAY),
|
||||
'collectorKey' => new RetailcrmSettingsItem('collectorKey', RetailCRM::COLLECTOR_KEY),
|
||||
];
|
||||
}
|
||||
|
||||
public function getValue($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
return $this->settings[$key]->getValue();
|
||||
}
|
||||
|
||||
public function issetValue($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
return $this->settings[$key]->issetValue();
|
||||
}
|
||||
|
||||
public function updateValue($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
$this->settings[$key]->updateValue();
|
||||
}
|
||||
|
||||
public function updateValueAll()
|
||||
{
|
||||
foreach ($this->settings as $key => $item) {
|
||||
$item->updateValue();
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteValue($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
$this->settings[$key]->deleteValue();
|
||||
}
|
||||
|
||||
public function deleteValueAll()
|
||||
{
|
||||
foreach ($this->settings as $item) {
|
||||
$item->deleteValue();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws Exception
|
||||
*/
|
||||
private function checkKey($key)
|
||||
{
|
||||
if (!array_key_exists($key, $this->settings)) {
|
||||
throw new Exception("Invalid key `$key`!");
|
||||
}
|
||||
}
|
||||
|
||||
public function getValueStored($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
return $this->settings[$key]->getValueStored();
|
||||
}
|
||||
|
||||
public function getValueWithStored($key)
|
||||
{
|
||||
$this->checkKey($key);
|
||||
|
||||
return $this->settings[$key]->getValueWithStored();
|
||||
}
|
||||
|
||||
public function getChanged()
|
||||
{
|
||||
$changed = [];
|
||||
|
||||
foreach ($this->settings as $key => $setting) {
|
||||
if ($setting->issetValue()) {
|
||||
$changed[$key] = $setting->getValueStored();
|
||||
}
|
||||
}
|
||||
|
||||
return $changed;
|
||||
}
|
||||
}
|
314
retailcrm/lib/settings/RetailcrmSettingsValidator.php
Normal file
@ -0,0 +1,314 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
class RetailcrmSettingsValidator
|
||||
{
|
||||
const LATEST_API_VERSION = '5';
|
||||
|
||||
private $errors;
|
||||
private $warnings;
|
||||
|
||||
/**
|
||||
* @var RetailcrmSettingsItems
|
||||
*/
|
||||
private $settings;
|
||||
/**
|
||||
* @var RetailcrmReferences|null
|
||||
*/
|
||||
private $reference;
|
||||
|
||||
public function __construct(
|
||||
RetailcrmSettingsItems $settings,
|
||||
RetailcrmReferences $reference = null
|
||||
) {
|
||||
$this->settings = $settings;
|
||||
$this->reference = $reference;
|
||||
$this->errors = [];
|
||||
$this->warnings = [];
|
||||
}
|
||||
|
||||
public function getErrors()
|
||||
{
|
||||
return $this->errors;
|
||||
}
|
||||
|
||||
public function getWarnings()
|
||||
{
|
||||
return $this->warnings;
|
||||
}
|
||||
|
||||
public function getSuccess()
|
||||
{
|
||||
return 0 === count($this->errors);
|
||||
}
|
||||
|
||||
/**
|
||||
* Settings form validator
|
||||
*/
|
||||
public function validate()
|
||||
{
|
||||
// check url and apiKey
|
||||
$urlAndApiKeyValidated = true;
|
||||
if ($this->settings->issetValue('url') && !RetailcrmTools::validateCrmAddress($this->settings->getValue('url'))) {
|
||||
$this->addError('errors.url');
|
||||
$urlAndApiKeyValidated = false;
|
||||
}
|
||||
|
||||
if ($this->settings->issetValue('apiKey') && !$this->settings->getValue('apiKey')) {
|
||||
$this->addError('errors.key');
|
||||
$urlAndApiKeyValidated = false;
|
||||
}
|
||||
|
||||
if ($urlAndApiKeyValidated && ($this->settings->issetValue('url') || $this->settings->issetValue('apiKey'))) {
|
||||
if (!$this->validateApiVersion(
|
||||
$this->settings->getValueWithStored('url'),
|
||||
$this->settings->getValueWithStored('apiKey')
|
||||
)
|
||||
) {
|
||||
$this->addError('errors.version');
|
||||
}
|
||||
}
|
||||
|
||||
// check abandoned carts status
|
||||
if ($this->settings->issetValue('status') || $this->settings->issetValue('synchronizedCartStatus')) {
|
||||
if (!$this->validateCartStatus(
|
||||
$this->settings->getValueWithStored('status'),
|
||||
$this->settings->getValueWithStored('synchronizedCartStatus')
|
||||
)
|
||||
) {
|
||||
$this->addError('errors.carts'); // todo check if it works
|
||||
}
|
||||
}
|
||||
|
||||
// check mapping statuses
|
||||
if ($this->settings->issetValue('status')) {
|
||||
if (!$this->validateMappingOneToOne($this->settings->getValue('status'))) {
|
||||
$this->addError('errors.status');
|
||||
}
|
||||
}
|
||||
|
||||
// check mapping delivery
|
||||
if ($this->settings->issetValue('delivery')) {
|
||||
if (!$this->validateMappingOneToOne($this->settings->getValue('delivery'))) {
|
||||
$this->addError('errors.delivery');
|
||||
}
|
||||
}
|
||||
|
||||
// check mapping payment
|
||||
if ($this->settings->issetValue('payment')) {
|
||||
if (!$this->validateMappingOneToOne($this->settings->getValue('payment'))) {
|
||||
$this->addError('errors.payment');
|
||||
}
|
||||
}
|
||||
|
||||
// check collector identifier
|
||||
if ($this->settings->issetValue('collectorActive') || $this->settings->issetValue('collectorKey')) {
|
||||
if (!$this->validateCollector(
|
||||
$this->settings->getValueWithStored('collectorActive'),
|
||||
$this->settings->getValueWithStored('collectorKey')
|
||||
)) {
|
||||
$this->addError('errors.collector');
|
||||
}
|
||||
}
|
||||
|
||||
$errorTabs = $this->validateStoredSettings(); // todo maybe refactor
|
||||
|
||||
if (in_array('delivery', $errorTabs)) {
|
||||
$this->addWarning('warnings.delivery');
|
||||
}
|
||||
if (in_array('status', $errorTabs)) {
|
||||
$this->addWarning('warnings.status');
|
||||
}
|
||||
if (in_array('payment', $errorTabs)) {
|
||||
$this->addWarning('warnings.payment');
|
||||
}
|
||||
if (in_array('deliveryDefault', $errorTabs) || in_array('paymentDefault', $errorTabs)) {
|
||||
$this->addWarning('warnings.default');
|
||||
}
|
||||
|
||||
return $this->getSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* Cart status must be present and must be unique to cartsIds only
|
||||
*
|
||||
* @param string $statuses
|
||||
* @param string $cartStatus
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function validateCartStatus($statuses, $cartStatus)
|
||||
{
|
||||
if (!is_array($statuses)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$statusesList = array_filter(array_values($statuses));
|
||||
|
||||
if (0 === count($statusesList)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if ('' !== $cartStatus && in_array($cartStatus, $statusesList)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns false if mapping is not valid in one-to-one relation
|
||||
*
|
||||
* @param string $statuses
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function validateMappingOneToOne($statuses)
|
||||
{
|
||||
if (!is_array($statuses)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$statusesList = array_filter(array_values($statuses));
|
||||
|
||||
if (count($statusesList) != count(array_unique($statusesList))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public function validateStoredSettings() // todo also uses in settings template to show errors on page load
|
||||
{
|
||||
$tabsWithWarnings = [];
|
||||
$tabsNamesAndCheckApiMethods = [
|
||||
'delivery' => 'getApiDeliveryTypes', // todo check and replace with new functions
|
||||
'status' => 'getApiStatuses',
|
||||
'payment' => 'getApiPaymentTypes',
|
||||
'deliveryDefault' => null,
|
||||
'paymentDefault' => null,
|
||||
];
|
||||
|
||||
foreach ($tabsNamesAndCheckApiMethods as $tabName => $checkApiMethod) {
|
||||
if (!$this->settings->issetValue($tabName)) { // todo remove
|
||||
continue;
|
||||
}
|
||||
|
||||
$storedValues = $this->settings->getValueWithStored($tabName); // todo get encoded value from Tools::
|
||||
|
||||
if (false === $storedValues || null === $storedValues) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!$this->validateMappingSelected($storedValues)) {
|
||||
$tabsWithWarnings[] = $tabName;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
if (null !== $checkApiMethod) {
|
||||
$crmValues = call_user_func([$this->reference, $checkApiMethod]); // todo use class own reference
|
||||
$crmCodes = array_column($crmValues, 'code');
|
||||
|
||||
if (!empty(array_diff($storedValues, $crmCodes))) {
|
||||
$tabsWithWarnings[] = $tabName;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $tabsWithWarnings;
|
||||
}
|
||||
|
||||
private function validateMappingSelected($values)
|
||||
{
|
||||
if (is_array($values)) {
|
||||
foreach ($values as $item) {
|
||||
if (empty($item)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
} elseif (empty($values)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if provided connection supports API v5
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
private function validateApiVersion($url, $apiKey)
|
||||
{
|
||||
/** @var RetailcrmProxy|RetailcrmApiClientV5 $api */
|
||||
$api = new RetailcrmProxy(
|
||||
$url,
|
||||
$apiKey
|
||||
);
|
||||
|
||||
$response = $api->apiVersions();
|
||||
|
||||
if (false !== $response && isset($response['versions']) && !empty($response['versions'])) {
|
||||
foreach ($response['versions'] as $version) {
|
||||
if ($version == static::LATEST_API_VERSION
|
||||
|| Tools::substr($version, 0, 1) == static::LATEST_API_VERSION
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private function validateCollector($collectorActive, $collectorKey)
|
||||
{
|
||||
return !$collectorActive || '' !== $collectorKey;
|
||||
}
|
||||
|
||||
private function addError($message)
|
||||
{
|
||||
$this->errors[] = $message;
|
||||
}
|
||||
|
||||
private function addWarning($message)
|
||||
{
|
||||
$this->warnings[] = $message;
|
||||
}
|
||||
}
|
@ -48,18 +48,6 @@ abstract class RetailcrmAbstractTemplate
|
||||
/** @var array */
|
||||
protected $data;
|
||||
|
||||
/** @var array */
|
||||
private $errors;
|
||||
|
||||
/** @var array */
|
||||
private $warnings;
|
||||
|
||||
/** @var array */
|
||||
private $informations;
|
||||
|
||||
/** @var array */
|
||||
private $confirmations;
|
||||
|
||||
/** @var Context */
|
||||
protected $context;
|
||||
|
||||
@ -75,10 +63,6 @@ abstract class RetailcrmAbstractTemplate
|
||||
$this->module = $module;
|
||||
$this->smarty = $smarty;
|
||||
$this->assets = $assets;
|
||||
$this->errors = [];
|
||||
$this->warnings = [];
|
||||
$this->informations = [];
|
||||
$this->confirmations = [];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -125,72 +109,11 @@ abstract class RetailcrmAbstractTemplate
|
||||
. '&token=' . $this->smarty->getTemplateVars('token');
|
||||
}
|
||||
|
||||
$this->smarty->assign(\array_merge($this->data, [
|
||||
'moduleErrors' => $this->errors,
|
||||
'moduleWarnings' => $this->warnings,
|
||||
'moduleConfirmations' => $this->confirmations,
|
||||
'moduleInfos' => $this->informations,
|
||||
]));
|
||||
$this->smarty->assign($this->data);
|
||||
|
||||
return $this->module->display($file, "views/templates/admin/$this->template");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $messages
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setErrors($messages)
|
||||
{
|
||||
if (!empty($messages)) {
|
||||
$this->errors = $messages;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $messages
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setWarnings($messages)
|
||||
{
|
||||
if (!empty($messages)) {
|
||||
$this->warnings = $messages;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $messages
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setInformations($messages)
|
||||
{
|
||||
if (!empty($messages)) {
|
||||
$this->informations = $messages;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $messages
|
||||
*
|
||||
* @return self
|
||||
*/
|
||||
public function setConfirmations($messages)
|
||||
{
|
||||
if (!empty($messages)) {
|
||||
$this->confirmations = $messages;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $context
|
||||
*
|
||||
|
@ -38,8 +38,15 @@
|
||||
|
||||
class RetailcrmSettingsTemplate extends RetailcrmAbstractTemplate
|
||||
{
|
||||
protected $settings;
|
||||
protected $settingsNames;
|
||||
/**
|
||||
* @var RetailcrmSettingsItems
|
||||
*/
|
||||
private $settings;
|
||||
|
||||
/**
|
||||
* @var RetailcrmSettingsItemHtml
|
||||
*/
|
||||
private $consultantScript;
|
||||
|
||||
/**
|
||||
* RetailcrmSettingsTemplate constructor.
|
||||
@ -47,15 +54,21 @@ class RetailcrmSettingsTemplate extends RetailcrmAbstractTemplate
|
||||
* @param \Module $module
|
||||
* @param $smarty
|
||||
* @param $assets
|
||||
* @param $settings
|
||||
* @param $settingsNames
|
||||
*/
|
||||
public function __construct(Module $module, $smarty, $assets, $settings, $settingsNames)
|
||||
public function __construct(Module $module, $smarty, $assets)
|
||||
{
|
||||
parent::__construct($module, $smarty, $assets);
|
||||
|
||||
$this->settings = $settings;
|
||||
$this->settingsNames = $settingsNames;
|
||||
$this->settings = new RetailcrmSettingsItems();
|
||||
$this->consultantScript = new RetailcrmSettingsItemHtml('consultantScript', RetailCRM::CONSULTANT_SCRIPT);
|
||||
}
|
||||
|
||||
protected function buildParams()
|
||||
{
|
||||
$this->data = [
|
||||
'assets' => $this->assets,
|
||||
'appData' => $this->getParams(),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -65,63 +78,89 @@ class RetailcrmSettingsTemplate extends RetailcrmAbstractTemplate
|
||||
*/
|
||||
protected function getParams()
|
||||
{
|
||||
$params = [];
|
||||
$deliveryTypesCMS = $this->module->reference->getDeliveryTypes();
|
||||
$paymentTypesCMS = $this->module->reference->getSystemPaymentModules();
|
||||
$statusesCMS = $this->module->reference->getStatuses();
|
||||
|
||||
if ($this->module->api) {
|
||||
$params['statusesDefaultExport'] = $this->module->reference->getStatuseDefaultExport();
|
||||
$params['deliveryTypes'] = $this->module->reference->getDeliveryTypes();
|
||||
$params['orderStatuses'] = $this->module->reference->getStatuses();
|
||||
$params['outOfStockStatuses'] = $this->module->reference->getOutOfStockStatuses(
|
||||
[
|
||||
'out_of_stock_paid' => $this->module->translate('If order paid'),
|
||||
'out_of_stock_not_paid' => $this->module->translate('If order not paid'),
|
||||
]
|
||||
);
|
||||
$params['paymentTypes'] = $this->module->reference->getPaymentTypes();
|
||||
$params['methodsForDefault'] = $this->module->reference->getPaymentAndDeliveryForDefault(
|
||||
[
|
||||
$this->module->translate('Delivery method'),
|
||||
$this->module->translate('Payment type'),
|
||||
]
|
||||
);
|
||||
$params['ordersCount'] = RetailcrmExport::getOrdersCount();
|
||||
$params['customersCount'] = RetailcrmExport::getCustomersCount();
|
||||
$params['exportCustomersCount'] = RetailcrmExport::getCustomersCount(false);
|
||||
$params['exportOrdersStepSize'] = RetailcrmExport::RETAILCRM_EXPORT_ORDERS_STEP_SIZE_WEB;
|
||||
$params['exportCustomersStepSize'] = RetailcrmExport::RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE_WEB;
|
||||
$params['lastRunDetails'] = RetailcrmJobManager::getLastRunDetails(true);
|
||||
$params['currentJob'] = Configuration::get(RetailcrmJobManager::CURRENT_TASK);
|
||||
$params['currentJobCli'] = Configuration::get(RetailcrmCli::CURRENT_TASK_CLI);
|
||||
$params['retailcrmLogsInfo'] = RetailcrmLogger::getLogFilesInfo();
|
||||
$params['catalogInfoMultistore'] = RetailcrmCatalogHelper::getIcmlFileInfoMultistore();
|
||||
$params['shopsInfo'] = RetailcrmContextSwitcher::getShops();
|
||||
$params['errorTabs'] = $this->module->validateStoredSettings();
|
||||
$deliveryTypesCRM = $this->module->reference->getApiDeliveryTypes();
|
||||
$paymentTypesCRM = $this->module->reference->getApiPaymentTypes();
|
||||
$statusesCRM = $this->module->reference->getApiStatusesWithGroup();
|
||||
|
||||
$params['retailControllerOrders'] = RetailcrmTools::getAdminControllerUrl(
|
||||
RetailcrmOrdersController::class
|
||||
);
|
||||
$params['retailControllerOrdersUpload'] = RetailcrmTools::getAdminControllerUrl(
|
||||
RetailcrmOrdersUploadController::class
|
||||
);
|
||||
$params['adminControllerOrders'] = RetailcrmTools::getAdminControllerUrl(
|
||||
AdminOrdersController::class
|
||||
);
|
||||
}
|
||||
|
||||
return $params;
|
||||
}
|
||||
|
||||
protected function buildParams()
|
||||
{
|
||||
$this->data = array_merge(
|
||||
[
|
||||
'assets' => $this->assets,
|
||||
'cartsDelays' => $this->module->getSynchronizedCartsTimeSelect(),
|
||||
return [
|
||||
'locale' => $this->getCurrentLanguageISO(),
|
||||
'controller' => [
|
||||
'settings' => RetailcrmTools::getAdminControllerUrl(RetailcrmSettingsController::class),
|
||||
'payments' => RetailcrmTools::getAdminControllerUrl(AdminPaymentPreferencesController::class),
|
||||
'orders' => RetailcrmTools::getAdminControllerUrl(RetailcrmOrdersController::class),
|
||||
'export' => RetailcrmTools::getAdminControllerUrl(RetailcrmExportController::class),
|
||||
'link' => RetailcrmTools::getAdminControllerUrl(AdminOrdersController::class),
|
||||
'jobs' => RetailcrmTools::getAdminControllerUrl(RetailcrmJobsController::class),
|
||||
'logs' => RetailcrmTools::getAdminControllerUrl(RetailcrmLogsController::class),
|
||||
],
|
||||
$this->getParams(),
|
||||
$this->settingsNames,
|
||||
$this->settings
|
||||
);
|
||||
'main' => [
|
||||
'connection' => [
|
||||
'url' => $this->settings->getValueStored('url'),
|
||||
'apiKey' => $this->settings->getValueStored('apiKey'),
|
||||
],
|
||||
'delivery' => [
|
||||
'setting' => $this->settings->getValueStored('delivery'),
|
||||
'cms' => $deliveryTypesCMS,
|
||||
'crm' => $deliveryTypesCRM,
|
||||
],
|
||||
'payment' => [
|
||||
'setting' => $this->settings->getValueStored('payment'),
|
||||
'cms' => $paymentTypesCMS,
|
||||
'crm' => $paymentTypesCRM,
|
||||
],
|
||||
'status' => [
|
||||
'setting' => $this->settings->getValueStored('status'),
|
||||
'cms' => $statusesCMS,
|
||||
'crm' => $statusesCRM,
|
||||
],
|
||||
],
|
||||
'additional' => [
|
||||
'settings' => [
|
||||
'corporate' => $this->settings->getValueStored('enableCorporate'),
|
||||
'numberSend' => $this->settings->getValueStored('enableOrderNumberSending'),
|
||||
'numberReceive' => $this->settings->getValueStored('enableOrderNumberReceiving'),
|
||||
'webJobs' => $this->settings->getValueStored('webJobs'),
|
||||
'debug' => $this->settings->getValueStored('debugMode'),
|
||||
],
|
||||
'history' => [
|
||||
'enabled' => $this->settings->getValueStored('enableHistoryUploads'),
|
||||
'deliveryDefault' => $this->settings->getValueStored('deliveryDefault'),
|
||||
'paymentDefault' => $this->settings->getValueStored('paymentDefault'),
|
||||
'delivery' => $deliveryTypesCMS,
|
||||
'payment' => $paymentTypesCMS,
|
||||
],
|
||||
'stocks' => [
|
||||
'enabled' => $this->settings->getValueStored('enableBalancesReceiving'),
|
||||
'statuses' => $this->settings->getValueStored('outOfStockStatus'),
|
||||
],
|
||||
'carts' => [
|
||||
'synchronizeCartsActive' => $this->settings->getValueStored('synchronizeCartsActive'),
|
||||
'synchronizedCartStatus' => $this->settings->getValueStored('synchronizedCartStatus'),
|
||||
'synchronizedCartDelay' => $this->settings->getValueStored('synchronizedCartDelay'),
|
||||
'delays' => RetailcrmSettingsHelper::getCartDelays(),
|
||||
],
|
||||
'collector' => [
|
||||
'collectorActive' => $this->settings->getValueStored('collectorActive'),
|
||||
'collectorKey' => $this->settings->getValueStored('collectorKey'),
|
||||
],
|
||||
'consultant' => [
|
||||
'consultantScript' => $this->consultantScript->getValueStored(),
|
||||
],
|
||||
],
|
||||
'catalog' => [
|
||||
'info' => RetailcrmSettingsHelper::getIcmlFileInfo(),
|
||||
'generateName' => RetailcrmIcmlEvent::class,
|
||||
'updateURLName' => RetailcrmIcmlUpdateUrlEvent::class,
|
||||
],
|
||||
'advanced' => [
|
||||
'jobs' => RetailcrmSettingsHelper::getJobsInfo(),
|
||||
'logs' => RetailcrmSettingsHelper::getLogFilesInfo(),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,6 +168,6 @@ class RetailcrmSettingsTemplate extends RetailcrmAbstractTemplate
|
||||
*/
|
||||
protected function setTemplate()
|
||||
{
|
||||
$this->template = 'settings.tpl';
|
||||
$this->template = 'index.tpl';
|
||||
}
|
||||
}
|
||||
|
@ -60,12 +60,6 @@ class RetailcrmTemplateFactory
|
||||
*/
|
||||
public function createTemplate(Module $module)
|
||||
{
|
||||
$settings = RetailCRM::getSettings();
|
||||
|
||||
if (empty($settings['url']) && empty($settings['apiKey'])) {
|
||||
return new RetailcrmBaseTemplate($module, $this->smarty, $this->assets);
|
||||
} else {
|
||||
return new RetailcrmSettingsTemplate($module, $this->smarty, $this->assets, $settings, RetailCRM::getSettingsNames());
|
||||
}
|
||||
return new RetailcrmSettingsTemplate($module, $this->smarty, $this->assets);
|
||||
}
|
||||
}
|
||||
|
@ -41,171 +41,3 @@ $_MODULE = [];
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9b1e2d4b35252401dbdab3cbad2735c4'] = 'Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_5e36a81536959d8cde52246dd15a6fca'] = 'Módulo de integración para Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_876f23178c29dc2552c0b48bf23cd9bd'] = '¿Está seguro de que desea eliminar el módulo?';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_5e66ee98e79567f8daf9454b5517f819'] = 'Se debe especificar al menos un ID de pedido';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_6bd461d1fc51b3294c6513cecc24758d'] = 'Los pedidos han sido cargados con éxito';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9a7fc06b4b2359f1f26f75fbbe27a3e8'] = 'No todos los pedidos se han cargado con existo';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_e7244a5e543ba692ebc495aee934ee9b'] = 'Orden omitida por inexistencia: %s';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_474b50f70e008454f1f2bf0d63f5262a'] = 'se completó con éxito';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_7f3df1b66ce2d61ae3d31c97ac08b065'] = 'no fue ejecutado';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_8bc2706bb353ba02b05135127122e406'] = 'se completó con errores ';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_b9b2d9f66d0112f3aae7dbdbd4e22a43'] = 'La dirección del CRM es incorrecta o está vacía';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_942010ef43f3fec28741f62a0d9ff29c'] = 'La clave CRM es incorrecta o está vacía';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_1bd340aeb42a5ee0318784c2cffed8a9'] = 'La versión seleccionada de la API no está disponible';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_b9c4e8fe56eabcc4c7913ebb2f8eb388'] = 'Estado del pedido para carritos abandonados no debe ser utilizado en otros ajustes';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_39e90036af004a005ccbccbe9a9c19c2'] = 'Los estados de orden no deben repetirse en la matriz de estados';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_a52213fa61ecf700d1a6091d9769c9a8'] = 'Los tipos de entrega no deben repetirse en la matriz de entrega';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_f08acd4b354f4d5f4e531ca1972e4504'] = 'Los tipos de pago no deben repetirse en la matriz de pagos';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_49910de3587b1c6141c03f65ef26b334'] = 'Seleccionar valores para todos los tipos de envío';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_220b6b5418e80a7f86b0ce9fbdd96bb0'] = 'Seleccionar valores para todos los estados de los pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_10f66d6041a2b944b446b6ca02f7f4f3'] = 'Seleccionar valores para todos los tipos de pago';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_1bf0b3775f120ff1991773064903e8b1'] = 'Seleccionar valores para todos los parámetros predeterminados';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_d5bb7c2cb1565fb1568924b01847b330'] = 'Tras 15 minutos';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9d3095e54f694bb41ef4a3e62ed90e7a'] = 'Tras 30 minutos';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_dfb403fd86851c7d9f97706dff5a2327'] = 'Tras 45 minutos';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_4b5e6470d5d85448fcd89c828352d25e'] = 'Tras 1 hora';
|
||||
$_MODULE['<{retailcrm}prestashop>index_dd259436b3f29f0ba1778d220b343ec9'] = 'Simla.com es un servicio para tiendas online, el cual ayuda a dejar de perder pedidos y así mejorar las ganancias de tu comercio online en todas las etapas del embudo de ventas.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_c7476a92e20715b855d72b1786a71017'] = 'Tengo una cuenta en Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e81c4e4f2b7b93b481e13a8553c2ae1b'] = 'o';
|
||||
$_MODULE['<{retailcrm}prestashop>index_560cb0d630a0067860713ce68126e777'] = 'Obtenga Simla.com gratis';
|
||||
$_MODULE['<{retailcrm}prestashop>index_061b368c43f85d3fe2c7ccc842883a40'] = 'Configuración de la conexión';
|
||||
$_MODULE['<{retailcrm}prestashop>index_22a65bd0ef1919aa4e6dee849a7a2925'] = 'URL de Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_656a6828d7ef1bb791e42087c4b5ee6e'] = 'Accesos API Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar';
|
||||
$_MODULE['<{retailcrm}prestashop>index_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Descripción';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9aa698f602b1e5694855cee73a683488'] = 'Contactos';
|
||||
$_MODULE['<{retailcrm}prestashop>index_764fa884e3fba8a3f40422aa1eadde23'] = 'Deja de perder pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>index_070f41773a46ce08231e11316603a099'] = 'Livechat es una forma activa de incitar al diálogo que inmediatamente te ayuda a recibir más pedidos en la tienda online.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_87ef6941837db5b2370eb2c04a2f9e73'] = 'Chatbot, Facebook Messenger y WhatsApp en una misma ventana, te ayudan a no perder leads “frescos” que están a punto de hacer su pedido.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_0e307da9d0c9ee16b47ef71c39f236a3'] = 'Emails de bienvenida te ayudarán a motivar a los clientes a realizar su primer pedido.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e83c1eb5df794bf22e69eb893e80fdd6'] = 'Motivar a concretar la compra';
|
||||
$_MODULE['<{retailcrm}prestashop>index_456329795d41ba012fc4fb3ed063d1fe'] = 'Upsells es la mejor opción para mejorar el ticket medio de manera automática.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4ab044d4168a44dbe50ecc01181e81ad'] = 'La gestión de carritos abandonados incrementa la cantidad de pedidos completados en la tienda online.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_0f93ca5bf76e978aa9162e7fc53897ea'] = 'Gestiona los pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>index_3efd2720a5c93a8fe785084d925024ce'] = 'Con ayuda del CRM podrás recibir pedidos, distribuirlos entre tus empleados, controlar los estados y cerrarlos.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_8823fb21e79cd316df376e80bb635329'] = 'Las notificaciones sobre el cambio de estado de cada pedido te ayuda a mantener a los clientes informados sobre sus pedidos.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2280ad04ce9fc872f86e839265f170a2'] = 'SalesApp es una aplicación para puntos de venta, la cual te ayudará a mejorar las ventas offline y a crear una base de clientes en un mismo sistema.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9f1ddb1081aee21a39383a5be24e6c78'] = 'La integración con el catálogo permite controlar el stock de tus productos, los precios y sus movimientos.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_94d467d04e7d7b0c92df78f3de00fb20'] = 'Retén a tus actuales clientes';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7f5875d2c134ba80d0ae9a5b51b2a805'] = 'CDP (Customer Data Platform) agrupa toda la información de tus clientes desde distintos canales y crea un perfil 360° de cada uno de ellos.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2708fc15917156fafb712217dcebdab5'] = 'La segmentación de la base de clientes te ayuda a hacer la comunicación con tus clientes más relevante y precisa.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_d2d8dd2103f64290845f5635ce185270'] = 'Las campañas de mailing, SMS, WhatsApp y Facebook Messenger incrementarán la frecuencia de compra de tus clientes actuales.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_b0e12648f812bedb79fe86c8f66cec8a'] = 'La regla “Productos de consumo regular” te ayuda a recordarle a tus clientes para que vuelvan a hacer la compra antes de que se les agoten sus productos.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_02f67e7fb237e6fa9eb746fa0f721e96'] = 'Reanima a clientes inactivos';
|
||||
$_MODULE['<{retailcrm}prestashop>index_68cd6fde983ce8c8eb0966bed76e7062'] = 'Con ayuda de retargeting en el Simla.com podrás iniciar campañas utilizando los segmentos de tu base de clientes.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9f8f75ffd4d9e4f326576dfdc5570739'] = 'Las visitas con abandono te permiten registrar los productos que el cliente estaba viendo, así podrás proponerle completar su pedido.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_f78799eda5746aebce16dfbc6c824b71'] = 'Las campañas para reactivar clientes te ayudarán a recuperar a aquellos que se habían perdido y así lograr que vuelvan a tu tienda online.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7ac9b002ef2ce5608af086be3ad5f64f'] = 'Simla.com mejorará la efectividad de todos tus canales de marketing';
|
||||
$_MODULE['<{retailcrm}prestashop>index_17b39a0118f63cf041abfb9d92d12414'] = 'LiveChat';
|
||||
$_MODULE['<{retailcrm}prestashop>index_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email';
|
||||
$_MODULE['<{retailcrm}prestashop>index_31f803c0e3b881bf2fc62b248c8aaace'] = 'Facebook Messenger';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4cecb21b44628b17c436739bf6301af2'] = 'SMS';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2ca3885b024c5983c60a69c6af0ecd28'] = 'Retargeting';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9d4f613c288a9cf21d59cc45f1d3dc2c'] = '¿Hay un trial del módulo?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_cb3df13bcaec7d592664184af4e7ced0'] = 'El módulo cuenta con una versión trial de 14 días en los cuales podrás trabajar con ayuda del módulo de Simla.com.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_3b15dabe24b3ea13a55b08ca7abf1a94'] = '¿Qué es un usuario?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_374f84fbbde8e4a44f7e14ec12674ca7'] = 'Un usuario es la persona que trabajará con el módulo de Simla.com es como el representante de tu negocio o tu web. Cada usuario puede crear un perfil personal y tener su propio acceso al panel de la herramienta.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_65991f2dd292e02d64d248906dfe0f40'] = '¿En qué idiomas está disponible el módulo?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_541564ed7677523fa5c81aa6fdcc02b8'] = 'El módulo de Simla.com está disponible en los siguientes idiomas:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_cb5480c32e71778852b08ae1e8712775'] = 'Español';
|
||||
$_MODULE['<{retailcrm}prestashop>index_78463a384a5aa4fad5fa73e2f506ecfc'] = 'Inglés';
|
||||
$_MODULE['<{retailcrm}prestashop>index_deba6920e70615401385fe1fb5a379ec'] = 'Ruso';
|
||||
$_MODULE['<{retailcrm}prestashop>index_59064b34ae482528c8dbeb1b0214ee12'] = '¿Cuánto tiempo dura el trial?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_bcb8d16b6e37b22faead6f49af88f26c'] = 'El tiempo de duración de la versión trial del módulo de Simla.com es de 14 días.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_d8ff508a2fce371d8c36bd2bedbaecf6'] = '¿Se paga por usuario o se paga por cuenta?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_83289ea1e091eba31c6b9d152381b285'] = 'El pago se realiza por usuario, si se agrega a otro usuario dentro del sistema de Simla.com se realizaría el pago por dos usuarios. Cada usuario tiene derecho a una cuenta (web-chat y redes sociales). En caso de que un usuario necesite trabajar con más de una cuenta, es necesario ponerse en contacto con el equipo de Simla.com.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_a833bd40df33cff491112eb9316fb050'] = '¿Cómo puedo realizar el pago?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4889fefd090fe608a9b5403d02e2e97f'] = 'Los métodos para realizar el pago son:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_95428f32e5c696cf71baccb776bc5c15'] = 'Transferencia bancaria';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e7f9e382dc50889098cbe56f2554c77b'] = 'Tarjeta bancaria';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7088f1d1d9c91d8b75e9882ffd78540c'] = 'Datos de contacto';
|
||||
$_MODULE['<{retailcrm}prestashop>index_50f158e2507321f1a5b6f8fb9e350818'] = 'Escríbenos en caso de preguntas o dudas';
|
||||
$_MODULE['<{retailcrm}prestashop>module_translates_2207b29a762b5d7798e9794cad24f518'] = 'No se encontraron pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>module_translates_79b5ffb5b4868e9fc8b6c6e3efafd416'] = 'Ocurrió un error al buscar los pedidos. Inténtalo de nuevo';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_2b65c584b7b4d7bd19d36f7d2b690c6a'] = 'Catálogo Icml';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c2cc7082a89c1ad6631a2f66af5f00c0'] = 'Conexión';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_065ab3a28ca4f16f55f103adc7d0226f'] = 'Los métodos del envío';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_33af8066d3c83110d4bd897f687cedd2'] = 'Los estados de pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_bab959acc06bb03897b294fbb892be6b'] = 'Los métodos de pago';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7a1920d61156abc05a60135aefe8bc67'] = 'Por defecto';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_27ce7f8b5623b2e2df568d64cf051607'] = 'Existencias';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_20cacc01d0de8bc6e9c9846f477e886b'] = 'Subir pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6bcde6286f8d1b76063ee52104a240cf'] = 'Carritos abandonados';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_52a13123e134b8b72b6299bc14a36aad'] = 'Daemon Collector';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_71098155ccc0a0d6e0b501fbee37e7a9'] = 'LiveChat';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9b6545e4cea9b4ad4979d41bb9170e2b'] = 'Avanzado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_061b368c43f85d3fe2c7ccc842883a40'] = 'La configuración de la conexión';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_22a65bd0ef1919aa4e6dee849a7a2925'] = 'Simla.com URL';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_656a6828d7ef1bb791e42087c4b5ee6e'] = 'API key';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_8ffa3281a35a0d80fef2cac0fa680523'] = 'Habilitar la carga del historial';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4049d979b8e6b7d78194e96c3208a5a5'] = 'Número de orden';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c95783013e3707fd4f0fd316133fdd1f'] = 'Envíe el número de pedido a Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4b60f9716ab3c3fb83260caafd46c55d'] = 'Reciba el número de pedido de Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6b49e7ceb026c3d16264e01b9b919ce3'] = 'Clientes corporativos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f8d7c52aa84f358caedb96fda86809da'] = 'Permitir el soporte a clientes corporativos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6c3c1845e109a9ef67378effea0c0503'] = 'Activar solo si está habilitada la opción \"Clientes corporativos\" en Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_917afe348e09163269225a89a825e634'] = 'Sincronización de carritos de compradores';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_d8e002d770b6f98af7b7ae9a0e5acfe9'] = 'Crear pedidos para carritos abandonados de compradores';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_35b5a9139a54caeb925556ceb2c38086'] = 'Estado del pedido para carritos abandonados de compradores';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9b9cf9f8778f69b4c6cf37e66f886be8'] = 'Elige el estado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a0d135501a738c3c98de385dc28cda61'] = 'Cargar carritos abandonados';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_27096e1243f98e1b3300f57ff1c76456'] = 'Elige la demora';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f0135b33ac1799cfcb7dbe03265a8aa8'] = 'Administrar configuración de las tiendas';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_1f8246b1e6ada8897902eff8d8cd8f35'] = 'está desactualizado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5b55e5aeb08a372d36f7e4b7b35d1cd1'] = 'URL del catalogo Icml en Prestashop y en %s no coinciden';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_06aa6fa8bdc2078e7e1bd903e70c8f6a'] = 'esta conectado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7892a1894478824c07b62af2df839291'] = 'Más de 7 días';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_8277e0910d750195b448797616e091ad'] = 'd';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_2510c39011c5be704182423e3a695e91'] = 'h';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_d8bd79cc131920d5de426f914d17405a'] = 'min';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_3baa7e02e09dba2ba2a188a7c9a055cb'] = 'pasado desde la última ejecución';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_068f80c7519d0528fb08e82137a72131'] = 'Productos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9461bed8b71377318436990e57106729'] = 'Ofertas';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_64ef97a8fe9db8b672287a53c5d836f2'] = 'aún no se generó';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_79c07dbacf542d283944685e1538a1bb'] = 'Presione el botón de abajo para generar el %s';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4a15f35e8d386dd1d96faa83c1e44a22'] = 'Actualizar URL';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_cc84d5b49b62c0959f1af64bffaec3b7'] = 'Generar ahora';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4e537de8dd108eafec4c37603c8ab7fb'] = 'Administrar tipos de entrega';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5b385947acf10ac0c5521161ce96aaa7'] = 'Elige la entrega';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c0fd6d31d096a5845f1d1abb4c132b7d'] = 'Administrar estados de pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_dd53d9b3603b3279b25c74f6f3f189a4'] = 'Administrar tipos de pago';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7dcc1208fa03381346955c6732d9ea85'] = 'Elige el tipo';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a54a0e8a7a80b58ce5f8e2ef344bbf95'] = 'Configuración de existencias';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_65dd9f6e8bf4eaf54c3dc96f011dade1'] = 'Recibir las existencias del Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b55197a49e8c4cd8c314bc2aa39d6feb'] = 'Agotado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4c271a7beaf103049443085ccab1f03f'] = 'Cambio de estado del pedido si el producto está agotado y se deniega su pedido con stock cero.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Active';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f75d8fa5c89351544d372cf90528ccf2'] = 'Clave de la página web';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Guardar';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6f1f9a3e435963417d08849fbef139c1'] = 'Ingrese los ID de los pedidos para cargar en Simla.com, divididos por una coma. También puede especificar rangos, como \"1-10\". Se permite subir hasta 10 pedidos a la vez.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_acfa058ec9e6e4745eddc0cae3f0f881'] = 'Identificador del pedido';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_91412465ea9169dfd901dd5e7c96dd99'] = 'Subir';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_418faff1c9df0d297ff586ac3230be97'] = 'Puede exportar todos los pedidos y clientes de CMS a Simla.com presionando el botón \"Exportar\". Este proceso puede llevar mucho tiempo y es necesario que mantenga la pestaña abierta hasta que termine.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Clientes';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f8f36c02fa6f370808135c66cfc788aa'] = 'Clientes sin pedidos';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0095a9fa74d1713e43e370a7d7846224'] = 'Exportar';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_51348d86bbb5ef9d37b0cc340bcafd2d'] = 'Pedidos cargados';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7db8c329e031289c4bee5dc9628fbef7'] = 'En esta sección puede comprobar los resultados de exportación de pedidos y el pedido de carga manual a';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_13348442cc6a27032d2b4aa28b75a5d3'] = 'Buscar';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Todo';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_fe8d588f340d7507265417633ccff16e'] = 'Subido';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Error';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_da9c83250288c94613605b535c26c648'] = 'Fecha y Hora';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0b7fa7fc169b7d50df4dbe2303bfd201'] = 'ID en';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_ec53a8c4f07baed5d8825072c89799be'] = 'Estado';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4f18e3f1c9941a6ec5a38bc716c521b4'] = 'Código que necesita insertar en la web';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_ec3028a12402ab7f43962a6f3a667b6e'] = 'Modo de depuración';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5465108dc7fdda5c9ee8f00136bbaa61'] = 'Web Jobs';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9082f68bc90113d8950e4ed7fe8fa0a4'] = 'Administrador de tareas';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9194de58ce560c095f02cefc1c1c61e6'] = 'Nombre de la tarea';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_05a3a24340b7b9cc8d4e08f0ef4f4dd9'] = 'Última ejecución';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0be8406951cdfda82f00f79328cf4efc'] = 'Comentario';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_fe5b6cd4d7a31615bbec8d1505089d87'] = 'StackTrace';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_48b516cc37de64527a42da11c35d3ddc'] = 'Reset jobs';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b2d37ae1cedf42ff874289b721860af2'] = 'Registros';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_34082694d21dbdcfc31e6e32d9fb2b9f'] = 'Nombre del archivo';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a4b7f1864cfdb47cd05b54eb10337506'] = 'Fecha de modificación';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6f6cb72d544962fa333e2e34ce64f719'] = 'Tamaño';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_06df33001c1d7187fdd81ea1f5b277aa'] = 'Comportamiento';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Descargar';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_61b0ada67b7f40bf3d40dcc88ae4f3e6'] = 'Descargar todo';
|
||||
|
@ -41,171 +41,3 @@ $_MODULE = [];
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9b1e2d4b35252401dbdab3cbad2735c4'] = 'Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_5e36a81536959d8cde52246dd15a6fca'] = 'Интеграционный модуль для Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_876f23178c29dc2552c0b48bf23cd9bd'] = 'Вы уверены, что хотите удалить модуль?';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_5e66ee98e79567f8daf9454b5517f819'] = 'Укажите хотя бы один идентификатор заказа';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_6bd461d1fc51b3294c6513cecc24758d'] = 'Все заказы успешно загружены';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9a7fc06b4b2359f1f26f75fbbe27a3e8'] = 'Не все заказы загружены успешно';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_e7244a5e543ba692ebc495aee934ee9b'] = 'Заказы не найдены и пропущены: %s';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_474b50f70e008454f1f2bf0d63f5262a'] = 'завершена успешно';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_7f3df1b66ce2d61ae3d31c97ac08b065'] = 'не была запущена';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_8bc2706bb353ba02b05135127122e406'] = 'завершена с ошибками';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_b9b2d9f66d0112f3aae7dbdbd4e22a43'] = 'Некорректный или пустой адрес CRM';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_942010ef43f3fec28741f62a0d9ff29c'] = 'Некорректный или пустой ключ CRM';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_1bd340aeb42a5ee0318784c2cffed8a9'] = 'Выбранная версия API недоступна';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_b9c4e8fe56eabcc4c7913ebb2f8eb388'] = 'Статус заказа для брошенных корзин не должен использоваться в других настройках';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_39e90036af004a005ccbccbe9a9c19c2'] = 'Статусы заказов не должны повторяться в матрице соответствий статусов';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_a52213fa61ecf700d1a6091d9769c9a8'] = 'Типы доставок не должны повторяться в матрице соответствий типов доставок';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_f08acd4b354f4d5f4e531ca1972e4504'] = 'Способы оплат не должны повторяться в матрице соответствий способов оплат';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_49910de3587b1c6141c03f65ef26b334'] = 'Выберите соответствия для всех типов доставки';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_220b6b5418e80a7f86b0ce9fbdd96bb0'] = 'Выберите соответствия для всех статусов заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_10f66d6041a2b944b446b6ca02f7f4f3'] = 'Выберите соответствия для всех типов оплаты';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_1bf0b3775f120ff1991773064903e8b1'] = 'Выберите соответствия для всех параметров по умолчанию';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_d5bb7c2cb1565fb1568924b01847b330'] = 'Через 15 минут';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_9d3095e54f694bb41ef4a3e62ed90e7a'] = 'Через 30 минут';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_dfb403fd86851c7d9f97706dff5a2327'] = 'Через 45 минут';
|
||||
$_MODULE['<{retailcrm}prestashop>retailcrm_4b5e6470d5d85448fcd89c828352d25e'] = 'Через 1 час';
|
||||
$_MODULE['<{retailcrm}prestashop>index_dd259436b3f29f0ba1778d220b343ec9'] = 'Simla.com — сервис для интернет магазинов, который поможет перестать терять заказы и увеличить доход на всех этапах воронки.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_c7476a92e20715b855d72b1786a71017'] = 'У меня уже есть аккаунт Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e81c4e4f2b7b93b481e13a8553c2ae1b'] = 'или';
|
||||
$_MODULE['<{retailcrm}prestashop>index_560cb0d630a0067860713ce68126e777'] = 'Получить Simla.com бесплатно';
|
||||
$_MODULE['<{retailcrm}prestashop>index_061b368c43f85d3fe2c7ccc842883a40'] = 'Настройка соединения';
|
||||
$_MODULE['<{retailcrm}prestashop>index_22a65bd0ef1919aa4e6dee849a7a2925'] = 'URL адрес Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_656a6828d7ef1bb791e42087c4b5ee6e'] = 'API ключ Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_c9cc8cce247e49bae79f15173ce97354'] = 'Сохранить';
|
||||
$_MODULE['<{retailcrm}prestashop>index_b5a7adde1af5c87d7fd797b6245c2a39'] = 'Описание';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9aa698f602b1e5694855cee73a683488'] = 'Контакты';
|
||||
$_MODULE['<{retailcrm}prestashop>index_764fa884e3fba8a3f40422aa1eadde23'] = 'Перестаньте терять лиды:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_070f41773a46ce08231e11316603a099'] = 'LiveChat с активным вовлечением, поможет получить больше заказов с сайта';
|
||||
$_MODULE['<{retailcrm}prestashop>index_87ef6941837db5b2370eb2c04a2f9e73'] = 'Чат-боты и единый Inbox для Facebook Messengers и WhatsApp помогут перестать терять горячих лидов, готовых вот-вот купить';
|
||||
$_MODULE['<{retailcrm}prestashop>index_0e307da9d0c9ee16b47ef71c39f236a3'] = 'Welcome-цепочки прогреют ваши лиды и подтолкнут их к первой покупке.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e83c1eb5df794bf22e69eb893e80fdd6'] = 'Доводите заказы до оплаты:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_456329795d41ba012fc4fb3ed063d1fe'] = 'Допродажи увеличат средний чек ваших заказов в автоматическом режиме';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4ab044d4168a44dbe50ecc01181e81ad'] = 'Сценарий Брошенная корзина повысит количество оплаченных заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>index_0f93ca5bf76e978aa9162e7fc53897ea'] = 'Управляйте выполнением заказа:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_3efd2720a5c93a8fe785084d925024ce'] = 'CRM-система поможет получать заказы, распределять их между сотрудниками, управлять их статусами и выполнять их';
|
||||
$_MODULE['<{retailcrm}prestashop>index_8823fb21e79cd316df376e80bb635329'] = 'Уведомления о статусе заказа помогут автоматически информировать клиента о том, что происходит с его заказом';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2280ad04ce9fc872f86e839265f170a2'] = 'SalesApp — приложение для розничных точек, которое поможет повысить продажи в офлайне и собрать клиенсткую базу в единой системе';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9f1ddb1081aee21a39383a5be24e6c78'] = 'Интеграция с каталогом поможет учитывать остатки, цены и местонахождение товаров';
|
||||
$_MODULE['<{retailcrm}prestashop>index_94d467d04e7d7b0c92df78f3de00fb20'] = 'Удерживайте ваших текущих клиентов:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7f5875d2c134ba80d0ae9a5b51b2a805'] = 'CDP объединит данные ваших клиентов из разных источников и построит профиль 360°';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2708fc15917156fafb712217dcebdab5'] = 'Сегменты помогут разделить вашу базу на небольшие группы, чтобы сделать ваши коммуникации релевантнее';
|
||||
$_MODULE['<{retailcrm}prestashop>index_d2d8dd2103f64290845f5635ce185270'] = 'Рассылки в Email, SMS, WhatsApp и Facebook Messenger увеличат частоту покупок вашей клиентской базы';
|
||||
$_MODULE['<{retailcrm}prestashop>index_b0e12648f812bedb79fe86c8f66cec8a'] = 'Сценарий \"Товары расходники\" поможет автоматически напоминать о необходимости пополнить запасы';
|
||||
$_MODULE['<{retailcrm}prestashop>index_02f67e7fb237e6fa9eb746fa0f721e96'] = 'Возвращайте ушедших клиентов:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_68cd6fde983ce8c8eb0966bed76e7062'] = 'CRM-ремаркетинг поможет запускать рекламу, используя сегменты из Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9f8f75ffd4d9e4f326576dfdc5570739'] = 'Брошенный просмотр сохранит товары, которые клиент смотрел на сайте и предложит оплатить их';
|
||||
$_MODULE['<{retailcrm}prestashop>index_f78799eda5746aebce16dfbc6c824b71'] = 'Реактивационные кампании будут возвращать потерянных клиентов обратно в ваш магазин';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7ac9b002ef2ce5608af086be3ad5f64f'] = 'Simla.com повысит эффективность всех ваших маркетинговых каналов:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_17b39a0118f63cf041abfb9d92d12414'] = 'LiveChat';
|
||||
$_MODULE['<{retailcrm}prestashop>index_ce8ae9da5b7cd6c3df2929543a9af92d'] = 'Email';
|
||||
$_MODULE['<{retailcrm}prestashop>index_31f803c0e3b881bf2fc62b248c8aaace'] = 'Facebook Messenger';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4cecb21b44628b17c436739bf6301af2'] = 'SMS';
|
||||
$_MODULE['<{retailcrm}prestashop>index_2ca3885b024c5983c60a69c6af0ecd28'] = 'Ретаргетинг';
|
||||
$_MODULE['<{retailcrm}prestashop>index_9d4f613c288a9cf21d59cc45f1d3dc2c'] = 'Существует ли ознакомительный период?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_cb3df13bcaec7d592664184af4e7ced0'] = 'Да. Существует 14-дневный ознакомительный период в рамках которого Вы можете ознакомиться с возможностями Simla.com.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_3b15dabe24b3ea13a55b08ca7abf1a94'] = 'Кто такой пользователь?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_374f84fbbde8e4a44f7e14ec12674ca7'] = 'Пользователь - это сотрудник, который имеет доступ к Simla.com в качестве представителя Вашего бизнеса или в качестве пользователя Вашего веб-сайта. Каждый пользователь имеет свой доступ к аккаунту Simla.com.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_65991f2dd292e02d64d248906dfe0f40'] = 'Какие языки доступны в модуле?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_541564ed7677523fa5c81aa6fdcc02b8'] = 'Модуль Simla.com переведён на следующие языки:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_cb5480c32e71778852b08ae1e8712775'] = 'Испанский';
|
||||
$_MODULE['<{retailcrm}prestashop>index_78463a384a5aa4fad5fa73e2f506ecfc'] = 'Английский';
|
||||
$_MODULE['<{retailcrm}prestashop>index_deba6920e70615401385fe1fb5a379ec'] = 'Русский';
|
||||
$_MODULE['<{retailcrm}prestashop>index_59064b34ae482528c8dbeb1b0214ee12'] = 'Как долго длится ознакомительный режим?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_bcb8d16b6e37b22faead6f49af88f26c'] = 'Длительность пробного режима составляет 14 дней.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_d8ff508a2fce371d8c36bd2bedbaecf6'] = 'Оплата производится за пользователя или за аккаунт?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_83289ea1e091eba31c6b9d152381b285'] = 'Оплата осуществляется за каждого пользователя. Если в систему будет добавлен новый пользователь за него так же будет взыматься оплата. Каждый пользователь имеет доступ к функциям онлайн-чата и социальных сетей. Если Вам нужен дополнительный аккаунт обратитесь к команде Simla.com.';
|
||||
$_MODULE['<{retailcrm}prestashop>index_a833bd40df33cff491112eb9316fb050'] = 'Как я могу оплатить?';
|
||||
$_MODULE['<{retailcrm}prestashop>index_4889fefd090fe608a9b5403d02e2e97f'] = 'Оплатить можно следующими способами:';
|
||||
$_MODULE['<{retailcrm}prestashop>index_95428f32e5c696cf71baccb776bc5c15'] = 'Банковским переводом';
|
||||
$_MODULE['<{retailcrm}prestashop>index_e7f9e382dc50889098cbe56f2554c77b'] = 'Кредитной картой';
|
||||
$_MODULE['<{retailcrm}prestashop>index_7088f1d1d9c91d8b75e9882ffd78540c'] = 'Наши контакты';
|
||||
$_MODULE['<{retailcrm}prestashop>index_50f158e2507321f1a5b6f8fb9e350818'] = 'Пишите нам если у Вас есть вопросы';
|
||||
$_MODULE['<{retailcrm}prestashop>module_translates_2207b29a762b5d7798e9794cad24f518'] = 'Заказы не найдены';
|
||||
$_MODULE['<{retailcrm}prestashop>module_translates_79b5ffb5b4868e9fc8b6c6e3efafd416'] = 'Возникла ошибка при попытке поиска заказов. Попробуйте еще раз';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_2b65c584b7b4d7bd19d36f7d2b690c6a'] = 'Каталог Icml';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c2cc7082a89c1ad6631a2f66af5f00c0'] = 'Соединение';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_065ab3a28ca4f16f55f103adc7d0226f'] = 'Способы доставки';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_33af8066d3c83110d4bd897f687cedd2'] = 'Статусы заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_bab959acc06bb03897b294fbb892be6b'] = 'Способы оплаты';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7a1920d61156abc05a60135aefe8bc67'] = 'По умолчанию';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_27ce7f8b5623b2e2df568d64cf051607'] = 'Остатки';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_20cacc01d0de8bc6e9c9846f477e886b'] = 'Выгрузка заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6bcde6286f8d1b76063ee52104a240cf'] = 'Брошенные корзины';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_52a13123e134b8b72b6299bc14a36aad'] = 'Daemon Collector';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_71098155ccc0a0d6e0b501fbee37e7a9'] = 'Онлайн-консультант';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9b6545e4cea9b4ad4979d41bb9170e2b'] = 'Дополнительно';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_061b368c43f85d3fe2c7ccc842883a40'] = 'Настройка соединения';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_22a65bd0ef1919aa4e6dee849a7a2925'] = 'URL адрес Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_656a6828d7ef1bb791e42087c4b5ee6e'] = 'API-ключ';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_8ffa3281a35a0d80fef2cac0fa680523'] = 'Включить выгрузку истории';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4049d979b8e6b7d78194e96c3208a5a5'] = 'Номер заказа';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c95783013e3707fd4f0fd316133fdd1f'] = 'Передавать номер заказа в Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4b60f9716ab3c3fb83260caafd46c55d'] = 'Получать номер заказа из Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6b49e7ceb026c3d16264e01b9b919ce3'] = 'Корпоративные клиенты';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f8d7c52aa84f358caedb96fda86809da'] = 'Включить поддержку корпоративных клиентов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6c3c1845e109a9ef67378effea0c0503'] = 'Активировать только при включенной опции \"Корпоративные клиенты\" в Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_917afe348e09163269225a89a825e634'] = 'Синхронизация корзин покупателей';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_d8e002d770b6f98af7b7ae9a0e5acfe9'] = 'Создавать заказы для брошенных корзин покупателей';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_35b5a9139a54caeb925556ceb2c38086'] = 'Статус заказа для брошенных корзин покупателей';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9b9cf9f8778f69b4c6cf37e66f886be8'] = 'Выберите статус';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a0d135501a738c3c98de385dc28cda61'] = 'Выгружать брошенные корзины';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_27096e1243f98e1b3300f57ff1c76456'] = 'Выберите задержку';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f0135b33ac1799cfcb7dbe03265a8aa8'] = 'Настройки магазинов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_1f8246b1e6ada8897902eff8d8cd8f35'] = 'устарел';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5b55e5aeb08a372d36f7e4b7b35d1cd1'] = 'URL для ICML каталога в Prestashop и в %s не совпадают';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_06aa6fa8bdc2078e7e1bd903e70c8f6a'] = 'подключен';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7892a1894478824c07b62af2df839291'] = 'Более 7 дней';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_8277e0910d750195b448797616e091ad'] = 'д';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_2510c39011c5be704182423e3a695e91'] = 'ч';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_d8bd79cc131920d5de426f914d17405a'] = 'мин';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_3baa7e02e09dba2ba2a188a7c9a055cb'] = 'прошло с момента последнего запуска';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_068f80c7519d0528fb08e82137a72131'] = 'Продукты';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9461bed8b71377318436990e57106729'] = 'Торговые предложения';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_64ef97a8fe9db8b672287a53c5d836f2'] = 'еще не был сгенерирован';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_79c07dbacf542d283944685e1538a1bb'] = 'Нажмите кнопку ниже чтобы сгенерировать %s';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4a15f35e8d386dd1d96faa83c1e44a22'] = 'Обновить URL';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_cc84d5b49b62c0959f1af64bffaec3b7'] = 'Генерировать сейчас';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4e537de8dd108eafec4c37603c8ab7fb'] = 'Управление типами доставки';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5b385947acf10ac0c5521161ce96aaa7'] = 'Выберите доставку';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c0fd6d31d096a5845f1d1abb4c132b7d'] = 'Управление статусами заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_dd53d9b3603b3279b25c74f6f3f189a4'] = 'Управление типами оплаты';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7dcc1208fa03381346955c6732d9ea85'] = 'Выберите тип';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a54a0e8a7a80b58ce5f8e2ef344bbf95'] = 'Остатки';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_65dd9f6e8bf4eaf54c3dc96f011dade1'] = 'Получать остатки из Simla.com';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b55197a49e8c4cd8c314bc2aa39d6feb'] = 'Нет в наличии';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4c271a7beaf103049443085ccab1f03f'] = 'Изменять статус заказа, если товара нет в наличии и запрещена его покупка с нулевым остатком на складе.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4d3d769b812b6faa6b76e1a8abaece2d'] = 'Активно';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f75d8fa5c89351544d372cf90528ccf2'] = 'Ключ сайта';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_c9cc8cce247e49bae79f15173ce97354'] = 'Сохранить';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6f1f9a3e435963417d08849fbef139c1'] = 'Введите идентификаторы заказов для загрузки в Simla.com, разделив их запятыми. Вы также можете указать диапазоны, например \"1-10\". Одновременно можно загружать до 10 заказов.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_acfa058ec9e6e4745eddc0cae3f0f881'] = 'ID заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_91412465ea9169dfd901dd5e7c96dd99'] = 'Выгрузить';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_418faff1c9df0d297ff586ac3230be97'] = 'Вы можете экспортировать все заказы и клиентов из CMS в Simla.com, нажав кнопку «Экспорт». Этот процесс может занять много времени, и до его завершения необходимо держать вкладку открытой.';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7442e29d7d53e549b78d93c46b8cdcfc'] = 'Заказы';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_e6d0e1c8fc6a4fcf47869df87e04cd88'] = 'Клиенты';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_f8f36c02fa6f370808135c66cfc788aa'] = 'Клиенты без заказов';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0095a9fa74d1713e43e370a7d7846224'] = 'Экспортировать';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_51348d86bbb5ef9d37b0cc340bcafd2d'] = 'Выгруженные заказы';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_7db8c329e031289c4bee5dc9628fbef7'] = 'В этом разделе вы можете проверить результат выгрузки заказов, а также вручную выгрузить заказы в';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_13348442cc6a27032d2b4aa28b75a5d3'] = 'Искать';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b1c94ca2fbc3e78fc30069c8d0f01680'] = 'Все';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_fe8d588f340d7507265417633ccff16e'] = 'Выгружен';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_902b0d55fddef6f8d651fe1035b7d4bd'] = 'Ошибка';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_da9c83250288c94613605b535c26c648'] = 'Дата и Время';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0b7fa7fc169b7d50df4dbe2303bfd201'] = 'ID в';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_ec53a8c4f07baed5d8825072c89799be'] = 'Статус';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_4f18e3f1c9941a6ec5a38bc716c521b4'] = 'Код для вставки на сайт';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_ec3028a12402ab7f43962a6f3a667b6e'] = 'Режим отладки';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_5465108dc7fdda5c9ee8f00136bbaa61'] = 'Web Jobs';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9082f68bc90113d8950e4ed7fe8fa0a4'] = 'Менеджер задач';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_9194de58ce560c095f02cefc1c1c61e6'] = 'Имя задачи';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_05a3a24340b7b9cc8d4e08f0ef4f4dd9'] = 'Последний запуск';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_0be8406951cdfda82f00f79328cf4efc'] = 'Комментарий';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_fe5b6cd4d7a31615bbec8d1505089d87'] = 'StackTrace';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_48b516cc37de64527a42da11c35d3ddc'] = 'Сброс Jobs';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_b2d37ae1cedf42ff874289b721860af2'] = 'Лог-файлы';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_34082694d21dbdcfc31e6e32d9fb2b9f'] = 'Имя файла';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_a4b7f1864cfdb47cd05b54eb10337506'] = 'Дата изменения';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_6f6cb72d544962fa333e2e34ce64f719'] = 'Размер';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_06df33001c1d7187fdd81ea1f5b277aa'] = 'Действия';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_801ab24683a4a8c433c6eb40c48bcd9d'] = 'Скачать';
|
||||
$_MODULE['<{retailcrm}prestashop>settings_61b0ada67b7f40bf3d40dcc88ae4f3e6'] = 'Скачать все';
|
||||
|
@ -1,84 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade module to version 3.3.6
|
||||
*
|
||||
* @param \RetailCRM $module
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_3_3_6($module)
|
||||
{
|
||||
if ('retailcrm' != $module->name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $module->removeOldFiles([
|
||||
'retailcrm/job/abandonedCarts.php',
|
||||
'retailcrm/job/export.php',
|
||||
'retailcrm/job/icml.php',
|
||||
'retailcrm/job/index.php',
|
||||
'retailcrm/job/inventories.php',
|
||||
'retailcrm/job/jobs.php',
|
||||
'retailcrm/job/missing.php',
|
||||
'retailcrm/job/sync.php',
|
||||
'retailcrm/lib/CurlException.php',
|
||||
'retailcrm/lib/InvalidJsonException.php',
|
||||
'retailcrm/lib/JobManager.php',
|
||||
'retailcrm/lib/RetailcrmApiClient.php',
|
||||
'retailcrm/lib/RetailcrmApiClientV4.php',
|
||||
'retailcrm/lib/RetailcrmApiClientV5.php',
|
||||
'retailcrm/lib/RetailcrmApiErrors.php',
|
||||
'retailcrm/lib/RetailcrmApiResponse.php',
|
||||
'retailcrm/lib/RetailcrmDaemonCollector.php',
|
||||
'retailcrm/lib/RetailcrmHttpClient.php',
|
||||
'retailcrm/lib/RetailcrmInventories.php',
|
||||
'retailcrm/lib/RetailcrmProxy.php',
|
||||
'retailcrm/lib/RetailcrmService.php',
|
||||
'retailcrm/public/css/.gitignore',
|
||||
'retailcrm/public/css/retailcrm-upload.css',
|
||||
'retailcrm/public/js/.gitignore',
|
||||
'retailcrm/public/js/exec-jobs.js',
|
||||
'retailcrm/public/js/retailcrm-upload.js',
|
||||
]);
|
||||
}
|
185
retailcrm/upgrade/upgrade-3.4.0.php
Normal file
@ -0,0 +1,185 @@
|
||||
<?php
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2021 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Upgrade module to version 3.4.0
|
||||
*
|
||||
* @param \RetailCRM $module
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
function upgrade_module_3_4_0($module)
|
||||
{
|
||||
if ('retailcrm' != $module->name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
retailcrm_convert_old_default_values_format();
|
||||
|
||||
return $module->removeOldFiles([
|
||||
// old files from 2.x versions
|
||||
'retailcrm/job/abandonedCarts.php',
|
||||
'retailcrm/job/export.php',
|
||||
'retailcrm/job/icml.php',
|
||||
'retailcrm/job/index.php',
|
||||
'retailcrm/job/inventories.php',
|
||||
'retailcrm/job/jobs.php',
|
||||
'retailcrm/job/missing.php',
|
||||
'retailcrm/job/sync.php',
|
||||
'retailcrm/lib/CurlException.php',
|
||||
'retailcrm/lib/InvalidJsonException.php',
|
||||
'retailcrm/lib/JobManager.php',
|
||||
'retailcrm/lib/RetailcrmApiClient.php',
|
||||
'retailcrm/lib/RetailcrmApiClientV4.php',
|
||||
'retailcrm/lib/RetailcrmApiClientV5.php',
|
||||
'retailcrm/lib/RetailcrmApiErrors.php',
|
||||
'retailcrm/lib/RetailcrmApiResponse.php',
|
||||
'retailcrm/lib/RetailcrmDaemonCollector.php',
|
||||
'retailcrm/lib/RetailcrmHttpClient.php',
|
||||
'retailcrm/lib/RetailcrmProxy.php',
|
||||
'retailcrm/lib/RetailcrmService.php',
|
||||
'retailcrm/public/css/.gitignore',
|
||||
'retailcrm/public/css/retailcrm-upload.css',
|
||||
'retailcrm/public/js/.gitignore',
|
||||
'retailcrm/public/js/exec-jobs.js',
|
||||
'retailcrm/public/js/retailcrm-upload.js',
|
||||
|
||||
// old files after Vue implementation
|
||||
'retailcrm/lib/templates/RetailcrmBaseTemplate.php',
|
||||
'retailcrm/controllers/admin/RetailcrmOrdersUploadController.php',
|
||||
'retailcrm/views/templates/admin/module_translates.tpl',
|
||||
'retailcrm/views/css/less/index.php',
|
||||
'retailcrm/views/fonts/OpenSans/index.php',
|
||||
'retailcrm/views/fonts/OpenSansBold/index.php',
|
||||
'retailcrm/views/fonts/index.php',
|
||||
'retailcrm/views/css/index.php',
|
||||
'retailcrm/views/css/fonts.min.css',
|
||||
'retailcrm/views/css/less/fonts.less',
|
||||
'retailcrm/views/css/less/retailcrm-export.less',
|
||||
'retailcrm/views/css/less/retailcrm-orders.less',
|
||||
'retailcrm/views/css/less/retailcrm-upload.less',
|
||||
'retailcrm/views/css/less/styles.less',
|
||||
'retailcrm/views/css/less/sumoselect-custom.less',
|
||||
'retailcrm/views/css/retailcrm-export.min.css',
|
||||
'retailcrm/views/css/retailcrm-orders.min.css',
|
||||
'retailcrm/views/css/retailcrm-upload.min.css',
|
||||
'retailcrm/views/css/styles.min.css',
|
||||
'retailcrm/views/css/sumoselect-custom.min.css',
|
||||
'retailcrm/views/css/vendor/index.php',
|
||||
'retailcrm/views/css/vendor/sumoselect.min.css',
|
||||
'retailcrm/views/fonts/OpenSans/opensans-regular.eot',
|
||||
'retailcrm/views/fonts/OpenSans/opensans-regular.svg',
|
||||
'retailcrm/views/fonts/OpenSans/opensans-regular.ttf',
|
||||
'retailcrm/views/fonts/OpenSans/opensans-regular.woff',
|
||||
'retailcrm/views/fonts/OpenSans/opensans-regular.woff2',
|
||||
'retailcrm/views/fonts/OpenSansBold/opensans-bold.eot',
|
||||
'retailcrm/views/fonts/OpenSansBold/opensans-bold.svg',
|
||||
'retailcrm/views/fonts/OpenSansBold/opensans-bold.ttf',
|
||||
'retailcrm/views/fonts/OpenSansBold/opensans-bold.woff',
|
||||
'retailcrm/views/fonts/OpenSansBold/opensans-bold.woff2',
|
||||
'retailcrm/views/img/simla.png',
|
||||
'retailcrm/views/js/retailcrm-advanced.js',
|
||||
'retailcrm/views/js/retailcrm-advanced.min.js',
|
||||
'retailcrm/views/js/retailcrm-collector.js',
|
||||
'retailcrm/views/js/retailcrm-collector.min.js',
|
||||
'retailcrm/views/js/retailcrm-compat.js',
|
||||
'retailcrm/views/js/retailcrm-compat.min.js',
|
||||
'retailcrm/views/js/retailcrm-consultant.js',
|
||||
'retailcrm/views/js/retailcrm-consultant.min.js',
|
||||
'retailcrm/views/js/retailcrm-export.js',
|
||||
'retailcrm/views/js/retailcrm-export.min.js',
|
||||
'retailcrm/views/js/retailcrm-icml.js',
|
||||
'retailcrm/views/js/retailcrm-icml.min.js',
|
||||
'retailcrm/views/js/retailcrm-jobs.js',
|
||||
'retailcrm/views/js/retailcrm-jobs.min.js',
|
||||
'retailcrm/views/js/retailcrm-orders.js',
|
||||
'retailcrm/views/js/retailcrm-orders.min.js',
|
||||
'retailcrm/views/js/retailcrm-tabs.js',
|
||||
'retailcrm/views/js/retailcrm-tabs.min.js',
|
||||
'retailcrm/views/js/retailcrm-upload.js',
|
||||
'retailcrm/views/js/retailcrm-upload.min.js',
|
||||
'retailcrm/views/js/retailcrm.js',
|
||||
'retailcrm/views/js/retailcrm.min.js',
|
||||
'retailcrm/views/js/vendor/index.php',
|
||||
'retailcrm/views/js/vendor/jquery-3.4.0.min.js',
|
||||
'retailcrm/views/js/vendor/jquery.sumoselect.min.js',
|
||||
'retailcrm/views/templates/admin/module_messages.tpl',
|
||||
'retailcrm/views/templates/admin/settings.tpl',
|
||||
])
|
||||
&& $module->uninstallOldTabs()
|
||||
&& $module->installTab()
|
||||
;
|
||||
}
|
||||
|
||||
function retailcrm_convert_old_default_values_format()
|
||||
{
|
||||
$configs = [
|
||||
'RETAILCRM_API_DELIVERY_DEFAULT',
|
||||
'RETAILCRM_API_PAYMENT_DEFAULT',
|
||||
];
|
||||
|
||||
$isMultiStoreActive = Shop::isFeatureActive();
|
||||
|
||||
if ($isMultiStoreActive) {
|
||||
$shops = Shop::getShops();
|
||||
} else {
|
||||
$shops[] = Shop::getContext();
|
||||
}
|
||||
|
||||
foreach ($shops as $shop) {
|
||||
$idShop = (int) $shop['id_shop'];
|
||||
|
||||
foreach ($configs as $configKey) {
|
||||
if (!Configuration::hasKey($configKey, null, null, $idShop)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$configValue = Configuration::get($configKey, null, null, $idShop, '');
|
||||
|
||||
if ('' === $configValue) {
|
||||
continue;
|
||||
}
|
||||
|
||||
Configuration::updateValue($configKey, str_replace('"', '', $configValue), false, null, $idShop);
|
||||
}
|
||||
}
|
||||
}
|
1
retailcrm/views/css/fonts.min.css
vendored
@ -1 +0,0 @@
|
||||
@font-face{font-family:'OpenSans';src:url('../fonts/OpenSans/opensans-regular.eot');src:url('../fonts/OpenSans/opensans-regular.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSans/opensans-regular.woff2') format('woff2'),url('../fonts/OpenSans/opensans-regular.woff') format('woff'),url('../fonts/OpenSans/opensans-regular.ttf') format('truetype'),url('../fonts/OpenSans/opensans-regular.svg#open_sansregular') format('svg');font-weight:normal;font-style:normal}@font-face{font-family:'OpenSans';src:url('../fonts/OpenSansBold/opensans-bold.eot');src:url('../fonts/OpenSansBold/opensans-bold.eot?#iefix') format('embedded-opentype'),url('../fonts/OpenSansBold/opensans-bold.woff2') format('woff2'),url('../fonts/OpenSansBold/opensans-bold.woff') format('woff'),url('../fonts/OpenSansBold/opensans-bold.ttf') format('truetype'),url('../fonts/OpenSansBold/opensans-bold.svg#open_sansbold') format('svg');font-weight:600;font-style:normal}
|
@ -1,23 +0,0 @@
|
||||
@font-face {
|
||||
font-family: 'OpenSans';
|
||||
src: url('../fonts/OpenSans/opensans-regular.eot');
|
||||
src: url('../fonts/OpenSans/opensans-regular.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/OpenSans/opensans-regular.woff2') format('woff2'),
|
||||
url('../fonts/OpenSans/opensans-regular.woff') format('woff'),
|
||||
url('../fonts/OpenSans/opensans-regular.ttf') format('truetype'),
|
||||
url('../fonts/OpenSans/opensans-regular.svg#open_sansregular') format('svg');
|
||||
font-weight: normal;
|
||||
font-style: normal;
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: 'OpenSans';
|
||||
src: url('../fonts/OpenSansBold/opensans-bold.eot');
|
||||
src: url('../fonts/OpenSansBold/opensans-bold.eot?#iefix') format('embedded-opentype'),
|
||||
url('../fonts/OpenSansBold/opensans-bold.woff2') format('woff2'),
|
||||
url('../fonts/OpenSansBold/opensans-bold.woff') format('woff'),
|
||||
url('../fonts/OpenSansBold/opensans-bold.ttf') format('truetype'),
|
||||
url('../fonts/OpenSansBold/opensans-bold.svg#open_sansbold') format('svg');
|
||||
font-weight: 600;
|
||||
font-style: normal;
|
||||
}
|
@ -1,54 +0,0 @@
|
||||
.retail {
|
||||
&-circle {
|
||||
float: left;
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
padding: 20px;
|
||||
margin: 20px 0;
|
||||
|
||||
&__title {
|
||||
font-size: 18px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
&__content,
|
||||
.retail input&__content,
|
||||
.retail input[type="text"] &__content,
|
||||
.retail input[readonly][type="text"] &__content {
|
||||
width: 120px;
|
||||
height: 120px;
|
||||
border-radius: 120px;
|
||||
text-align: center;
|
||||
font-size: 20px;
|
||||
line-height: 60px;
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
||||
&-progress {
|
||||
border-radius: 60px;
|
||||
border: 1px solid rgba(122, 122, 122, 0.15);
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
overflow: hidden;
|
||||
transition: height 0.25s ease;
|
||||
|
||||
&__loader {
|
||||
width: 0;
|
||||
border-radius: 60px;
|
||||
background: #0068FF;
|
||||
color: white;
|
||||
text-align: center;
|
||||
padding: 0 30px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
transition: width 0.4s ease-in;
|
||||
line-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
&-hidden {
|
||||
visibility: hidden;
|
||||
height: 0 !important;
|
||||
}
|
||||
}
|
@ -1,192 +0,0 @@
|
||||
#retail-search-orders-form {
|
||||
.retail-form__area {
|
||||
width: 30% !important;
|
||||
}
|
||||
|
||||
#search-orders-submit {
|
||||
width: 15%;
|
||||
}
|
||||
|
||||
.retail-row__content {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.retail-table-filter {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
background: rgba(122, 122, 122, 0.1);
|
||||
border-radius: 58px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
padding: 0;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
color: #0068FF;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
transition: .25s ease;
|
||||
width: 45%;
|
||||
margin-left: 9%;
|
||||
|
||||
label.retail-table-filter-btn {
|
||||
width: 33.333333%;
|
||||
height: 60px;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
display: block;
|
||||
float: left;
|
||||
text-align: center;
|
||||
font-size: 16px;
|
||||
text-shadow: none;
|
||||
cursor: pointer;
|
||||
transition-property: color, background-color;
|
||||
transition-duration: .3s;
|
||||
|
||||
&.active, &:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #0068FF;
|
||||
}
|
||||
|
||||
&:hover:not(.active) {
|
||||
color: white;
|
||||
background: #005add !important;
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
border-right: 1px solid gray;
|
||||
border-bottom-left-radius: 58px;
|
||||
border-top-left-radius: 58px;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
border-left: 1px solid gray;
|
||||
border-bottom-right-radius: 58px;
|
||||
border-top-right-radius: 58px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
input.search-orders-filter {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.retail-controller-link {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.retail-table-pagination {
|
||||
&__item {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: top;
|
||||
min-width: 40px;
|
||||
height: 40px;
|
||||
background: rgba(122, 122, 122, 0.1);
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: #363A41;
|
||||
text-decoration: none;
|
||||
border: 0;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
transition: .25s ease;
|
||||
padding: 10px;
|
||||
margin: 10px;
|
||||
|
||||
&.active, &:hover {
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.active {
|
||||
background: #0068FF;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: #005add;
|
||||
}
|
||||
|
||||
&--divider {
|
||||
background: transparent;
|
||||
pointer-events: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#retail-orders-table {
|
||||
.retail-orders-table__status {
|
||||
&:not(.error) .retail-orders-table__status--error {
|
||||
|
||||
display: none;
|
||||
}
|
||||
|
||||
&.error .retail-orders-table__status--success {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
.retail-orders-table__upload {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #0068ff;
|
||||
fill: #0068ff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.retail-row {
|
||||
&--foldable {
|
||||
border-radius: 8px;
|
||||
margin: 20px 0;
|
||||
padding: 0 3%;
|
||||
transition: .25s ease;
|
||||
box-shadow: 0 2px 4px rgba(30, 34, 72, .16);
|
||||
border: 2px solid #fff;
|
||||
-webkit-box-shadow: 0 2px 4px rgba(30, 34, 72, .16);
|
||||
|
||||
&:hover, &.active {
|
||||
box-shadow: 0 8px 16px rgba(30, 34, 72, .16);
|
||||
}
|
||||
|
||||
&.active {
|
||||
border-color: #005eeb;
|
||||
|
||||
.retail-row__title {
|
||||
cursor: initial;
|
||||
}
|
||||
|
||||
.retail-row__content {
|
||||
display: block;
|
||||
height: auto;
|
||||
padding-bottom: 40px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&--foldable &__title,
|
||||
&--foldable &__content {
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
&--foldable &__title {
|
||||
padding: 22px 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
&--foldable &__content {
|
||||
display: none;
|
||||
height: 0;
|
||||
overflow: hidden;
|
||||
padding: 0;
|
||||
transition: .25s ease;
|
||||
}
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
#retailcrm-loading-fade {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #000;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;
|
||||
z-index: 9999;
|
||||
opacity: .5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
|
||||
#retailcrm-loader {
|
||||
width: 50px;
|
||||
height: 50px;
|
||||
border: 10px solid white;
|
||||
animation: retailcrm-loader 2s linear infinite;
|
||||
border-top: 10px solid #0c0c0c;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
@keyframes retailcrm-loader {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
@ -1,890 +0,0 @@
|
||||
@import "fonts.less";
|
||||
|
||||
@red: #ff553b;
|
||||
@redHover: #da4932;
|
||||
@redActive: darken(@redHover, 10%);
|
||||
@blue: #0068FF;
|
||||
@blueHover: #005add;
|
||||
@blueActive: darken(@blueHover, 10%);
|
||||
@gray: #7A7A7A;
|
||||
@grayBg: #EAEBEC;
|
||||
@grayBtn: rgba(122, 122, 122, 0.1);
|
||||
@grayBtnHover: rgba(122, 122, 122, 0.15);
|
||||
@grayBtnActive: fadein(@grayBtnHover, 10%);
|
||||
@darkGray: #363A41;
|
||||
@yellow: #fcc94f;
|
||||
@yellowActive: #edbe4c;
|
||||
@lightYellow: #fcf3b5;
|
||||
@shadowGray: #fdd0d0;
|
||||
@bord: #DFDFDF;
|
||||
@green: #33D16B;
|
||||
@greenHover: #22CA5D;
|
||||
|
||||
|
||||
body, html {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
.icon-RetailcrmSettings:before {
|
||||
content: "\f07a";
|
||||
}
|
||||
|
||||
.retail {
|
||||
&-wrap {
|
||||
font-family: OpenSans, Arial, sans-serif;
|
||||
padding: 0 15px;
|
||||
height: 100%;
|
||||
background: white;
|
||||
|
||||
*, *::before, *::after {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
input[type=file], input[type=password], input[type=text], input[readonly][type=text], textarea {
|
||||
-webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .1) inset;
|
||||
box-shadow: inset 0 1px 2px rgba(0, 0, 0, .1);
|
||||
background-color: #fff;
|
||||
border: 1px solid #ccc;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
&-container {
|
||||
margin: 0 auto;
|
||||
width: 100%;
|
||||
max-width: 950px;
|
||||
}
|
||||
|
||||
&-title {
|
||||
margin: 60px 0 0;
|
||||
font-weight: 400;
|
||||
text-align: center;
|
||||
font-size: 28px;
|
||||
line-height: 38px;
|
||||
|
||||
&_content {
|
||||
text-align: left;
|
||||
margin-top: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
&-txt {
|
||||
color: @gray;
|
||||
font-size: 18px;
|
||||
line-height: 26px;
|
||||
}
|
||||
|
||||
&-descript {
|
||||
margin-top: 45px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&-tab {
|
||||
&__enabled {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&__disabled {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&-video {
|
||||
margin: 30px auto 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
|
||||
&-trigger {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
& iframe {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
&__btn {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
cursor: pointer;
|
||||
opacity: .4;
|
||||
transition: .25s ease;
|
||||
|
||||
svg {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
opacity: .6;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-btns {
|
||||
margin: 56px auto 0;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
max-width: 815px;
|
||||
transition: .05s ease;
|
||||
|
||||
&__separate {
|
||||
padding: 0 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: @gray;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
&_hide {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&-form {
|
||||
&__spacer {
|
||||
|
||||
}
|
||||
|
||||
margin-top: 60px;
|
||||
|
||||
&__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
margin-bottom: 22px;
|
||||
|
||||
&_link {
|
||||
color: @blue;
|
||||
transition: .25s ease;
|
||||
float: right;
|
||||
|
||||
&:hover {
|
||||
color: @blueHover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__label {
|
||||
width: 100% !important;
|
||||
text-align: left !important;
|
||||
margin: 15px 12px;
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
&__row {
|
||||
margin-top: 15px;
|
||||
|
||||
&_submit {
|
||||
margin-top: 23px;
|
||||
}
|
||||
}
|
||||
|
||||
&__message-warning {
|
||||
padding: 13px 18px;
|
||||
margin: 1px 13px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid @lightYellow;
|
||||
font-size: 1rem;
|
||||
box-shadow: 0px 0px 6px 0px @shadowGray;
|
||||
}
|
||||
|
||||
&__checkbox {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: center;
|
||||
padding: 4px 12px;
|
||||
|
||||
input[type=checkbox] {
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
}
|
||||
|
||||
label {
|
||||
width: auto;
|
||||
margin-left: 8px;
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
&__area {
|
||||
display: inline-block !important;
|
||||
vertical-align: top;
|
||||
width: 430px !important;
|
||||
height: 60px !important;
|
||||
border: 1px solid @grayBtnHover !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 58px !important;
|
||||
padding: 0 28px !important;
|
||||
line-height: normal;
|
||||
color: @gray !important;
|
||||
background-color: white!important;
|
||||
font-size: 16px !important;
|
||||
appearance: none;
|
||||
|
||||
&:focus {
|
||||
color: @darkGray;
|
||||
|
||||
&::-webkit-input-placeholder {
|
||||
color: @darkGray;
|
||||
}
|
||||
|
||||
&::-moz-placeholder {
|
||||
color: @darkGray;
|
||||
}
|
||||
|
||||
&:-moz-placeholder {
|
||||
color: @darkGray;
|
||||
}
|
||||
|
||||
&:-ms-input-placeholder {
|
||||
color: @darkGray;
|
||||
}
|
||||
}
|
||||
|
||||
&_txt {
|
||||
padding: 20px 28px !important;
|
||||
line-height: 24px !important;
|
||||
height: 487px !important;
|
||||
border-radius: 20px !important;
|
||||
resize: none !important;
|
||||
font-family: OpenSans, Arial, sans-serif !important;
|
||||
}
|
||||
}
|
||||
|
||||
input, textarea {
|
||||
&:focus {
|
||||
outline: none !important;
|
||||
}
|
||||
}
|
||||
|
||||
&_main {
|
||||
margin-top: 34px;
|
||||
max-width: 900px;
|
||||
width: 100%;
|
||||
|
||||
.retail-form__area {
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-tabs {
|
||||
margin-top: 60px;
|
||||
|
||||
&__btn {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 19px 30px;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 22px;
|
||||
color: @gray;
|
||||
text-align: center;
|
||||
min-width: 152px;
|
||||
text-decoration: none !important;
|
||||
position: relative;
|
||||
transition: .25s ease;
|
||||
|
||||
&:hover {
|
||||
color: @darkGray;
|
||||
}
|
||||
|
||||
&::after {
|
||||
content: "";
|
||||
height: 3px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: -1px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
opacity: 0;
|
||||
visibility: hidden;
|
||||
background: @blue;
|
||||
transition: .25s ease;
|
||||
}
|
||||
|
||||
&_active {
|
||||
color: @darkGray;
|
||||
|
||||
&::after {
|
||||
opacity: 1;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&__head {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid @bord;
|
||||
}
|
||||
|
||||
&__body {
|
||||
padding-top: 18px;
|
||||
|
||||
p {
|
||||
margin-top: 23px;
|
||||
margin-bottom: 0;
|
||||
color: @gray;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
}
|
||||
}
|
||||
|
||||
&__item {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-list {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
|
||||
&__item {
|
||||
padding-left: 2px;
|
||||
position: relative;
|
||||
color: @gray;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
|
||||
&::before {
|
||||
content: "-";
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
color: @gray;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin-right: 3px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-tile {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
|
||||
&__col {
|
||||
width: 48%;
|
||||
padding-right: 35px;
|
||||
|
||||
&:nth-child(1) {
|
||||
width: 52%;
|
||||
}
|
||||
|
||||
&_contacts {
|
||||
padding-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__row {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
margin-bottom: 30px;
|
||||
|
||||
&:nth-last-child(1) {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__item {
|
||||
margin-top: 34px;
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 20px;
|
||||
}
|
||||
}
|
||||
|
||||
&__title {
|
||||
color: @darkGray;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
}
|
||||
|
||||
&__descript {
|
||||
color: @gray;
|
||||
font-size: 16px;
|
||||
line-height: 24px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
|
||||
&__link {
|
||||
color: @blue;
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
line-height: 24px;
|
||||
transition: .25s ease;
|
||||
|
||||
&:hover {
|
||||
color: @blueHover;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-popup {
|
||||
position: absolute;
|
||||
width: 90%;
|
||||
height: 90%;
|
||||
background: white;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
transform: translate3d(0, -1000%, 0) scale(.1);
|
||||
transition: 0.25s ease;
|
||||
|
||||
&__close {
|
||||
position: absolute;
|
||||
top: -30px;
|
||||
right: -30px;
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
cursor: pointer;
|
||||
|
||||
&::before, &::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
margin: auto;
|
||||
height: 30px;
|
||||
width: 2px;
|
||||
background: white;
|
||||
}
|
||||
|
||||
&::before {
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
&::after {
|
||||
transform: rotate(-45deg);
|
||||
}
|
||||
}
|
||||
|
||||
&.open {
|
||||
transform: translate3d(0, 0, 0) scale(1);
|
||||
}
|
||||
|
||||
&-wrap {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.6);
|
||||
z-index: 1000;
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
|
||||
&-column {
|
||||
display: flex;
|
||||
max-width: 1389px;
|
||||
height: 100%;
|
||||
|
||||
&__aside {
|
||||
width: 253px;
|
||||
background: @grayBg;
|
||||
min-height: 300px;
|
||||
|
||||
#content.bootstrap & {
|
||||
margin: 10px 0;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
flex: 1 0 auto;
|
||||
padding: 0 58px;
|
||||
min-height: 300px;
|
||||
}
|
||||
}
|
||||
|
||||
&-menu {
|
||||
padding: 8px 20px 8px 15px;
|
||||
|
||||
&__btn {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
vertical-align: top;
|
||||
width: 100%;
|
||||
height: 60px;
|
||||
background: @grayBtn !important;
|
||||
font-weight: bold;
|
||||
font-size: 16px;
|
||||
color: @darkGray !important;
|
||||
text-decoration: none !important;
|
||||
padding: 0 30px;
|
||||
margin-top: 20px;
|
||||
border-radius: 5px;
|
||||
text-align: center;
|
||||
transition: .25s ease;
|
||||
|
||||
span {
|
||||
display: block;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background: @grayBtnHover !important;
|
||||
}
|
||||
|
||||
&:nth-child(1) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&_active {
|
||||
color: white !important;
|
||||
background: @blue !important;
|
||||
|
||||
&:hover {
|
||||
background: @blueHover !important;
|
||||
}
|
||||
|
||||
&.retail-menu__btn_error {
|
||||
background: @redHover !important;
|
||||
}
|
||||
}
|
||||
|
||||
&_error {
|
||||
color: white !important;
|
||||
background: @red !important;
|
||||
|
||||
&:hover {
|
||||
background: @redHover !important;
|
||||
}
|
||||
}
|
||||
|
||||
&_big {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
&_hidden {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-full-height {
|
||||
& {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
background: @grayBtn;
|
||||
border-radius: 58px;
|
||||
height: 60px;
|
||||
line-height: 60px;
|
||||
padding: 0 30px;
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
text-align: center;
|
||||
color: @blue;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
appearance: none;
|
||||
border: none;
|
||||
box-shadow: none;
|
||||
transition: .25s ease;
|
||||
|
||||
&:hover {
|
||||
background: @grayBtnHover;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: @grayBtnActive;
|
||||
}
|
||||
|
||||
&_max {
|
||||
min-width: 356px;
|
||||
}
|
||||
|
||||
&_invert {
|
||||
background: @blue;
|
||||
color: white;
|
||||
|
||||
&:hover {
|
||||
background: @blueHover;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: @blueActive;
|
||||
}
|
||||
}
|
||||
|
||||
&_whatsapp {
|
||||
background: @green;
|
||||
color: white;
|
||||
padding: 0 62px;
|
||||
|
||||
&:hover {
|
||||
background: @greenHover;
|
||||
}
|
||||
}
|
||||
|
||||
&_submit {
|
||||
min-width: 218px;
|
||||
}
|
||||
|
||||
&_warning {
|
||||
min-width: 218px;
|
||||
background: @yellow;
|
||||
|
||||
&:hover {
|
||||
background: @yellowActive;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.toggle-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&-table {
|
||||
width: 100%;
|
||||
border: none;
|
||||
border-radius: 20px;
|
||||
|
||||
&.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
thead {
|
||||
th {
|
||||
background: rgba(122, 122, 122, 0.15);
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
|
||||
tbody {
|
||||
tr {
|
||||
&.alert,
|
||||
&.alert td{
|
||||
line-height: 120px;
|
||||
font-size: 16px;
|
||||
}
|
||||
td {
|
||||
border-bottom: 1px solid #ccc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
td, th {
|
||||
color: #333;
|
||||
font-size: 14px;
|
||||
line-height: 40px;
|
||||
padding: 4px 6px;
|
||||
max-width: 300px;
|
||||
vertical-align: middle;
|
||||
|
||||
}
|
||||
|
||||
&-wrapper {
|
||||
width: 100%;
|
||||
max-height: 500px;
|
||||
overflow-y: scroll;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
&__row {
|
||||
&-bold {
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
&-no-wrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
&-center {
|
||||
&, & th {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
&-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
&-sort {
|
||||
&__btn, &__switch {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
color: #005add;
|
||||
}
|
||||
}
|
||||
|
||||
&__btn {
|
||||
float: left;
|
||||
clear: both;
|
||||
line-height: 20px;
|
||||
font-size: 20px;
|
||||
padding-left: 10px;
|
||||
padding-right: 10px;
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-out;
|
||||
|
||||
&-wrap {
|
||||
position: absolute;
|
||||
}
|
||||
}
|
||||
|
||||
&__asc {
|
||||
//padding-bottom: 0;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
//padding-top: 0;
|
||||
}
|
||||
|
||||
& thead th:hover &__btn, & thead td:hover &__btn {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
&-collapsible {
|
||||
&__input {
|
||||
display: none;
|
||||
}
|
||||
|
||||
&__title, label&__title {
|
||||
cursor: pointer;
|
||||
font-weight: normal;
|
||||
text-align: center;
|
||||
padding: 0;
|
||||
position: relative;
|
||||
line-height: 1;
|
||||
width: 100%;
|
||||
|
||||
&:before {
|
||||
content: '\25B6';
|
||||
opacity: 0;
|
||||
transition: opacity 0.2s ease-out;
|
||||
}
|
||||
|
||||
&:hover:before {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
&__content {
|
||||
text-align: left;
|
||||
font-size: 12px;
|
||||
line-height: 1.5;
|
||||
background: #fff;
|
||||
border: 1px solid rgba(122, 122, 122, 0.15);
|
||||
position: absolute;
|
||||
z-index: 5;
|
||||
top: 20px;
|
||||
left: 0;
|
||||
padding: 18px;
|
||||
margin: 0;
|
||||
border-radius: 20px;
|
||||
overflow: hidden;
|
||||
max-height: 0;
|
||||
transition-duration: 0.2s;
|
||||
transition-timing-function: ease-out;
|
||||
transition-property: max-height, visibility;
|
||||
visibility: hidden;
|
||||
}
|
||||
|
||||
&__input:checked + &__title &__content {
|
||||
max-height: 100vh;
|
||||
visibility: visible;
|
||||
}
|
||||
}
|
||||
|
||||
&-error-msg {
|
||||
&, &:after, &:before {
|
||||
color: #dd2e44;
|
||||
}
|
||||
}
|
||||
|
||||
&-alert {
|
||||
position: relative;
|
||||
height: 60px;
|
||||
padding: 0 50px;
|
||||
line-height: 30px;
|
||||
|
||||
&-text {
|
||||
font-size: 1.5em;
|
||||
}
|
||||
|
||||
&-note {
|
||||
color: @gray;
|
||||
font-size: 1.2em;
|
||||
}
|
||||
|
||||
&:before {
|
||||
display: block;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
padding: 10px 5px;
|
||||
font: normal normal normal 40px/1 FontAwesome;
|
||||
}
|
||||
|
||||
&-success:before {
|
||||
content: "\F058";
|
||||
color: @green;
|
||||
}
|
||||
|
||||
&-warning:before {
|
||||
content: "\F06A";
|
||||
color: @yellow;
|
||||
}
|
||||
|
||||
&-danger:before {
|
||||
content: "\F071";
|
||||
color: @red;
|
||||
}
|
||||
|
||||
&-info:before {
|
||||
content: "\F059";
|
||||
color: @blue;
|
||||
}
|
||||
}
|
||||
|
||||
&-btn-svg {
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
display: inline-block;
|
||||
cursor: pointer;
|
||||
//transition: transform .3s ease-out;
|
||||
&_wrapper {
|
||||
cursor: pointer;
|
||||
|
||||
&:hover {
|
||||
//transform: scale(1.1);
|
||||
fill: @gray;
|
||||
color: @gray;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -1,52 +0,0 @@
|
||||
@fontSize: 16px;
|
||||
@selectHeight: 60px;
|
||||
@borderRadius: 58px;
|
||||
@optionsBorderRadius: 10px;
|
||||
@innerPadding: 28px;
|
||||
@textColor: #7a7a7a;
|
||||
@border: 1px solid rgba(122,122,122,0.15);
|
||||
|
||||
.SumoSelect {
|
||||
width: 100%;
|
||||
|
||||
&.open > .optWrapper {
|
||||
top: @selectHeight !important;
|
||||
}
|
||||
|
||||
& > .optWrapper {
|
||||
border-radius: @optionsBorderRadius;
|
||||
|
||||
& > .options {
|
||||
li label {
|
||||
font-weight: normal !important;
|
||||
}
|
||||
|
||||
li.opt {
|
||||
float: left !important;
|
||||
width: 100% !important;
|
||||
font-size: @fontSize;
|
||||
font-weight: normal !important;
|
||||
|
||||
label {
|
||||
width: 100% !important;
|
||||
text-align: left !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
& > .CaptionCont {
|
||||
border: @border !important;
|
||||
box-shadow: none!important;
|
||||
border-radius: @borderRadius;
|
||||
line-height: normal;
|
||||
padding: 0 @innerPadding !important;
|
||||
color: @textColor !important;
|
||||
font-size: @fontSize !important;
|
||||
height: @selectHeight;
|
||||
|
||||
& > span {
|
||||
line-height: @selectHeight;
|
||||
}
|
||||
}
|
||||
}
|
1
retailcrm/views/css/retailcrm-export.min.css
vendored
@ -1 +0,0 @@
|
||||
.retail-circle{float:left;width:50%;text-align:center;padding:20px;margin:20px 0}.retail-circle__title{font-size:18px;margin-bottom:20px}.retail input.retail-circle__content,.retail input[readonly][type=text] .retail-circle__content,.retail input[type=text] .retail-circle__content,.retail-circle__content{width:120px;height:120px;border-radius:120px;text-align:center;font-size:20px;line-height:60px;display:inline-block}.retail-progress{border-radius:60px;border:1px solid rgba(122,122,122,.15);width:100%;height:60px;overflow:hidden;transition:height .25s ease}.retail-progress__loader{width:0;border-radius:60px;background:#0068FF;color:#fff;text-align:center;padding:0 30px;font-size:18px;font-weight:600;transition:width .4s ease-in;line-height:60px}.retail-hidden{visibility:hidden;height:0!important}/*# sourceMappingURL=retailcrm-export.min.css.map */
|
1
retailcrm/views/css/retailcrm-orders.min.css
vendored
@ -1 +0,0 @@
|
||||
#retail-search-orders-form .retail-form__area{width:30%!important}#retail-search-orders-form #search-orders-submit{width:15%}#retail-search-orders-form .retail-row__content{width:100%}#retail-search-orders-form .retail-table-filter{display:inline-block;vertical-align:top;background:rgba(122,122,122,.1);border-radius:58px;height:60px;line-height:60px;padding:0;font-size:18px;font-weight:600;text-align:center;color:#0068FF;text-decoration:none;cursor:pointer;appearance:none;border:none;box-shadow:none;transition:.25s ease;width:45%;margin-left:9%}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn{width:33.333333%;height:60px;margin:0;padding:0;display:block;float:left;text-align:center;font-size:16px;text-shadow:none;cursor:pointer;transition-property:color,background-color;transition-duration:.3s}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn.active,#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn:hover{color:#fff}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn.active{background:#0068FF}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn:hover:not(.active){color:#fff;background:#005add!important}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn:first-child{border-right:1px solid gray;border-bottom-left-radius:58px;border-top-left-radius:58px}#retail-search-orders-form .retail-table-filter label.retail-table-filter-btn:last-child{border-left:1px solid gray;border-bottom-right-radius:58px;border-top-right-radius:58px}#retail-search-orders-form input.search-orders-filter{display:none}.retail-controller-link{display:none}.retail-table-pagination__item{display:inline-flex;align-items:center;justify-content:center;vertical-align:top;min-width:40px;height:40px;background:rgba(122,122,122,.1);font-weight:700;font-size:16px;color:#363A41;text-decoration:none;border:0;border-radius:5px;text-align:center;transition:.25s ease;padding:10px;margin:10px}.retail-table-pagination__item.active,.retail-table-pagination__item:hover{color:#fff}.retail-table-pagination__item.active{background:#0068FF}.retail-table-pagination__item:hover{background:#005add}.retail-table-pagination__item--divider{background:0 0;pointer-events:none}#retail-orders-table .retail-orders-table__status:not(.error) .retail-orders-table__status--error{display:none}#retail-orders-table .retail-orders-table__status.error .retail-orders-table__status--success{display:none}#retail-orders-table .retail-orders-table__upload{cursor:pointer}#retail-orders-table .retail-orders-table__upload:hover{color:#0068ff;fill:#0068ff}.retail-row--foldable{border-radius:8px;margin:20px 0;padding:0 3%;transition:.25s ease;box-shadow:0 2px 4px rgba(30,34,72,.16);border:2px solid #fff;-webkit-box-shadow:0 2px 4px rgba(30,34,72,.16)}.retail-row--foldable.active,.retail-row--foldable:hover{box-shadow:0 8px 16px rgba(30,34,72,.16)}.retail-row--foldable.active{border-color:#005eeb}.retail-row--foldable.active .retail-row__title{cursor:initial}.retail-row--foldable.active .retail-row__content{display:block;height:auto;padding-bottom:40px}.retail-row--foldable .retail-row__content,.retail-row--foldable .retail-row__title{margin:0!important}.retail-row--foldable .retail-row__title{padding:22px 0;cursor:pointer}.retail-row--foldable .retail-row__content{display:none;height:0;overflow:hidden;padding:0;transition:.25s ease}/*# sourceMappingURL=retailcrm-orders.min.css.map */
|
1
retailcrm/views/css/retailcrm-upload.min.css
vendored
@ -1 +0,0 @@
|
||||
#retailcrm-loading-fade{display:flex;flex-direction:row;align-items:center;justify-content:center;background:#000;position:fixed;left:0;right:0;bottom:0;top:0;z-index:9999;opacity:.5;filter:alpha(opacity=50)}#retailcrm-loader{width:50px;height:50px;border:10px solid white;animation:retailcrm-loader 2s linear infinite;border-top:10px solid #0c0c0c;border-radius:50%}@keyframes retailcrm-loader{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
|
1
retailcrm/views/css/styles.min.css
vendored
@ -1 +0,0 @@
|
||||
.SumoSelect{width:100%}.SumoSelect.open>.optWrapper{top:60px!important}.SumoSelect>.optWrapper{border-radius:10px}.SumoSelect>.optWrapper>.options li label{font-weight:normal!important}.SumoSelect>.optWrapper>.options li.opt{float:left!important;width:100%!important;font-size:16px;font-weight:normal!important}.SumoSelect>.optWrapper>.options li.opt label{width:100%!important;text-align:left!important}.SumoSelect>.CaptionCont{border:1px solid rgba(122,122,122,0.15)!important;box-shadow:none!important;border-radius:58px;line-height:normal;padding:0 28px!important;color:#7a7a7a!important;font-size:16px!important;height:60px}.SumoSelect>.CaptionCont>span{line-height:60px}
|
8
retailcrm/views/css/vendor/index.php
vendored
@ -1,8 +0,0 @@
|
||||
<?php
|
||||
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
|
||||
header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT");
|
||||
header("Cache-Control: no-store, no-cache, must-revalidate");
|
||||
header("Cache-Control: post-check=0, pre-check=0", false);
|
||||
header("Pragma: no-cache");
|
||||
header("Location: ../");
|
||||
exit;
|
BIN
retailcrm/views/favicon.ico
Normal file
After Width: | Height: | Size: 4.2 KiB |
Before Width: | Height: | Size: 409 KiB |
Before Width: | Height: | Size: 409 KiB |
BIN
retailcrm/views/img/checking-work-2.png
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
retailcrm/views/img/checking-work-3.png
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
retailcrm/views/img/delivery-info-1.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
retailcrm/views/img/delivery-info-2.png
Normal file
After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 29 KiB |
BIN
retailcrm/views/img/where-is-search-1.png
Normal file
After Width: | Height: | Size: 41 KiB |
BIN
retailcrm/views/img/where-is-search-2.png
Normal file
After Width: | Height: | Size: 47 KiB |
BIN
retailcrm/views/img/where-is-search-3.png
Normal file
After Width: | Height: | Size: 74 KiB |
BIN
retailcrm/views/img/where-is-search-4.png
Normal file
After Width: | Height: | Size: 42 KiB |
BIN
retailcrm/views/img/where-is-search-5.png
Normal file
After Width: | Height: | Size: 97 KiB |
1
retailcrm/views/index.html
Normal file
@ -0,0 +1 @@
|
||||
<!DOCTYPE html><html lang=""><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" href="../modules/retailcrm/views/favicon.ico"><title>prestashop</title><link href="../modules/retailcrm/views/js/app.js" rel="preload" as="script"><link href="../modules/retailcrm/views/js/chunk-vendors.js" rel="preload" as="script"></head><body><noscript><strong>We're sorry but prestashop doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="../modules/retailcrm/views/js/chunk-vendors.js"></script><script src="../modules/retailcrm/views/js/app.js"></script></body></html>
|
37
retailcrm/views/js/app.js
Normal file
90
retailcrm/views/js/chunk-vendors.js
Normal file
@ -1,77 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function () {
|
||||
function RetailcrmAdvancedSettings() {
|
||||
this.resetButton = $('input[id="reset-jobs-submit"]').get(0);
|
||||
this.form = $(this.resetButton).closest('form').get(0);
|
||||
|
||||
this.resetAction = this.resetAction.bind(this);
|
||||
|
||||
$(this.resetButton).click(this.resetAction);
|
||||
}
|
||||
|
||||
RetailcrmAdvancedSettings.prototype.resetAction = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.resetButton.disabled = true;
|
||||
let data = {
|
||||
submitretailcrm: 1,
|
||||
ajax: 1,
|
||||
RETAILCRM_RESET_JOBS: 1
|
||||
};
|
||||
|
||||
let _this = this;
|
||||
|
||||
$.ajax({
|
||||
url: this.form.action,
|
||||
method: this.form.method,
|
||||
timeout: 0,
|
||||
data: data,
|
||||
dataType: 'json',
|
||||
})
|
||||
.done(function (response) {
|
||||
alert('Reset completed successfully')
|
||||
_this.resetButton.disabled = false;
|
||||
})
|
||||
.fail(function (error) {
|
||||
alert('Error: ' + error.responseJSON.errorMsg);
|
||||
_this.resetButton.disabled = false;
|
||||
})
|
||||
}
|
||||
|
||||
window.RetailcrmAdvancedSettings = RetailcrmAdvancedSettings;
|
||||
});
|
38
retailcrm/views/js/retailcrm-advanced.min.js
vendored
@ -1,38 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function(){function t(){this.resetButton=$('input[id="reset-jobs-submit"]').get(0),this.form=$(this.resetButton).closest("form").get(0),this.resetAction=this.resetAction.bind(this),$(this.resetButton).click(this.resetAction)}t.prototype.resetAction=function(t){t.preventDefault(),this.resetButton.disabled=!0;let e=this;$.ajax({url:this.form.action,method:this.form.method,timeout:0,data:{submitretailcrm:1,ajax:1,RETAILCRM_RESET_JOBS:1},dataType:"json"}).done(function(t){alert("Reset completed successfully"),e.resetButton.disabled=!1}).fail(function(t){alert("Error: "+t.responseJSON.errorMsg),e.resetButton.disabled=!1})},window.RetailcrmAdvancedSettings=t});
|
||||
//# sourceMappingURL=retailcrm-advanced.min.js.map
|
@ -1,101 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
class RCRMCollector {
|
||||
init = () => {
|
||||
this.getCollectorConfig()
|
||||
.then((config) => {
|
||||
this.initCollector();
|
||||
|
||||
if (this.has(config, 'customerId')) {
|
||||
this.executeCollector(config.siteKey, {customerId: config.customerId});
|
||||
} else {
|
||||
this.executeCollector(config.siteKey, {});
|
||||
}
|
||||
})
|
||||
.catch((err) => this.isNil(err) ? null : console.log(err));
|
||||
};
|
||||
|
||||
getCollectorConfig = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch('/index.php?fc=module&module=retailcrm&controller=DaemonCollector')
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
if (this.has(data, 'siteKey') && data.siteKey.length > 0) {
|
||||
resolve(data);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(`Failed to init collector: ${err}`);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
initCollector = () => {
|
||||
(function(_,r,e,t,a,i,l){
|
||||
_['retailCRMObject']=a;
|
||||
_[a]=_[a]||function(){
|
||||
(_[a].q=_[a].q||[]).push(arguments);
|
||||
};
|
||||
_[a].l=1*new Date();
|
||||
l=r.getElementsByTagName(e)[0];
|
||||
i=r.createElement(e);
|
||||
i.async=!0;
|
||||
i.src=t;
|
||||
l.parentNode.insertBefore(i,l)
|
||||
})(window,document,'script','https://collector.retailcrm.pro/w.js','_rc');
|
||||
};
|
||||
|
||||
executeCollector = (siteKey, settings) => {
|
||||
_rc('create', siteKey, settings);
|
||||
_rc('send', 'pageView');
|
||||
};
|
||||
|
||||
isNil = (value) => {
|
||||
return value == null;
|
||||
};
|
||||
|
||||
has = (object, key) => {
|
||||
return object != null && hasOwnProperty.call(object, key);
|
||||
};
|
||||
}
|
||||
|
||||
(new RCRMCollector()).init();
|
||||
})();
|
36
retailcrm/views/js/retailcrm-collector.min.js
vendored
@ -1,36 +0,0 @@
|
||||
function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/(function(){new function a(){var b=this;_classCallCheck(this,a),_defineProperty(this,"init",function(){b.getCollectorConfig().then(function(a){b.initCollector(),b.has(a,"customerId")?b.executeCollector(a.siteKey,{customerId:a.customerId}):b.executeCollector(a.siteKey,{})})["catch"](function(a){return b.isNil(a)?null:console.log(a)})}),_defineProperty(this,"getCollectorConfig",function(){return new Promise(function(a,c){fetch("/index.php?fc=module&module=retailcrm&controller=DaemonCollector").then(function(a){return a.json()}).then(function(d){b.has(d,"siteKey")&&0<d.siteKey.length?a(d):c()})["catch"](function(a){c("Failed to init collector: ".concat(a))})})}),_defineProperty(this,"initCollector",function(){(function(b,c,d,e,f,a,g){b.retailCRMObject=f,b[f]=b[f]||function(){(b[f].q=b[f].q||[]).push(arguments)},b[f].l=1*new Date,g=c.getElementsByTagName(d)[0],a=c.createElement(d),a.async=!0,a.src=e,g.parentNode.insertBefore(a,g)})(window,document,"script","https://collector.retailcrm.pro/w.js","_rc")}),_defineProperty(this,"executeCollector",function(a,b){_rc("create",a,b),_rc("send","pageView")}),_defineProperty(this,"isNil",function(a){return null==a}),_defineProperty(this,"has",function(a,b){return null!=a&&hasOwnProperty.call(a,b)})}().init()})();
|
@ -1,53 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
!function(t, r){
|
||||
let appendJs = function (src) {
|
||||
var a = t.getElementsByTagName("head")[0];
|
||||
var c = t.createElement("script");
|
||||
c.type="text/javascript";
|
||||
c.src=src;
|
||||
a.appendChild(c);
|
||||
};
|
||||
|
||||
if (typeof Promise === 'undefined') {
|
||||
appendJs("//cdn.jsdelivr.net/npm/es6-promise@4.2.8/dist/es6-promise.auto.min.js");
|
||||
}
|
||||
|
||||
if (typeof fetch === 'undefined') {
|
||||
appendJs("//cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.js");
|
||||
}
|
||||
}(document);
|
36
retailcrm/views/js/retailcrm-compat.min.js
vendored
@ -1,36 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/!function(b){var a=function(d){var e=b.getElementsByTagName("head")[0],a=b.createElement("script");a.type="text/javascript",a.src=d,e.appendChild(a)};"undefined"==typeof Promise&&a("//cdn.jsdelivr.net/npm/es6-promise@4.2.8/dist/es6-promise.auto.min.js"),"undefined"==typeof fetch&&a("//cdn.jsdelivr.net/npm/whatwg-fetch@3.0.0/dist/fetch.umd.js")}(document);
|
@ -1,91 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
class RCRMConsultant {
|
||||
init = () => {
|
||||
this.getRcct()
|
||||
.then((rcct) => {
|
||||
window._rcct = rcct;
|
||||
this.initConsultant();
|
||||
})
|
||||
.catch((err) => this.isNil(err) ? null : console.log(err));
|
||||
};
|
||||
|
||||
getRcct = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
fetch('/index.php?fc=module&module=retailcrm&controller=Consultant')
|
||||
.then((data) => data.json())
|
||||
.then((data) => {
|
||||
if (this.has(data, 'rcct') && data.rcct.length > 0) {
|
||||
resolve(data.rcct);
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
reject(`Failed to init consultant: ${err}`);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
initConsultant = () => {
|
||||
!function(t){
|
||||
var a = t.getElementsByTagName("head")[0];
|
||||
var c = t.createElement("script");
|
||||
c.type="text/javascript";
|
||||
c.src="//c.retailcrm.tech/widget/loader.js";
|
||||
a.appendChild(c);
|
||||
}(document);
|
||||
};
|
||||
|
||||
executeCollector = (siteKey, settings) => {
|
||||
_rc('create', siteKey, settings);
|
||||
_rc('send', 'pageView');
|
||||
};
|
||||
|
||||
isNil = (value) => {
|
||||
return value == null;
|
||||
};
|
||||
|
||||
has = (object, key) => {
|
||||
return object != null && hasOwnProperty.call(object, key);
|
||||
};
|
||||
}
|
||||
|
||||
(new RCRMConsultant()).init();
|
||||
})();
|
36
retailcrm/views/js/retailcrm-consultant.min.js
vendored
@ -1,36 +0,0 @@
|
||||
function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/(function(){new function a(){var b=this;_classCallCheck(this,a),_defineProperty(this,"init",function(){b.getRcct().then(function(a){window._rcct=a,b.initConsultant()})["catch"](function(a){return b.isNil(a)?null:console.log(a)})}),_defineProperty(this,"getRcct",function(){return new Promise(function(a,c){fetch("/index.php?fc=module&module=retailcrm&controller=Consultant").then(function(a){return a.json()}).then(function(d){b.has(d,"rcct")&&0<d.rcct.length?a(d.rcct):c()})["catch"](function(a){c("Failed to init consultant: ".concat(a))})})}),_defineProperty(this,"initConsultant",function(){!function(b){var d=b.getElementsByTagName("head")[0],a=b.createElement("script");a.type="text/javascript",a.src="//c.retailcrm.tech/widget/loader.js",d.appendChild(a)}(document)}),_defineProperty(this,"executeCollector",function(a,b){_rc("create",a,b),_rc("send","pageView")}),_defineProperty(this,"isNil",function(a){return null==a}),_defineProperty(this,"has",function(a,b){return null!=a&&hasOwnProperty.call(a,b)})}().init()})();
|
@ -1,149 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function () {
|
||||
function RetailcrmExportForm()
|
||||
{
|
||||
this.form = $('input[name=RETAILCRM_EXPORT_ORDERS_COUNT]').closest('form').get(0);
|
||||
|
||||
if (typeof this.form === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.isDone = false;
|
||||
this.ordersCount = parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_ORDERS_COUNT"]').val());
|
||||
this.customersCount = parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_CUSTOMERS_COUNT"]').val());
|
||||
this.ordersStepSize = parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_ORDERS_STEP_SIZE"]').val());
|
||||
this.customersStepSize = parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE"]').val());
|
||||
this.ordersStep = 0;
|
||||
this.customersStep = 0;
|
||||
|
||||
this.submitButton = $(this.form).find('button[id="export-orders-submit"]').get(0);
|
||||
this.progressBar = $(this.form).find('div[id="export-orders-progress"]').get(0);
|
||||
|
||||
this.submitAction = this.submitAction.bind(this);
|
||||
this.exportAction = this.exportAction.bind(this);
|
||||
this.exportDone = this.exportDone.bind(this);
|
||||
this.initializeProgressBar = this.initializeProgressBar.bind(this);
|
||||
this.updateProgressBar = this.updateProgressBar.bind(this);
|
||||
|
||||
$(this.submitButton).click(this.submitAction);
|
||||
}
|
||||
|
||||
RetailcrmExportForm.prototype.submitAction = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.initializeProgressBar();
|
||||
this.exportAction();
|
||||
};
|
||||
|
||||
RetailcrmExportForm.prototype.exportAction = function () {
|
||||
let data = {
|
||||
submitretailcrm: 1,
|
||||
ajax: 1
|
||||
};
|
||||
if (this.ordersStep * this.ordersStepSize < this.ordersCount) {
|
||||
this.ordersStep++;
|
||||
data.RETAILCRM_EXPORT_ORDERS_STEP = this.ordersStep;
|
||||
} else {
|
||||
if (this.customersStep * this.customersStepSize < this.customersCount) {
|
||||
this.customersStep++;
|
||||
data.RETAILCRM_EXPORT_CUSTOMERS_STEP = this.customersStep;
|
||||
} else {
|
||||
data.RETAILCRM_UPDATE_SINCE_ID = 1;
|
||||
this.isDone = true;
|
||||
}
|
||||
}
|
||||
|
||||
let _this = this;
|
||||
|
||||
$.ajax({
|
||||
url: this.form.action,
|
||||
method: this.form.method,
|
||||
timeout: 0,
|
||||
data: data
|
||||
})
|
||||
.done(function (response) {
|
||||
if (_this.isDone) {
|
||||
return _this.exportDone();
|
||||
}
|
||||
|
||||
_this.updateProgressBar();
|
||||
_this.exportAction();
|
||||
})
|
||||
};
|
||||
|
||||
RetailcrmExportForm.prototype.initializeProgressBar = function () {
|
||||
$(this.submitButton).addClass('retail-hidden');
|
||||
$(this.progressBar)
|
||||
.removeClass('retail-hidden')
|
||||
.append($('<div/>', {class: 'retail-progress__loader', text: '0%'}))
|
||||
|
||||
window.addEventListener('beforeunload', this.confirmLeave);
|
||||
};
|
||||
|
||||
RetailcrmExportForm.prototype.updateProgressBar = function () {
|
||||
let processedOrders = this.ordersStep * this.ordersStepSize;
|
||||
if (processedOrders > this.ordersCount) {
|
||||
processedOrders = this.ordersCount;
|
||||
}
|
||||
|
||||
let processedCustomers = this.customersStep * this.customersStepSize;
|
||||
if (processedCustomers > this.customersCount) {
|
||||
processedCustomers = this.customersCount;
|
||||
}
|
||||
|
||||
const processed = processedOrders + processedCustomers;
|
||||
const total = this.ordersCount + this.customersCount;
|
||||
const percents = Math.round(100 * processed / total);
|
||||
|
||||
$(this.progressBar).find('.retail-progress__loader').text(percents + '%');
|
||||
$(this.progressBar).find('.retail-progress__loader').css('width', percents + '%');
|
||||
$(this.progressBar).find('.retail-progress__loader').attr('title', processed + '/' + total);
|
||||
};
|
||||
|
||||
RetailcrmExportForm.prototype.confirmLeave = function (event) {
|
||||
event.preventDefault();
|
||||
event.returnValue = 'Export process has been started';
|
||||
}
|
||||
|
||||
RetailcrmExportForm.prototype.exportDone = function () {
|
||||
window.removeEventListener('beforeunload', this.confirmLeave);
|
||||
alert('Export is done')
|
||||
}
|
||||
|
||||
window.RetailcrmExportForm = RetailcrmExportForm;
|
||||
});
|
38
retailcrm/views/js/retailcrm-export.min.js
vendored
@ -1,38 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function(){function t(){if(this.form=$("input[name=RETAILCRM_EXPORT_ORDERS_COUNT]").closest("form").get(0),void 0===this.form)return!1;this.isDone=!1,this.ordersCount=parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_ORDERS_COUNT"]').val()),this.customersCount=parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_CUSTOMERS_COUNT"]').val()),this.ordersStepSize=parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_ORDERS_STEP_SIZE"]').val()),this.customersStepSize=parseInt($(this.form).find('input[name="RETAILCRM_EXPORT_CUSTOMERS_STEP_SIZE"]').val()),this.ordersStep=0,this.customersStep=0,this.submitButton=$(this.form).find('button[id="export-orders-submit"]').get(0),this.progressBar=$(this.form).find('div[id="export-orders-progress"]').get(0),this.submitAction=this.submitAction.bind(this),this.exportAction=this.exportAction.bind(this),this.exportDone=this.exportDone.bind(this),this.initializeProgressBar=this.initializeProgressBar.bind(this),this.updateProgressBar=this.updateProgressBar.bind(this),$(this.submitButton).click(this.submitAction)}t.prototype.submitAction=function(t){t.preventDefault(),this.initializeProgressBar(),this.exportAction()},t.prototype.exportAction=function(){let t={submitretailcrm:1,ajax:1};this.ordersStep*this.ordersStepSize<this.ordersCount?(this.ordersStep++,t.RETAILCRM_EXPORT_ORDERS_STEP=this.ordersStep):this.customersStep*this.customersStepSize<this.customersCount?(this.customersStep++,t.RETAILCRM_EXPORT_CUSTOMERS_STEP=this.customersStep):(t.RETAILCRM_UPDATE_SINCE_ID=1,this.isDone=!0);let s=this;$.ajax({url:this.form.action,method:this.form.method,timeout:0,data:t}).done(function(t){return s.isDone?s.exportDone():(s.updateProgressBar(),void s.exportAction())})},t.prototype.initializeProgressBar=function(){$(this.submitButton).addClass("retail-hidden"),$(this.progressBar).removeClass("retail-hidden").append($("<div/>",{class:"retail-progress__loader",text:"0%"})),window.addEventListener("beforeunload",this.confirmLeave)},t.prototype.updateProgressBar=function(){let t=this.ordersStep*this.ordersStepSize;t>this.ordersCount&&(t=this.ordersCount);let s=this.customersStep*this.customersStepSize;s>this.customersCount&&(s=this.customersCount);var e=t+s,i=this.ordersCount+this.customersCount,r=Math.round(100*e/i);$(this.progressBar).find(".retail-progress__loader").text(r+"%"),$(this.progressBar).find(".retail-progress__loader").css("width",r+"%"),$(this.progressBar).find(".retail-progress__loader").attr("title",e+"/"+i)},t.prototype.confirmLeave=function(t){t.preventDefault(),t.returnValue="Export process has been started"},t.prototype.exportDone=function(){window.removeEventListener("beforeunload",this.confirmLeave),alert("Export is done")},window.RetailcrmExportForm=t});
|
||||
//# sourceMappingURL=retailcrm-export.min.js.map
|
@ -1,95 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function () {
|
||||
function RetailcrmIcmlForm(tabController) {
|
||||
this.submitButton = $('button[id="generate-icml-submit"]').get(0);
|
||||
this.updateButton = $('button[id="update-icml-submit"]').get(0);
|
||||
this.form = $(this.submitButton).closest('form').get(0);
|
||||
this.icmlField = $(this.form).find('input[name="RETAILCRM_RUN_JOB"]').get(0);
|
||||
|
||||
if (typeof this.form === 'undefined') {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.submitAction = this.submitAction.bind(this);
|
||||
this.updateAction = this.updateAction.bind(this);
|
||||
this.setLoading = this.setLoading.bind(this);
|
||||
this.tabController = tabController;
|
||||
|
||||
$(this.submitButton).click(this.submitAction);
|
||||
$(this.updateButton).click(this.updateAction);
|
||||
}
|
||||
|
||||
RetailcrmIcmlForm.prototype.submitAction = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.setLoading(true);
|
||||
this.tabController.storeTabInAction(this.form);
|
||||
|
||||
$(this.icmlField).val('RetailcrmIcmlEvent');
|
||||
$(this.form).submit();
|
||||
};
|
||||
|
||||
RetailcrmIcmlForm.prototype.updateAction = function (event) {
|
||||
event.preventDefault();
|
||||
|
||||
this.setLoading(true);
|
||||
this.tabController.storeTabInAction(this.form);
|
||||
|
||||
$(this.icmlField).val('RetailcrmIcmlUpdateUrlEvent');
|
||||
$(this.form).submit();
|
||||
};
|
||||
|
||||
RetailcrmIcmlForm.prototype.setLoading = function (loading) {
|
||||
var loaderId = 'retailcrm-loading-fade',
|
||||
indicator = $('#' + loaderId);
|
||||
|
||||
if (indicator.length === 0) {
|
||||
$('body').append(`
|
||||
<div id="${loaderId}">
|
||||
<div id="retailcrm-loader"></div>
|
||||
</div>
|
||||
`.trim());
|
||||
|
||||
indicator = $('#' + loaderId);
|
||||
}
|
||||
|
||||
indicator.css('visibility', (loading ? 'visible' : 'hidden'));
|
||||
};
|
||||
|
||||
window.RetailcrmIcmlForm = RetailcrmIcmlForm;
|
||||
});
|
42
retailcrm/views/js/retailcrm-icml.min.js
vendored
@ -1,42 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
$(function(){function t(t){if(this.submitButton=$('button[id="generate-icml-submit"]').get(0),this.updateButton=$('button[id="update-icml-submit"]').get(0),this.form=$(this.submitButton).closest("form").get(0),this.icmlField=$(this.form).find('input[name="RETAILCRM_RUN_JOB"]').get(0),void 0===this.form)return!1;this.submitAction=this.submitAction.bind(this),this.updateAction=this.updateAction.bind(this),this.setLoading=this.setLoading.bind(this),this.tabController=t,$(this.submitButton).click(this.submitAction),$(this.updateButton).click(this.updateAction)}t.prototype.submitAction=function(t){t.preventDefault(),this.setLoading(!0),this.tabController.storeTabInAction(this.form),$(this.icmlField).val("RetailcrmIcmlEvent"),$(this.form).submit()},t.prototype.updateAction=function(t){t.preventDefault(),this.setLoading(!0),this.tabController.storeTabInAction(this.form),$(this.icmlField).val("RetailcrmIcmlUpdateUrlEvent"),$(this.form).submit()},t.prototype.setLoading=function(t){var i="retailcrm-loading-fade",o=$("#"+i);0===o.length&&($("body").append(`
|
||||
<div id="${i}">
|
||||
<div id="retailcrm-loader"></div>
|
||||
</div>
|
||||
`.trim()),o=$("#"+i)),o.css("visibility",t?"visible":"hidden")},window.RetailcrmIcmlForm=t});
|
||||
//# sourceMappingURL=retailcrm-icml.min.js.map
|
@ -1,57 +0,0 @@
|
||||
/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/
|
||||
|
||||
(function () {
|
||||
class RCRMJobs {
|
||||
init = () => {
|
||||
this.executeJobs();
|
||||
};
|
||||
|
||||
executeJobs = () => {
|
||||
let req = new XMLHttpRequest();
|
||||
req.open(
|
||||
"GET",
|
||||
'/index.php?fc=module&module=retailcrm&controller=Jobs',
|
||||
true
|
||||
);
|
||||
req.timeout = 0;
|
||||
req.send(null);
|
||||
};
|
||||
}
|
||||
|
||||
(new RCRMJobs()).init();
|
||||
})();
|
36
retailcrm/views/js/retailcrm-jobs.min.js
vendored
@ -1,36 +0,0 @@
|
||||
function _classCallCheck(a,b){if(!(a instanceof b))throw new TypeError("Cannot call a class as a function")}function _defineProperty(a,b,c){return b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}/**
|
||||
* MIT License
|
||||
*
|
||||
* Copyright (c) 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
* of this software and associated documentation files (the "Software"), to deal
|
||||
* in the Software without restriction, including without limitation the rights
|
||||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
* copies of the Software, and to permit persons to whom the Software is
|
||||
* furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included in
|
||||
* all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author DIGITAL RETAIL TECHNOLOGIES SL <mail@simlachat.com>
|
||||
* @copyright 2020 DIGITAL RETAIL TECHNOLOGIES SL
|
||||
* @license https://opensource.org/licenses/MIT The MIT License
|
||||
*
|
||||
* Don't forget to prefix your containers with your own identifier
|
||||
* to avoid any conflicts with others containers.
|
||||
*/(function(){new function a(){var b=this;_classCallCheck(this,a),_defineProperty(this,"init",function(){b.executeJobs()}),_defineProperty(this,"executeJobs",function(){var a=new XMLHttpRequest;a.open("GET","/index.php?fc=module&module=retailcrm&controller=Jobs",!0),a.timeout=0,a.send(null)})}().init()})();
|