1

I have a subscription product in which I have customized checkout page for this particular product. I want to remove "Recurring Totals" row from checkout and cart page.

Here is my code:

function cart_subtotal_func_unset( $total ) {
    print_r($total);
    unset($totals['cart_subtotal']);
    return $totals;
}
add_filter('woocommerce_cart_item_subtotal', 'cart_subtotal_func_unset', 10, 2);

And here is my screenshot for checkout page.

enter image description here

closed as off-topic by Michael, Jacob Peattie, cjbj, rudtek, Howdy_McGee May 21 at 23:54

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

1

Try filtering the hook woocommerce_cart_calculate_fees.

Use this code. it might work for you.

add_filter( 'woocommerce_cart_calculate_fees', 'add_recurring_postage_fees', 10, 1 );

function add_recurring_postage_fees( $cart ) {
    if ( ! empty( $cart->recurring_cart_key ) ) {
        remove_action( 'woocommerce_cart_totals_after_order_total', array( 'WC_Subscriptions_Cart', 'display_recurring_totals' ), 10 );
        remove_action( 'woocommerce_review_order_after_order_total', array( 'WC_Subscriptions_Cart', 'display_recurring_totals' ), 10 );
    }
}

Not the answer you're looking for? Browse other questions tagged or ask your own question.