Skip to content

Commit

Permalink
Fixes for PHP 8.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
webchills committed Mar 11, 2024
1 parent 9f5e88e commit 556dbcd
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 23 deletions.
8 changes: 4 additions & 4 deletions ANLEITUNG/index.html
@@ -1,7 +1,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Rabatt für Zahlungsart 1.5.1 für Zen-Cart 1.5.7 deutsch</title>
<title>Rabatt für Zahlungsart 1.6.0 für Zen-Cart 1.5.7 deutsch</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta http-equiv="content-language" content="de">
Expand All @@ -12,7 +12,7 @@
<body>
<div id="wrapper">
<div id="header">
<h1>Rabatt für Zahlungsart 1.5.1 für Zen-Cart 1.5.7 deutsch</h1>
<h1>Rabatt für Zahlungsart 1.6.0 für Zen-Cart 1.5.7 deutsch</h1>
</div>

<div id="slidetabsmenu" style="display: none;">
Expand Down Expand Up @@ -42,9 +42,9 @@ <h2>Sinn und Zweck dieses Moduls</h2>

<h3>Copyright, Changelog, Lizenz</h3>
<p>Copyright<br>
(c) 2022-2023 webchills (<a href="https://www.webchills.at" target="_blank">www.webchills.at</a>)</p>
(c) 2022-2024 webchills (<a href="https://www.webchills.at" target="_blank">www.webchills.at</a>)</p>
<p> Portions Copyright (c) 2003 osCommerce<br>
Portions Copyright (c) 2003-2023 Zen Cart</p>
Portions Copyright (c) 2003-2024 Zen Cart</p>
<p>This contribution is subject to version 3.0 of the GPL license available through the world-wide-web at the following url:<br>
<a href="http://www.zen-cart-pro.at/license/3_0.txt">http://www.zen-cart-pro.at/license/3_0.txt</a></p>
</div>
Expand Down
@@ -1,44 +1,75 @@
<?php
/**
* Package Rabatt fuer Zahlungsart
* @copyright Copyright 2022-2023 webchills (www.webchills.at)
* @copyright Copyright 2003-2023 Zen Cart Development Team
* @copyright Copyright 2022-2024 webchills (www.webchills.at)
* @copyright Copyright 2003-2024 Zen Cart Development Team
* Zen Cart German Version - www.zen-cart-pro.at
* @copyright Portions Copyright 2003 osCommerce
* @license https://www.zen-cart-pro.at/license/3_0.txt GNU General Public License V3.0
* @version $Id: ot_payment_method_discount.php 2023-11-22 17:21:16Z webchills $
*/

* @version $Id: ot_payment_method_discount.php 2024-03-11 14:50:16Z webchills $
*/

if (!defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_PAYMENT_MODULES')) define('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_PAYMENT_MODULES', 'eustandardtransfer');
if (!defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_ENABLED')) define('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_ENABLED', 'false');
if (!defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SHIPPING')) define('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SHIPPING', 'true');

class ot_payment_method_discount extends base
class ot_payment_method_discount
{
public $title;
public $output;
/**
* $_check is used to check the configuration key set up
* @var int
*/
protected $_check;
/**
* $code determines the internal 'code' name used to designate "this" order total module
* @var string
*/
public $code;

/**
* $title is the displayed name for this order total method
* @var string
*/
public $title;
/**
* $output is an array of the display elements used on checkout pages
* @var array
*/
public $output = [];
/**
* $sort_order is the order priority of this order total module when displayed
* @var int
*/
public $sort_order;
public $payment_modules;
public $payment_discount;
public $payment_discounts;

/**
* $description is a soft name for this order total method
* @var string
*/
public $description;
protected $isEnabled = false;


public function __construct()
function __construct()
{
$this->code = 'ot_payment_method_discount';
$this->title = MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_TITLE;
$this->description = MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_DESCRIPTION;
$this->sort_order = defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SORT_ORDER') ? (int)MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SORT_ORDER : null;
if ($this->sort_order === null) {
return false;
}

$this->sort_order = defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SORT_ORDER') ? MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SORT_ORDER : null;
if (null === $this->sort_order) return false;

$this->isEnabled = (defined('MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_ENABLED') && MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_ENABLED == 'true');


$this->payment_modules = explode(',', MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_PAYMENT_MODULES);
$this->output = array();
$this->output = [];
}

public function process() {
function process() {
global $order, $currencies;
$pass = '';
if ($this->isEnabled) {
Expand Down Expand Up @@ -94,7 +125,7 @@ public function process() {
}


public function check()
function check()
{
if (!isset($this->_check)) {
$check = $GLOBALS['db']->Execute(
Expand All @@ -108,7 +139,7 @@ public function check()
return $this->_check;
}

public function keys()
function keys()
{
return array(
'MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_STATUS',
Expand All @@ -120,7 +151,7 @@ public function keys()
'MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_DESTINATION');
}

public function install() {
function install() {
global $db;
$db->Execute('insert into ' . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('This module is installed', 'MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_STATUS', 'true', '', '6', '1','zen_cfg_select_option(array(\'true\'), ', now())");
$db->Execute('insert into ' . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_ORDER_TOTAL_PAYMENT_METHOD_DISCOUNT_SORT_ORDER', '298', 'Sort order of display.', '6', '2', now())");
Expand All @@ -144,7 +175,7 @@ public function install() {
// www.zen-cart-pro.at languages_id==43 END
}

public function remove() {
function remove() {
global $db;
$db->Execute('delete from ' . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')");
// www.zen-cart-pro.at languages_id == delete all
Expand Down

0 comments on commit 556dbcd

Please sign in to comment.