From d09ad6c2e9d001a118e14b304aa437d7aa513732 Mon Sep 17 00:00:00 2001 From: Laury GvR Date: Tue, 9 May 2017 16:16:30 -0400 Subject: [PATCH] Added a processing fee to the Woo Commerce checkout --- functions.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/functions.php b/functions.php index 3f9f30f..b40fd3f 100644 --- a/functions.php +++ b/functions.php @@ -203,7 +203,16 @@ function woo_custom_single_add_to_cart_text() { return __( 'VOTE', 'woocommerce' ); } +add_action( 'woocommerce_cart_calculate_fees','custom_processing_fee' ); +function custom_processing_fee() { + global $woocommerce; + if ( is_admin() && ! defined( 'DOING_AJAX' ) ) + return; + + $fee = 1.00; + $woocommerce->cart->add_fee( 'Processing', $fee, true, 'standard' ); +} /** * Return the client info option for the given key -- 2.17.1