Forums / All Other Contributions/Addons / Payment Module Fee - Order Total Module [Support]

Payment Module Fee - Order Total Module [Support]

Views: 3,938

Results 1 to 20 of 24
19 Jan 2019, 3:17 PM
#1
twitchtoo avatar

twitchtoo

Totally Zenned

Join Date:
Apr 2007
Location:
Ontario, Canada
Posts:
1,733
Plugin Contributions:
14

Payment Module Fee - Order Total Module [Support]

Payment Module Fee - Recovery - Order Total Module

Version 1.1.0
I have this **working **on Zen Cart 1.55f on php 7.1

Twitch.
https://www.twitchtoo.com Do you work for free? Please donate.
June 7.2026 - NOW AVAILABLE - Twitch Base8 - Obsidian

21 Nov 2020, 4:35 PM
#2
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

twitchtoo:

Payment Module Fee - Recovery - Order Total Module

Version 1.1.0
I have this **working **on Zen Cart 1.55f on php 7.1

I get this warning message, do you also and did you fix it?

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ot_paymentmodulefee has a deprecated constructor in C:\xampp73a\htdocs\zencart157a\catalog\includes\modules\order_total\ot_paymentmodulefee.php on line 11.
21 Nov 2020, 4:50 PM
#3
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

zencart 157, php 7.3.9, green responsive classic

21 Nov 2020, 5:57 PM
#4
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Payment Module Fee - Order Total Module [Support]

marton_1:

I get this warning message, do you also and did you fix it?

PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; ot_paymentmodulefee has a deprecated constructor in C:\xampp73a\htdocs\zencart157a\catalog\includes\modules\order_total\ot_paymentmodulefee.php on line 11.


That means this:

