Last active
February 12, 2021 18:34
-
-
Save webmasterninjay/1083fce16cad7d6dd1186d6c22445acf to your computer and use it in GitHub Desktop.
Woocommerce: Add Additional Fee on cart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Add additional fee ( Handling Fee etc. ) | |
add_action( 'woocommerce_cart_calculate_fees','theme_prefix_additional_fees' ); | |
function theme_prefix_additional_fees() { | |
global $woocommerce; | |
if ( is_admin() && ! defined( 'DOING_AJAX' ) ) | |
return; | |
$fee = 5.00; // add amount | |
$woocommerce->cart->add_fee( 'Handling', $fee, true, 'standard' ); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment