Hi All, looks like we have a pretty smart group here, I am having a similar issues, I want to add a small order fee for order less than $50.00. I am halfway there I am currently using
/* add custom price for small order fee */
add_action( 'woocommerce_cart_totals_before_shipping', 'cp_check_total' );
function cp_check_total() {
global $woocommerce;
$minorder = 50.00;
$excost = 4.95;
if($woocommerce->cart->get_cart()->cart_contents_total>$minorder) {
end();
}elseif($woocommerce->cart->get_cart()->cart_contents_total<$minorder) {
$woocommerce->cart->add_fee( 'Small Order Fee', $excost, $taxable = false,'');
}
}
it is adding the small order fee just fine, but is will add it to all orders regardless of the order total, so even if it is above $50.00 the fee is still added. Any Ideas? Thanks in advance.