Примерно так
$sp_fee = 0;
$discount_percent = .15;
$discount_title = __( 'Скидка 15% за самовывоз ' );
foreach ( $cart_object->cart_contents as $key => $value ) {
$quantiy = $value[ 'quantity' ];
$itmprice = $value[ 'data' ]->price;
$sales = get_post_meta( $value[ 'product_id' ], 'ex_discount', true );
if ( empty( $sales ) && ! in_array( (int) $value[ 'product_id' ], $combo ) ) {
$sp_fee += $itmprice * $quantiy * $discount_percent;
}
}
if ( ! empty( $discount_percent ) && ! empty( (int) $sp_fee ) ) {
$woocommerce->cart->add_fee( $discount_title, - $sp_fee );
}