class ot_paymentmodulefee {

function ot_paymentmodulefee()

..

needs to change to this:

class ot_paymentmodulefee {

function __construct()

..


There are lots of other PHP code changes to incorporate as well when upgrading from older syntaxes.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

22 Nov 2020, 2:07 PM
#5
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Many thanks, works fine now.

Pity the original authors do not update their work, assuming they are still around and in good health.

22 Nov 2020, 2:43 PM
#6
dbltoe avatar

dbltoe

Totally Zenned

Join Date:
Jan 2004
Location:
N of San Antonio TX
Posts:
9,870
Plugin Contributions:
19

Re: Payment Module Fee - Order Total Module [Support]

One thing to check in your area of the world is whether you can charge extra fees for certain processes.

For example, 10 American states make it illegal to add a surcharge to a credit/debit card transaction. Some of those states allow certified charities to charge.

Some merchants here in Texas get around the law by charging extra for the product and giving a discount for cash. This is what PayPal supports as they do not allow a surcharge to the customer. Not sure of the PayPal rules in Switzerland.

Just a little FYI to make sure you're not violating any local rules.

https://tinyurl.com/ydz3zshx

Need a hand with Zen Cart? Hire the team at myZenCartZone.com for upgrades, repairs, and custom plugins.
Zen Cart Certified hosting at myZenCartHost.com

22 Nov 2020, 2:55 PM
#7
marton_1 avatar

marton_1

Totally Zenned

Join Date:
Apr 2013
Location:
eglisau switzerland
Posts:
568
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

I do not charge extra fees, I give a discount for advance payment.

22 Nov 2020, 8:12 PM
#8
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Payment Module Fee - Order Total Module [Support]

marton_1:

Pity the original authors do not update their work, assuming they are still around and in good health.
Unfortunately Numinix doesn't always keep their plugin submissions up-to-date. You could contact them via their website to ask them to update this one.

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

13 Dec 2022, 9:33 AM
#9
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

The fix above makes the module compatible with the PHP 7.4 and ZC 1.5.7?

DrByte:

Unfortunately Numinix doesn't always keep their plugin submissions up-to-date. You could contact them via their website to ask them to update this one.

28 Jan 2023, 6:27 AM
#10
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

For anyone available to test a ZC158 PHP8.1 compatible version of Payment Module Fee (or Discount)
the files are in my GitHub at https://github.com/OldNGreyBMR/paymentmodulefee/releases/tag/v2.0.0_zc158

This module can add a charge for a payment method OR it can give a discount OR it can do various combinations.

Test this only on a TEST server and not on a Production Server. Backup before testing.

OldNGrey
ZenCart 158 PHP8.1

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

28 Jan 2023, 5:54 PM
#11
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Payment Module Fee - Order Total Module [Support]

OldNGrey:

For anyone available to test a ZC158 PHP8.1 compatible version of Payment Module Fee (or Discount)
the files are in my GitHub at https://github.com/OldNGreyBMR/paymentmodulefee/releases/tag/v2.0.0_zc158

This module can add a charge for a payment method OR it can give a discount OR it can do various combinations.

Test this only on a TEST server and not on a Production Server. Backup before testing.

OldNGrey
ZenCart 158 PHP8.1
Thanks for updating!

Note, though, that PHP 8.2 has a requirement that you pre-define all class variables prior to use, otherwise a PHP error results. So far, the only class variables defined are $title and $output.

31 Jan 2023, 12:48 AM
#12
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

PHP8.2 was going to be the next step.
The zc158 PHP8.2 version is now in my GitHub at https://github.com/OldNGreyBMR/paymentmodulefee/releases/tag/v2.0.1

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

14 May 2023, 3:53 AM
#13
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

I have posted the latest version for approval.

This version 2.0.2 allows for:
ZC 1578d and zc158a compatible with PHP 7.4 to PHP 8.2. ;
correctly includes group discount and coupon credits, and
the version number display in on the Admin page

GitHub repository: https://github.com/OldNGreyBMR/paymentmodulefee
The plugin download page is : https://www.zen-cart.com/downloads.php?do=file&id=1487

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

30 Mar 2024, 11:42 AM
#14
georgecy avatar

georgecy

New Zenner

Join Date:
Jan 2015
Location:
Cyprus
Posts:
83
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Hi Guys is it possible to allow discount of less than 1% with this module? Currently is set to integer format and 1% is the minimum it can accept. For example if the customer pays by Bank Transfer he gets 0.5% discount.

30 Mar 2024, 12:18 PM
#15
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,729
Plugin Contributions:
56

Re: Payment Module Fee - Order Total Module [Support]

Change the (int) casts in the process() function to (float) casts and it should work.

@OldNGrey, this change should be made to the official version.

That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.

31 Mar 2024, 9:58 PM
#16
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Version 2.0.3 has been submitted for approval.
This version allows fee < 1 ; allows decimal in discount value

GitHub repository: https://github.com/OldNGreyBMR/paymentmodulefee
The plugin download page is : https://www.zen-cart.com/downloads.php?do=file&id=1487

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

16 Jun 2026, 6:33 AM
#17
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Version 2.0.4 has been submitted for approval.
This version is fully encapsulated and the installer removes legacy files.
Compatible with ZC1.5.8a to 2.2.2 and PHP 8.2 to 8.5

GitHub repository: https://github.com/OldNGreyBMR/paymentmodulefee

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB

25 Jul 2026, 3:55 PM
#18
mcqueeneycoins avatar

mcqueeneycoins

Zen Follower

Join Date:
Jan 2008
Posts:
156
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Hi, looking for guidance on what code might need to be modified to change how the payment module fee/discount displays on the order total summary. I know the default ZC format is $-X.XX for negative numbers, but when used with discount coupons (which display as -$X.XX) it is inconsistent. I would like for discounts/subtractions to display as -$X.XX. Can this be modified within this module, or would this be more of a site-wide file change? Thanks in advance.

Sub-Total: $50.00
Payment Method Discount: $-1.40
Gift Certificates, Coupons & Promo Codes (TEST): -$2.43
USPS Ground Advantage® (3-8 days): $5.95
CA State Sales Tax (7.25%): $3.45
Total: $55.57

26 Jul 2026, 3:45 AM
#19
mcqueeneycoins avatar

mcqueeneycoins

Zen Follower

Join Date:
Jan 2008
Posts:
156
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

mcqueeneycoins:

Hi, looking for guidance on what code might need to be modified to change how the payment module fee/discount displays on the order total summary. I know the default ZC format is $-X.XX for negative numbers, but when used with discount coupons (which display as -$X.XX) it is inconsistent. I would like for discounts/subtractions to display as -$X.XX. Can this be modified within this module, or would this be more of a site-wide file change? Thanks in advance.

Sub-Total: $50.00
Payment Method Discount: $-1.40
Gift Certificates, Coupons & Promo Codes (TEST): -$2.43
USPS Ground Advantage® (3-8 days): $5.95
CA State Sales Tax (7.25%): $3.45
Total: $55.57

I managed to figure out how to fix this display by adding the following code around line 151. This may not work for everyone as I am only using the module for cash/check discounts, not surcharges, so my output will always be negative:

$this->output[] = array(
                            'title' => $this->title . ':',
                            'text' => '-' . $currencies->format(abs($payment_module_fee), true, $order->info['currency'], $order->info['currency_value']),
                            'value' => $payment_module_fee
                        );

However, now I've noticed a new issue (not caused by this change as it was present before any changes)--the sales tax is not being recalculated after the discount is applied. In the example above, the sales tax was calculated based on the sub-total less coupon code discount, but did not factor in the payment method discount. I have tried changing the sort order but does not seem to make a difference. Is it supposed to recalculate sales tax, or is there a setting I'm missing? Thanks.

26 Jul 2026, 9:38 PM
#20
oldngrey avatar

oldngrey

Zen Follower

Join Date:
Apr 2008
Location:
Qld, Australia
Posts:
429
Plugin Contributions:
0

Re: Payment Module Fee - Order Total Module [Support]

Firstly:
What versions of; Zen cart; PHP and ot_PaymentModuleFee are you running?
What value have you configured in ot_PaymentModuleFee for the discount?

In my old zc158a on PHP8.3 with a modified clone of Bootstrap template, ot_PaymentModuleFee v2.0.4 non plugin install, the discount shows with a - sign.
The same in zc222 with PHP 8.5 with a clone of Bootstrap template, ot_PaymentModuleFee v2.0.4 plugin install.

OldNGrey
ZC222 PHP 8.4.16
MySQL 11.8.5-MariaDB