-
Notifications
You must be signed in to change notification settings - Fork 53
Helpful snippets
Want to make small changes to the "Mollie Payments for WooCommerce" plugin? Use these snippets, provided by others users. Use at your own risk!
function remove_mollie_payment_status_message_in_mails(){
global $gateway;
remove_action('woocommerce_email_after_order_table', array($gateway, 'displayInstructions'), 10);
}
add_action( 'woocommerce_email_after_order_table', 'remove_mollie_payment_status_message_in_mails', 1, 0);
By @afeistenauer in Issue 99
Unfortunately it's not possible to change our module to support payment fees. The problem is that our module adds multiple payment methods, and the payment fee modules don't support this.
What I did find was that with some programming you could add the payment fees with the Pay for Payment module (WordPress plugin directory or GitHub). You should add the following code to the plugin Code Snippets or add it to your functions.php file. Below an example for the creditcard payment method.
//add 8 euro's for credit card
function mollie_creditcard_amount ($cost, $calculation_base, $current_gateway, $taxable, $include_taxes, $tax_class)
{
// CreditCard costs 25 cents + 2.8%
return 8;
}
add_filter("woocommerce_pay4pay_mollie_wc_gateway_creditcard_amount", "mollie_creditcard_amount", 10, 6);
Source: Issue 24
The below snippet will shorten the 'Payment completed by' by text on the return page for iDEAL, Sofort, Direct Debit and bank transfer payments. The IBAN and BIC are omitted.
function mollie_payments_change_payment_completed_text( $translated_text ) {
if ( $translated_text == 'Payment completed by <strong>%s</strong> (IBAN (last 4 digits): %s, BIC: %s)' ) {
$translated_text = 'Payment completed by <strong>%s</strong>.';
}
return $translated_text;
}
add_filter( 'gettext', 'mollie_payments_change_payment_completed_text', 20 );