Skip to content

Instantly share code, notes, and snippets.

@michaeldoye
Last active August 29, 2015 14:23
Show Gist options
  • Save michaeldoye/907042ddddb94ba31f77 to your computer and use it in GitHub Desktop.
Save michaeldoye/907042ddddb94ba31f77 to your computer and use it in GitHub Desktop.
Add custom fee to cart automatically
<?php
/**
* WooCommerce Extra Feature
*
* Add custom fee to cart automatically
*
*/
function woo_add_cart_fee() {
global $woocommerce;
$woocommerce->cart->add_fee( __('Custom', 'woocommerce'), 5 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment