From: Laury GvR Date: Tue, 9 May 2017 20:16:30 +0000 (-0400) Subject: Added a processing fee to the Woo Commerce checkout X-Git-Tag: v1.0.0^2~8 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=d09ad6c2e9d001a118e14b304aa437d7aa513732;p=WP-Themes%2Fmunisinghockey.git Added a processing fee to the Woo Commerce checkout --- 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