first commit

This commit is contained in:
2026-03-05 13:07:40 +01:00
commit 64ba0721ee
25709 changed files with 4691006 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
<?php
/**
* Created by tpay.com.
* Date: 29.01.2018
* Time: 11:57
*/
class AddFee
{
const WOOCOMMERCE = 'woocommerce';
public function addFeeTpay($gatewayId, $fee, $feeAmount)
{
if ((WC()->session->chosen_payment_method) == $gatewayId) {
global $woocommerce;
switch ($fee) {
case 1:
$woocommerce->cart->add_fee(
__('Opłata za płatność online', static::WOOCOMMERCE),
$feeAmount,
true,
'standard'
);
break;
case 2:
$kwota = $woocommerce->cart->cart_contents_total + $woocommerce->cart->shipping_total;
$fee = $kwota * $feeAmount / 100;
$woocommerce->cart->add_fee(
__('Opłata za płatność online', static::WOOCOMMERCE),
$fee,
true,
'standard'
);
break;
default:
break;
}
}
}
}