Newsletter
Are you interested in receiving the latest news about the QuickPay module? Sign up to right now to keep yourself updated.

Need WooCommerce assistance?

Perfect Solution ApS offers extended support on any WooCommerce QuickPay related questions. We can help you optimizing, customizing or setting up your webshop.

Send us an email with more information about you and your website to get a non-binding offer.


Prices start from DKK 400,-

Need WooCommerce assistance?

Code Examples

All custom code should be added to your theme's functions.php, preferrably to your child-theme to avoid data loss when updating your theme.


Automatic language detection with WPML

This snippet detects the current language chosen be the user and uses the same language in the payment window.

function filter_woocommerce_quickpay_language( $language ) {
    if( defined('ICL_LANGUAGE_CODE') ) {
        return ICL_LANGUAGE_CODE;
    }
    return $language;
}
add_filter( 'woocommerce_quickpay_language', 'filter_woocommerce_quickpay_language', 10, 1);

Use custom payment method icons.

If you have a custom payment method icon and wish to override the default icons in the plugin, you may use the filter woocommerce_quickpay_checkout_gateway_icon_url. It takes two parameters:

  • $icon_url - which is the current absolute path of the icon in question.
  • $icon - which is icon identifier, i.e. 'visa', 'mastercard' etc.

Upload your custom logo to any place in your child theme. Lets assume you are using the storefront child theme. In this case you could upload the icon to /wp-content/themes/storefront-child/img/icon-visa.svg.

Insert the code below to override the icon file for visa.

function filter_woocommerce_quickpay_checkout_gateway_icon_url( $icon_url, $icon ) {
    if ('visa' === $icon) {
        $icon_url = get_stylesheet_directory_uri() . '/img/icon-visa.svg';
    }

    return $icon_url;
}
add_filter( 'woocommerce_quickpay_checkout_gateway_icon_url', 'filter_woocommerce_quickpay_checkout_gateway_icon_url', 10, 2);

Make transaction fee taxable.

In some cases a merchant wants to make a transaction taxable when adding it to an order. To manipulate the fee order line added by the plugin use the following filter. woocommerce_quickpay_transaction_fee_data. It takes two parameters:

  • WC_Order_Item_Fee $fee - which is the current order fee item.
  • WC_Order $order - which is current order object

In the following example we are using Danish VAT rates.

/**
 * Modify transaction fee data before saving
 * @param  WC_Order_Item_Fee    $fee_data
 * @param  WC_Order             $order
 * @return array
 */
function woocommerce_quickpay_transaction_fee_data( $fee, $order) {
	// Save a reference of the full total amount returned from the QuickPay transaction
	$total = $fee->get_total();

	// Set the fee to taxable
	$fee->set_tax_status('taxable');

	// Get the total amount without VAT and store it on the object
	$fee->set_total( $total * 0.8);

	// Deduct the VAT amount from the total amount and save it on the object
	$fee->set_total_tax( $total * 0.2);

	// Save the order fee item before returning it.
	$fee->save();

	return $fee;
}
add_filter('woocommerce_quickpay_transaction_fee_data', 'woocommerce_quickpay_transaction_fee_data', 10, 2);