Skip to content

Instantly share code, notes, and snippets.

@michaelaguiar
Forked from corsonr/gist:6182904
Last active August 29, 2015 14:19
Show Gist options
  • Save michaelaguiar/25cf113030b369a66d40 to your computer and use it in GitHub Desktop.
Save michaelaguiar/25cf113030b369a66d40 to your computer and use it in GitHub Desktop.
<?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