Skip to content

Commit

Permalink
Merge pull request #154 from Invertus/SL-212/ord-conf-mail-fix
Browse files Browse the repository at this point in the history
SL-212/ Mail send fix
  • Loading branch information
GytisZum authored Mar 14, 2024
2 parents 4263151 + aa141ac commit 0539f59
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 4 deletions.
6 changes: 3 additions & 3 deletions saferpayofficial.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -49,7 +49,6 @@ public function __construct($name = null)
'min' => '1.6.1.0',
'max' => '8.0.4',
];

parent::__construct($name);

$this->autoload();
Expand Down Expand Up @@ -557,6 +556,7 @@ public function hookActionEmailSendBefore($params)
return true;
}
$cart = new Cart($params['cart']->id);

/** @var \Order $order */
$order = Order::getByCartId($cart->id);

Expand All @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/Install/Installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

Expand Down
36 changes: 36 additions & 0 deletions upgrade/install-1.2.2.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php
/**
*NOTICE OF LICENSE
*
*This source file is subject to the Open Software License (OSL 3.0)
*that is bundled with this package in the file LICENSE.txt.
*It is also available through the world-wide-web at this URL:
*http://opensource.org/licenses/osl-3.0.php
*If you did not receive a copy of the license and are unable to
*obtain it through the world-wide-web, please send an email
*to [email protected] so we can send you a copy immediately.
*
*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 INVERTUS UAB www.invertus.eu <[email protected]>
*@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');
}

0 comments on commit 0539f59

Please sign in to comment.