Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor Ewout

    (@pomegranate)

    Hi! Without knowing how this is stored in the order this question is difficult to answer, but this might do the trick (make sure the text matches the one on the invoice):

    add_filter( 'wpo_wcpdf_woocommerce_totals', 'wpo_wcpdf_remove_future_payments' );
    function wpo_wcpdf_remove_future_payments ( $totals ) {
    	foreach ($totals as $key => $total) {
    		$totals_label = 'Future Payments';
    		if ( strpos( $total['label'], $totals_label ) !== false) {
    			unset($totals[$key]);
    		}
    	}
    	return $totals;
    }

    Let me know if that helps!

    Ewout

    Thread Starter titanhorsetrailers

    (@titanhorsetrailers)

    Hi, that didnt work unfortunately. How do i find out how it is stored in the order?
    Thanks, Mandy

    Plugin Contributor Ewout

    (@pomegranate)

    Hi Mandy,
    You can output to HTML (see Status tab in the settings), then inspect element on the totals. Take the class from the tr (so for example, “cart_subtotal” for the Subtotal), and use that to unset that row:

    add_filter( 'wpo_wcpdf_woocommerce_totals', 'wpo_wcpdf_remove_future_payments' );
    function wpo_wcpdf_remove_future_payments ( $totals ) {
    	$remove = 'cart_subtotal'; // replace this with the total row you want to remove
    	if ( isset( $totals[$remove] ) ){
    		unset( $totals[$remove] );
    	}
    
    	return $totals;
    }

    I forgot to link to our documentation about using filters. Sounds like you know what to do with this, but for anyone else that needs to do the same:

    How to use filters

    Ewout

    Thread Starter titanhorsetrailers

    (@titanhorsetrailers)

    That worked, thank you so much. For anyone else who needs to know $remove=’future’

    Thread Starter titanhorsetrailers

    (@titanhorsetrailers)

    Resolved!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Future payments’ is closed to new replies.