Forked from helpercode0/Add Extra Fees In Woocommerce Programmatically
Created
July 14, 2021 08:33
-
-
Save Nav-Appaiya/5e4a40476470ac0a4abeb3e27bbfa638 to your computer and use it in GitHub Desktop.
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 | |
/** | |
* WooCommerce Extra Feature | |
* -------------------------- | |
* | |
* Add custom fee to cart automatically | |
* | |
*/ | |
function woo_add_cart_fee() { | |
global $woocommerce; | |
$woocommerce->cart->add_fee( __('Custom', 'woocommerce'), 5 ); | |
} | |
add_action( 'woocommerce_cart_calculate_fees', 'woo_add_cart_fee' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment