Skip to content

Instantly share code, notes, and snippets.

@golchha21
Forked from corsonr/gist:6182904
Created August 14, 2013 05:44
Show Gist options
  • Save golchha21/6228322 to your computer and use it in GitHub Desktop.
Save golchha21/6228322 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;
if ( is_cart() ) {
$woocommerce->cart->add_fee( __('Custom', 'woocommerce'), 5 );
}
}
add_action( 'woocommerce_before_cart_table', 'woo_add_cart_fee' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment