Added a processing fee to the Woo Commerce checkout
authorLaury GvR <laury@gaslightmedia.com>
Tue, 9 May 2017 20:16:30 +0000 (16:16 -0400)
committerLaury GvR <laury@gaslightmedia.com>
Tue, 9 May 2017 20:16:30 +0000 (16:16 -0400)
functions.php

index 3f9f30f..b40fd3f 100644 (file)
@@ -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