Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.0.1 #47

Merged
merged 8 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<module>
<name>ps_cashondelivery</name>
<displayName><![CDATA[Cash on delivery (COD)]]></displayName>
<version><![CDATA[2.0.0]]></version>
<version><![CDATA[2.0.1]]></version>
<description><![CDATA[Accept cash payments on delivery to make it easy for customers to purchase on your store.]]></description>
<author><![CDATA[PrestaShop]]></author>
<is_configurable>0</is_configurable>
Expand Down
2 changes: 1 addition & 1 deletion controllers/front/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function postProcess()
(int) $this->context->cart->id,
(int) Configuration::getGlobalValue(Ps_Cashondelivery::CONFIG_OS_CASH_ON_DELIVERY),
(float) $this->context->cart->getOrderTotal(true, Cart::BOTH),
$this->trans('Cash on delivery', [], 'Modules.Cashondelivery.Shop'),
$this->module->displayName,
null,
[],
(int) $this->context->currency->id,
Expand Down
12 changes: 7 additions & 5 deletions ps_cashondelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,16 @@
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
*/
require_once __DIR__ . '/vendor/autoload.php';

use PrestaShop\PrestaShop\Core\Payment\PaymentOption;

if (!defined('_PS_VERSION_')) {
exit;
}

if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}

use PrestaShop\PrestaShop\Core\Payment\PaymentOption;

class Ps_Cashondelivery extends PaymentModule
{
const HOOKS = [
Expand All @@ -42,7 +44,7 @@ public function __construct()
$this->name = 'ps_cashondelivery';
$this->tab = 'payments_gateways';
$this->author = 'PrestaShop';
$this->version = '2.0.0';
$this->version = '2.0.1';
$this->need_instance = 1;
$this->ps_versions_compliancy = ['min' => '1.7.6.0', 'max' => _PS_VERSION_];
$this->controllers = ['validation'];
Expand Down
18 changes: 14 additions & 4 deletions upgrade/upgrade-1.0.7.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,36 @@
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License version 3.0
* This source file is subject to the Academic Free License 3.0 (AFL-3.0)
* that is bundled with this package in the file LICENSE.md.
* It is also available through the world-wide-web at this URL:
* https://opensource.org/licenses/AFL-3.0
* 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 license@prestashop.com so we can send you a copy immediately.
*
* @author PrestaShop SA and Contributors <contact@prestashop.com>
* @author PrestaShop SA <contact@prestashop.com>
* @copyright Since 2007 PrestaShop SA and Contributors
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License version 3.0
* @license https://opensource.org/licenses/AFL-3.0 Academic Free License 3.0 (AFL-3.0)
*/

use PrestaShop\PrestaShop\Core\Module\WidgetInterface;

if (!defined('_PS_VERSION_')) {
exit;
}

/**
* @param Ps_Cashondelivery $module
*
* @return bool
*/
function upgrade_module_1_0_7($module)
{
$module->unregisterHook('paymentReturn');
$module->registerHook('displayPaymentReturn');
if (method_exists($module, 'hookDisplayPaymentReturn') || $module instanceof WidgetInterface) {
$module->registerHook('displayPaymentReturn');
}

return true;
}