Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter pramukpor

    (@pramukpor)

    Awesome, thank you! I was checking Vendidero\StoreaBill\Invoice\Simple and Vendidero\StoreaBill\Emails\SimpleInvoice, but Vendidero\StoreaBill\Invoice\Invoice had what I was looking for.

    • This reply was modified 2 years, 1 month ago by pramukpor.
    Thread Starter pramukpor

    (@pramukpor)

    Ok, thank you. I have one question about the hook you’ve pointed out. Is there a way to access the order object/order id inside of it?

    Example:

    add_filter( 'woocommerce_email_recipient_sab_simple_invoice', 'your_email_recipient_filter_function', 10, 3);
    
    function your_email_recipient_filter_function($recipient, $object, $email) {
    	
        $order = new WC_Order( $object ); // create new order object
        $rechnung_email = $order->get_meta( '_billing_email_rechnung', true );
        
        if ($rechnung_email) {
           $recipient = $rechnung_email;
        }
        return $recipient;
    }
Viewing 2 replies - 1 through 2 (of 2 total)