Skip to content

Commit

Permalink
Fix #204
Browse files Browse the repository at this point in the history
Fixed fees issue with 'Alma - Pay in installments or later for WooCommerce' payments.
Fix #204
  • Loading branch information
nidhitatosaniya committed Dec 12, 2023
1 parent 73f8f75 commit e79e9aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions includes/class-alg-wc-checkout-fees.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,9 @@ public function add_gateways_fees( $the_cart ) {
if ( strpos( $current_gateway, $klarna_payment ) !== false ) {
$current_gateway = 'klarna_payments';
}
if ( strpos( $current_gateway, 'alma_in_page' ) !== false ) {
$current_gateway = 'alma';
}
// This function is being called twice for carts that contain Subscription products, hence if it's the second time, return.
if ( in_array( 'woocommerce-subscriptions/woocommerce-subscriptions.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ), true ) ) {
if ( did_action( 'woocommerce_cart_calculate_fees' ) > 1 ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ public function settings_section( $sections ) {
if ( 'iyzico_pwi' === $key ) {
$sections[ sanitize_title( $key ) ] = $gateway->method_title;
}
if ( 'alma' === $key ) {
$sections[ sanitize_title( $key ) ] = $gateway->method_title;
}
}
}
return $sections;
Expand Down Expand Up @@ -149,6 +152,9 @@ public function get_settings() {
if ( 'iyzico_pwi' === $key ) {
$gateway->title = $gateway->method_title;
}
if ( 'alma' === $key ) {
$gateway->title = $gateway->method_title;
}
// Adding settings.
$settings = array(
array(
Expand Down

0 comments on commit e79e9aa

Please sign in to comment.