Gateway pricing

<?php

// add free string to payment icon
add_filter('woocommerce_gateway_icon', function($icon, $payment_id) {
  $payment_methods = WC()->payment_gateways->get_available_payment_gateways();
  $gateway = $payment_methods[$payment_id];

  $free = true;
  if (isset($gateway) && isset($gateway->settings) && isset($gateway->settings['pay4pay_charges_fixed'])) { // if pay4payment plugin is active
      if ($gateway->settings['pay4pay_charges_fixed'] > 0 || $gateway->settings['pay4pay_charges_percentage'] > 0) {
          $free = false; //pay4payment will handle the price text
      }
  }
  if($free) {
    $icon .= '<b class="text-tertiary font-weight-semi-bold fs-xs ml-1">' . __('Gratis', 'suiteseven') . '</b>';
  }

  return $icon;
}, 10, 3);
Last Updated:
Contributors: Niek Vlam, Suite Seven