From aa141ac0264a15106af0c69dfb9506d7ff0141aa Mon Sep 17 00:00:00 2001 From: Gytautas Date: Thu, 14 Mar 2024 15:45:19 +0200 Subject: [PATCH] mail send fix --- saferpayofficial.php | 6 +++--- src/Install/Installer.php | 2 +- upgrade/install-1.2.2.php | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 4 deletions(-) create mode 100644 upgrade/install-1.2.2.php diff --git a/saferpayofficial.php b/saferpayofficial.php index 612fec76..5ec7abee 100755 --- a/saferpayofficial.php +++ b/saferpayofficial.php @@ -40,7 +40,7 @@ public function __construct($name = null) { $this->name = 'saferpayofficial'; $this->author = 'Invertus'; - $this->version = '1.2.1'; + $this->version = '1.2.2'; $this->module_key = '3d3506c3e184a1fe63b936b82bda1bdf'; $this->displayName = 'SaferpayOfficial'; $this->description = 'Saferpay Payment module'; @@ -49,7 +49,6 @@ public function __construct($name = null) 'min' => '1.6.1.0', 'max' => '8.0.4', ]; - parent::__construct($name); $this->autoload(); @@ -557,6 +556,7 @@ public function hookActionEmailSendBefore($params) return true; } $cart = new Cart($params['cart']->id); + /** @var \Order $order */ $order = Order::getByCartId($cart->id); @@ -583,7 +583,7 @@ public function hookActionEmailSendBefore($params) } } - public function hookActionOrderStatusUpdate($params = []) + public function hookActionOrderStatusPostUpdate($params = []) { if (!isset($params['newOrderStatus']) || !isset($params['id_order'])) { return; diff --git a/src/Install/Installer.php b/src/Install/Installer.php index 0e37ed4e..8844e433 100755 --- a/src/Install/Installer.php +++ b/src/Install/Installer.php @@ -94,7 +94,7 @@ private function registerHooks() $this->module->registerHook('actionEmailSendBefore'); $this->module->registerHook('displayAdminOrderTabContent'); $this->module->registerHook('actionAdminControllerSetMedia'); - $this->module->registerHook('actionOrderStatusUpdate'); + $this->module->registerHook('actionOrderStatusPostUpdate'); $this->module->registerHook('actionObjectOrderPaymentAddAfter'); } diff --git a/upgrade/install-1.2.2.php b/upgrade/install-1.2.2.php new file mode 100644 index 00000000..7dcd8be9 --- /dev/null +++ b/upgrade/install-1.2.2.php @@ -0,0 +1,36 @@ + + *@copyright SIX Payment Services + *@license SIX Payment Services + */ + +if (!defined('_PS_VERSION_')) { + exit; +} + +/** + * @param SaferPayOfficial $module + * @return bool + */ +function upgrade_module_1_2_2($module) +{ + return $module->registerHook('actionOrderStatusPostUpdate') && $module->unregisterHook('actionOrderStatusUpdate'); +} +