• Resolved hotcookie

    (@hotcookie)


    Has the filter wpo_wcpdf_payment_method. That filter passes $payment_method and $this. For me to use this filter, it should pass $this->order. Am I missing something here.

    The page I need help with: [log in to see the link]

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

    (@pomegranate)

    yes, you are ??
    $this contains the order object just like it does in the context of the filter. Here’s an example:

    
    add_filter( 'wpo_wcpdf_payment_method', 'wpo_wcpdf_payment_method', 10, 2 );
    function wpo_wcpdf_payment_method( $payment_method, $document ) {
    	if ($document->order->get_payment_method() == 'bacs') {
    		$payment_method .= " (within 30 days)";
    	}
    	return $payment_method;
    }
    
    Thread Starter hotcookie

    (@hotcookie)

    Thanks very much. I realized later that it was a filter, not an action.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Payment Method in Invoice’ is closed to new replies.