projects
/
WP-Themes
/
munisinghockey.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b1aa1fb
)
Added a processing fee to the Woo Commerce checkout
author
Laury GvR
<laury@gaslightmedia.com>
Tue, 9 May 2017 20:16:30 +0000
(16:16 -0400)
committer
Laury GvR
<laury@gaslightmedia.com>
Tue, 9 May 2017 20:16:30 +0000
(16:16 -0400)
functions.php
patch
|
blob
|
history
diff --git
a/functions.php
b/functions.php
index
3f9f30f
..
b40fd3f
100644
(file)
--- 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