mirror of
https://github.com/retailcrm/prestashop-module.git
synced 2025-03-01 19:03:14 +03:00
Added 'files' api methods
This commit is contained in:
parent
bbc458696e
commit
3436b4f956
@ -1,3 +1,9 @@
|
|||||||
|
## v3.4.9
|
||||||
|
* Добавлены api методы для работы с файлами
|
||||||
|
|
||||||
|
## v3.4.8
|
||||||
|
* Исправлена синхронизация заказов при ненастроенном маппинге статусов
|
||||||
|
|
||||||
## v3.4.7
|
## v3.4.7
|
||||||
* Исправлена ошибка в работе воркеров публичной части сайта
|
* Исправлена ошибка в работе воркеров публичной части сайта
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class RetailcrmOrdersController extends RetailcrmAdminPostAbstractController
|
|||||||
protected function getHandler()
|
protected function getHandler()
|
||||||
{
|
{
|
||||||
$orders = Tools::getValue('orders', []);
|
$orders = Tools::getValue('orders', []);
|
||||||
$page = (int) (Tools::getValue('page', 1));
|
$page = (int) Tools::getValue('page', 1);
|
||||||
|
|
||||||
switch (Tools::getValue('filter')) {
|
switch (Tools::getValue('filter')) {
|
||||||
case '1':
|
case '1':
|
||||||
|
@ -69,20 +69,20 @@ class RetailcrmReferencesController extends RetailcrmAdminPostAbstractController
|
|||||||
$moduleReferences = new RetailcrmReferences($client);
|
$moduleReferences = new RetailcrmReferences($client);
|
||||||
|
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case Tools::getIsset('delivery'):
|
case Tools::getIsset('delivery'):
|
||||||
$references['deliveryTypesCRM'] = $moduleReferences->getApiDeliveryTypes();
|
$references['deliveryTypesCRM'] = $moduleReferences->getApiDeliveryTypes();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Tools::getIsset('payment'):
|
case Tools::getIsset('payment'):
|
||||||
$references['paymentTypesCRM'] = $moduleReferences->getApiPaymentTypes();
|
$references['paymentTypesCRM'] = $moduleReferences->getApiPaymentTypes();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case Tools::getIsset('status'):
|
case Tools::getIsset('status'):
|
||||||
$references['statusesCRM'] = $moduleReferences->getApiStatusesWithGroup();
|
$references['statusesCRM'] = $moduleReferences->getApiStatusesWithGroup();
|
||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
throw new Exception('Invalid request data');
|
throw new Exception('Invalid request data');
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
|
@ -61,8 +61,8 @@ class RetailcrmContextSwitcher
|
|||||||
self::storeContext();
|
self::storeContext();
|
||||||
|
|
||||||
foreach (self::getShops() as $shop) {
|
foreach (self::getShops() as $shop) {
|
||||||
self::setShopContext((int) ($shop['id_shop']));
|
self::setShopContext((int) $shop['id_shop']);
|
||||||
$result[(int) ($shop['id_shop'])] = call_user_func_array($callback, $arguments);
|
$result[(int) $shop['id_shop']] = call_user_func_array($callback, $arguments);
|
||||||
}
|
}
|
||||||
|
|
||||||
self::restoreContext();
|
self::restoreContext();
|
||||||
|
@ -91,7 +91,7 @@ class RetailcrmExportOrdersHelper
|
|||||||
$sqlOrdersInfo = 'FROM `' . _DB_PREFIX_ . 'retailcrm_exported_orders` eo
|
$sqlOrdersInfo = 'FROM `' . _DB_PREFIX_ . 'retailcrm_exported_orders` eo
|
||||||
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o on o.`id_order` = eo.`id_order`
|
LEFT JOIN `' . _DB_PREFIX_ . 'orders` o on o.`id_order` = eo.`id_order`
|
||||||
WHERE 1 ' . Shop::addSqlRestriction(false, 'o')
|
WHERE 1 ' . Shop::addSqlRestriction(false, 'o')
|
||||||
;
|
;
|
||||||
|
|
||||||
if (0 < count($ordersIds)) {
|
if (0 < count($ordersIds)) {
|
||||||
$sqlOrdersInfo .= ' AND (eo.`id_order` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
$sqlOrdersInfo .= ' AND (eo.`id_order` IN ( ' . pSQL(implode(', ', $ordersIds)) . ')
|
||||||
|
@ -56,9 +56,9 @@ class RetailcrmHistory
|
|||||||
|
|
||||||
private static function init()
|
private static function init()
|
||||||
{
|
{
|
||||||
self::$receiveOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING));
|
self::$receiveOrderNumber = (bool) Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING);
|
||||||
self::$sendOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_SENDING));
|
self::$sendOrderNumber = (bool) Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_SENDING);
|
||||||
self::$cartStatus = (string) (Configuration::get(RetailCRM::SYNC_CARTS_STATUS));
|
self::$cartStatus = (string) Configuration::get(RetailCRM::SYNC_CARTS_STATUS);
|
||||||
self::$statuses = array_flip(array_filter(json_decode(Configuration::get(RetailCRM::STATUS), true)));
|
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::$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::$payments = array_flip(array_filter(json_decode(Configuration::get(RetailCRM::PAYMENT), true)));
|
||||||
@ -1002,7 +1002,7 @@ class RetailcrmHistory
|
|||||||
$default_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
$default_currency = (int) Configuration::get('PS_CURRENCY_DEFAULT');
|
||||||
$newOrder = new Order();
|
$newOrder = new Order();
|
||||||
$newOrder->id_shop = Context::getContext()->shop->id;
|
$newOrder->id_shop = Context::getContext()->shop->id;
|
||||||
$newOrder->id_shop_group = (int) (Context::getContext()->shop->id_shop_group);
|
$newOrder->id_shop_group = (int) Context::getContext()->shop->id_shop_group;
|
||||||
$newOrder->id_address_delivery = isset($addressDelivery->id) ? (int) $addressDelivery->id : 0;
|
$newOrder->id_address_delivery = isset($addressDelivery->id) ? (int) $addressDelivery->id : 0;
|
||||||
$newOrder->id_address_invoice = isset($addressInvoice->id) ? (int) $addressInvoice->id : 0;
|
$newOrder->id_address_invoice = isset($addressInvoice->id) ? (int) $addressInvoice->id : 0;
|
||||||
$newOrder->id_cart = (int) $cart->id;
|
$newOrder->id_cart = (int) $cart->id;
|
||||||
@ -1289,7 +1289,7 @@ class RetailcrmHistory
|
|||||||
->setAlias($orderAddress->alias)
|
->setAlias($orderAddress->alias)
|
||||||
->build()
|
->build()
|
||||||
->getData()
|
->getData()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function checkDeliveryTypeAndCost($order, $orderToUpdate)
|
private static function checkDeliveryTypeAndCost($order, $orderToUpdate)
|
||||||
@ -1299,12 +1299,12 @@ class RetailcrmHistory
|
|||||||
$orderDeliveryCost = !empty($order['delivery']['cost']) ? $order['delivery']['cost'] : null;
|
$orderDeliveryCost = !empty($order['delivery']['cost']) ? $order['delivery']['cost'] : null;
|
||||||
|
|
||||||
if ((
|
if ((
|
||||||
null !== $orderDeliveryCode
|
null !== $orderDeliveryCode
|
||||||
&& isset(self::$deliveries[$orderDeliveryCode])
|
&& isset(self::$deliveries[$orderDeliveryCode])
|
||||||
&& null !== self::$deliveries[$orderDeliveryCode]
|
&& null !== self::$deliveries[$orderDeliveryCode]
|
||||||
&& self::$deliveries[$orderDeliveryCode] !== $orderToUpdate->id_carrier
|
&& self::$deliveries[$orderDeliveryCode] !== $orderToUpdate->id_carrier
|
||||||
)
|
)
|
||||||
|| null !== $orderDeliveryCost
|
|| null !== $orderDeliveryCost
|
||||||
) {
|
) {
|
||||||
$orderCarrier = self::getOrderCarrier($orderToUpdate);
|
$orderCarrier = self::getOrderCarrier($orderToUpdate);
|
||||||
|
|
||||||
|
@ -295,7 +295,6 @@ class RetailcrmOrderBuilder
|
|||||||
$this->cmsCustomer,
|
$this->cmsCustomer,
|
||||||
$this->cmsCart,
|
$this->cmsCart,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
$dataFromCart,
|
$dataFromCart,
|
||||||
'',
|
'',
|
||||||
'',
|
'',
|
||||||
@ -861,7 +860,6 @@ class RetailcrmOrderBuilder
|
|||||||
$this->cmsCustomer,
|
$this->cmsCustomer,
|
||||||
$this->cmsCart,
|
$this->cmsCart,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
$dataFromCart,
|
$dataFromCart,
|
||||||
$contactPersonId,
|
$contactPersonId,
|
||||||
$contactPersonExternalId,
|
$contactPersonExternalId,
|
||||||
@ -902,7 +900,7 @@ class RetailcrmOrderBuilder
|
|||||||
$delivery = json_decode(Configuration::get(RetailCRM::DELIVERY), true);
|
$delivery = json_decode(Configuration::get(RetailCRM::DELIVERY), true);
|
||||||
$payment = json_decode(Configuration::get(RetailCRM::PAYMENT), true);
|
$payment = json_decode(Configuration::get(RetailCRM::PAYMENT), true);
|
||||||
$status = json_decode(Configuration::get(RetailCRM::STATUS), true);
|
$status = json_decode(Configuration::get(RetailCRM::STATUS), true);
|
||||||
$sendOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_SENDING));
|
$sendOrderNumber = (bool) Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_SENDING);
|
||||||
$orderNumber = $sendOrderNumber ? $order->reference : null;
|
$orderNumber = $sendOrderNumber ? $order->reference : null;
|
||||||
|
|
||||||
if (false === Module::getInstanceByName('advancedcheckout')) {
|
if (false === Module::getInstanceByName('advancedcheckout')) {
|
||||||
|
@ -207,6 +207,111 @@ class RetailcrmApiClientV5
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get files list
|
||||||
|
*
|
||||||
|
* @param array $filter
|
||||||
|
* @param null $limit
|
||||||
|
* @param null $page
|
||||||
|
*
|
||||||
|
* @return RetailcrmApiResponse
|
||||||
|
*/
|
||||||
|
public function filesList(array $filter = [], $limit = null, $page = null)
|
||||||
|
{
|
||||||
|
$parameters = [];
|
||||||
|
|
||||||
|
if (count($filter)) {
|
||||||
|
$parameters['filter'] = $filter;
|
||||||
|
}
|
||||||
|
if (null !== $page) {
|
||||||
|
$parameters['page'] = (int) $page;
|
||||||
|
}
|
||||||
|
if (null !== $limit) {
|
||||||
|
$parameters['limit'] = (int) $limit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->client->makeRequest(
|
||||||
|
'/files',
|
||||||
|
RetailcrmHttpClient::METHOD_GET,
|
||||||
|
$parameters
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Upload file
|
||||||
|
*
|
||||||
|
* @param $file
|
||||||
|
*
|
||||||
|
* @return RetailcrmApiResponse
|
||||||
|
*/
|
||||||
|
public function filesUpload($file)
|
||||||
|
{
|
||||||
|
return $this->client->makeRequest(
|
||||||
|
'/files/upload',
|
||||||
|
RetailcrmHttpClient::METHOD_POST,
|
||||||
|
['file' => $file]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns file data
|
||||||
|
*
|
||||||
|
* @param int $id file ID
|
||||||
|
*
|
||||||
|
* @throws \RetailCrm\Exception\InvalidJsonException
|
||||||
|
* @throws \RetailCrm\Exception\CurlException
|
||||||
|
* @throws \InvalidArgumentException
|
||||||
|
*
|
||||||
|
* @return RetailcrmApiResponse
|
||||||
|
*/
|
||||||
|
public function filesGet($id)
|
||||||
|
{
|
||||||
|
return $this->client->makeRequest("/files/$id", RetailcrmHttpClient::METHOD_GET);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Delete file
|
||||||
|
*
|
||||||
|
* @param string $id file id
|
||||||
|
*
|
||||||
|
* @return RetailcrmApiResponse
|
||||||
|
*/
|
||||||
|
public function filesDelete($id)
|
||||||
|
{
|
||||||
|
if (!$id) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
'Parameter `id` must be set'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->client->makeRequest(
|
||||||
|
sprintf('/files/%s/delete', $id),
|
||||||
|
RetailcrmHttpClient::METHOD_POST
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Edit file
|
||||||
|
*
|
||||||
|
* @param array $file
|
||||||
|
*
|
||||||
|
* @return RetailcrmApiResponse
|
||||||
|
*/
|
||||||
|
public function filesEdit(array $file)
|
||||||
|
{
|
||||||
|
if (!count($file)) {
|
||||||
|
throw new \InvalidArgumentException(
|
||||||
|
'Parameter `file` must contains a data'
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->client->makeRequest(
|
||||||
|
"/files/{$file['id']}/edit",
|
||||||
|
RetailcrmHttpClient::METHOD_POST,
|
||||||
|
['file' => json_encode($file), 'id' => $file['id']]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get custom fields list
|
* Get custom fields list
|
||||||
*
|
*
|
||||||
|
@ -114,6 +114,10 @@ class RetailcrmHttpClient
|
|||||||
$url .= '?' . http_build_query($parameters, '', '&');
|
$url .= '?' . http_build_query($parameters, '', '&');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (self::METHOD_POST === $method && '/files/upload' === $path) {
|
||||||
|
$url .= '?apiKey=' . $parameters['apiKey'];
|
||||||
|
}
|
||||||
|
|
||||||
$curlHandler = curl_init();
|
$curlHandler = curl_init();
|
||||||
curl_setopt($curlHandler, CURLOPT_URL, $url);
|
curl_setopt($curlHandler, CURLOPT_URL, $url);
|
||||||
curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1);
|
curl_setopt($curlHandler, CURLOPT_RETURNTRANSFER, 1);
|
||||||
@ -126,7 +130,12 @@ class RetailcrmHttpClient
|
|||||||
|
|
||||||
if (self::METHOD_POST === $method) {
|
if (self::METHOD_POST === $method) {
|
||||||
curl_setopt($curlHandler, CURLOPT_POST, true);
|
curl_setopt($curlHandler, CURLOPT_POST, true);
|
||||||
curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $parameters);
|
|
||||||
|
if ('/files/upload' === $path) {
|
||||||
|
curl_setopt($curlHandler, CURLOPT_POSTFIELDS, file_get_contents($parameters['file']));
|
||||||
|
} else {
|
||||||
|
curl_setopt($curlHandler, CURLOPT_POSTFIELDS, $parameters);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$responseBody = curl_exec($curlHandler);
|
$responseBody = curl_exec($curlHandler);
|
||||||
|
@ -66,7 +66,7 @@ class RetailcrmExceptionMiddleware implements RetailcrmMiddlewareInterface
|
|||||||
sprintf(
|
sprintf(
|
||||||
'Expected instance of `%s`, but `%s` given',
|
'Expected instance of `%s`, but `%s` given',
|
||||||
RetailcrmApiResponse::class,
|
RetailcrmApiResponse::class,
|
||||||
(is_object($response) ? get_class($response) : gettype($response))
|
is_object($response) ? get_class($response) : gettype($response)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -132,7 +132,7 @@ class RetailcrmExportOrdersMiddleware implements RetailcrmMiddlewareInterface
|
|||||||
$uploadedOrders = [];
|
$uploadedOrders = [];
|
||||||
foreach ($orders as $order) {
|
foreach ($orders as $order) {
|
||||||
RetailcrmExportOrdersHelper::updateExportState($order['externalId'], $order['id']);
|
RetailcrmExportOrdersHelper::updateExportState($order['externalId'], $order['id']);
|
||||||
$uploadedOrders[] = (int) ($order['externalId']);
|
$uploadedOrders[] = (int) $order['externalId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$notUploadedOrders = array_filter($requestedOrders, function ($orderId) use ($uploadedOrders) {
|
$notUploadedOrders = array_filter($requestedOrders, function ($orderId) use ($uploadedOrders) {
|
||||||
|
@ -53,7 +53,7 @@ class RetailcrmReferenceMiddleware implements RetailcrmMiddlewareInterface
|
|||||||
|| 'ordersEdit' === $request->getMethod()
|
|| 'ordersEdit' === $request->getMethod()
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
$receiveOrderNumber = (bool) (Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING));
|
$receiveOrderNumber = (bool) Configuration::get(RetailCRM::ENABLE_ORDER_NUMBER_RECEIVING);
|
||||||
$crmOrder = $response->order;
|
$crmOrder = $response->order;
|
||||||
|
|
||||||
if ($receiveOrderNumber
|
if ($receiveOrderNumber
|
||||||
|
@ -58,7 +58,7 @@ class RetailcrmAbandonedCartsEvent extends RetailcrmAbstractEvent implements Ret
|
|||||||
}
|
}
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
$syncCartsActive = Configuration::get(RetailCRM::SYNC_CARTS_ACTIVE);
|
$syncCartsActive = Configuration::get(RetailCRM::SYNC_CARTS_ACTIVE);
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmExportEvent extends RetailcrmAbstractEvent implements RetailcrmEv
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
$api = RetailcrmTools::getApiClient();
|
$api = RetailcrmTools::getApiClient();
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmIcmlEvent extends RetailcrmAbstractEvent implements RetailcrmEven
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
$job = new RetailcrmCatalog();
|
$job = new RetailcrmCatalog();
|
||||||
$data = $job->getData();
|
$data = $job->getData();
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmIcmlUpdateUrlEvent extends RetailcrmAbstractEvent implements Reta
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
if (!file_exists(RetailcrmCatalogHelper::getIcmlFilePath())) {
|
if (!file_exists(RetailcrmCatalogHelper::getIcmlFilePath())) {
|
||||||
continue;
|
continue;
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmInventoriesEvent extends RetailcrmAbstractEvent implements Retail
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
if (!Configuration::get(RetailCRM::ENABLE_BALANCES_RECEIVING)) {
|
if (!Configuration::get(RetailCRM::ENABLE_BALANCES_RECEIVING)) {
|
||||||
RetailcrmLogger::writeDebug(
|
RetailcrmLogger::writeDebug(
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmSyncEvent extends RetailcrmAbstractEvent implements RetailcrmEven
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
if (!Configuration::get(RetailCRM::ENABLE_HISTORY_UPLOADS)) {
|
if (!Configuration::get(RetailCRM::ENABLE_HISTORY_UPLOADS)) {
|
||||||
RetailcrmLogger::writeDebug(
|
RetailcrmLogger::writeDebug(
|
||||||
|
@ -54,7 +54,7 @@ class RetailcrmUpdateSinceIdEvent extends RetailcrmAbstractEvent implements Reta
|
|||||||
$shops = $this->getShops();
|
$shops = $this->getShops();
|
||||||
|
|
||||||
foreach ($shops as $shop) {
|
foreach ($shops as $shop) {
|
||||||
RetailcrmContextSwitcher::setShopContext((int) ($shop['id_shop']));
|
RetailcrmContextSwitcher::setShopContext((int) $shop['id_shop']);
|
||||||
|
|
||||||
$api = RetailcrmTools::getApiClient();
|
$api = RetailcrmTools::getApiClient();
|
||||||
|
|
||||||
|
@ -48,7 +48,7 @@ require_once dirname(__FILE__) . '/bootstrap.php';
|
|||||||
|
|
||||||
class RetailCRM extends Module
|
class RetailCRM extends Module
|
||||||
{
|
{
|
||||||
const VERSION = '3.4.8';
|
const VERSION = '3.4.9';
|
||||||
|
|
||||||
const API_URL = 'RETAILCRM_ADDRESS';
|
const API_URL = 'RETAILCRM_ADDRESS';
|
||||||
const API_KEY = 'RETAILCRM_API_TOKEN';
|
const API_KEY = 'RETAILCRM_API_TOKEN';
|
||||||
@ -204,7 +204,7 @@ class RetailCRM extends Module
|
|||||||
&& ($this->use_new_hooks ? $this->registerHook('actionValidateCustomerAddressForm') : true)
|
&& ($this->use_new_hooks ? $this->registerHook('actionValidateCustomerAddressForm') : true)
|
||||||
&& $this->installDB()
|
&& $this->installDB()
|
||||||
&& $this->installTab()
|
&& $this->installTab()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -342,21 +342,21 @@ class RetailCRM extends Module
|
|||||||
&& Configuration::deleteByName(RetailcrmCli::CURRENT_TASK_CLI)
|
&& Configuration::deleteByName(RetailcrmCli::CURRENT_TASK_CLI)
|
||||||
&& $this->uninstallDB()
|
&& $this->uninstallDB()
|
||||||
&& $this->uninstallTab()
|
&& $this->uninstallTab()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function enable($force_all = false)
|
public function enable($force_all = false)
|
||||||
{
|
{
|
||||||
return parent::enable($force_all)
|
return parent::enable($force_all)
|
||||||
&& $this->installTab()
|
&& $this->installTab()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function disable($force_all = false)
|
public function disable($force_all = false)
|
||||||
{
|
{
|
||||||
return parent::disable($force_all)
|
return parent::disable($force_all)
|
||||||
&& $this->uninstallTab()
|
&& $this->uninstallTab()
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function installDB()
|
public function installDB()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user