Snippets

Oscar García Arenas Pay4Pay Extra fee integration

Created by Oscar García Arenas
function pbc_cod_pay4pay_charges( $value, $option ) {
  if ( $option == 'woocommerce_cod_settings' && ! empty( $value['pay4pay_charges_fixed'] ) ) {
	$value['pay4pay_charges_fixed'] = $value['pay4pay_charges_fixed'] * WCPBC()->customer->exchange_rate;
  }
  return $value;
}

function pbc_init_pay4pay_charges() {
	add_filter( 'option_woocommerce_cod_settings' , 'pbc_cod_pay4pay_charges', 10, 2 );
}
add_action( 'wc_price_based_country_frontend_princing_init', 'pbc_init_pay4pay_charges' );

Comments (0)

HTTPS SSH

You can clone a snippet to your computer for local editing. Learn more.