mirror of
https://github.com/retailcrm/opencart-module.git
synced 2025-01-23 03:01:41 +03:00
commit
c057540b9d
@ -4,9 +4,6 @@ require_once __DIR__ . '/../history.php';
|
|||||||
|
|
||||||
class ModelExtensionRetailcrmHistoryV45 extends ModelExtensionRetailcrmHistory
|
class ModelExtensionRetailcrmHistoryV45 extends ModelExtensionRetailcrmHistory
|
||||||
{
|
{
|
||||||
/** @var bool */
|
|
||||||
public static $history_run = false;
|
|
||||||
|
|
||||||
protected $createResult;
|
protected $createResult;
|
||||||
protected $settings;
|
protected $settings;
|
||||||
protected $moduleTitle;
|
protected $moduleTitle;
|
||||||
@ -475,9 +472,9 @@ class ModelExtensionRetailcrmHistoryV45 extends ModelExtensionRetailcrmHistory
|
|||||||
if (isset($this->settings[$this->moduleTitle . '_status_changes'])
|
if (isset($this->settings[$this->moduleTitle . '_status_changes'])
|
||||||
&& $this->settings[$this->moduleTitle . '_status_changes']
|
&& $this->settings[$this->moduleTitle . '_status_changes']
|
||||||
) {
|
) {
|
||||||
static::$history_run = true;
|
\retailcrm\Retailcrm::$history_run = true;
|
||||||
$this->opencartApiClient->addHistory($order['externalId'], $data['order_status_id']);
|
$this->opencartApiClient->addHistory($order['externalId'], $data['order_status_id']);
|
||||||
static::$history_run = false;
|
\retailcrm\Retailcrm::$history_run = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,8 +31,7 @@ class ControllerExtensionModuleRetailcrm extends Controller {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function order_create($trigger, $data, $order_id = null) {
|
public function order_create($trigger, $data, $order_id = null) {
|
||||||
|
if (\retailcrm\Retailcrm::$history_run === true) {
|
||||||
if (ModelExtensionRetailcrmHistoryV45::$history_run === true) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,6 +79,10 @@ class ControllerExtensionModuleRetailcrm extends Controller {
|
|||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function order_edit($trigger, $parameter2 = null) {
|
public function order_edit($trigger, $parameter2 = null) {
|
||||||
|
if (\retailcrm\Retailcrm::$history_run === true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$order_id = $parameter2[0];
|
$order_id = $parameter2[0];
|
||||||
|
|
||||||
$this->load->model('checkout/order');
|
$this->load->model('checkout/order');
|
||||||
|
@ -8,6 +8,9 @@ class Retailcrm {
|
|||||||
protected $apiClient;
|
protected $apiClient;
|
||||||
protected $registry;
|
protected $registry;
|
||||||
|
|
||||||
|
/** @var bool */
|
||||||
|
public static $history_run = false;
|
||||||
|
|
||||||
public function __construct($registry) {
|
public function __construct($registry) {
|
||||||
$this->registry = $registry;
|
$this->registry = $registry;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user