• Hi,
    I have another issue. When I set the order to “completed” (with a giftcard inside), I get an exception:
    Call to undefined method PW_Gift_Card_Item_Data::get_billing_first_name()

    I think, it has something to do with the giftcard email because the email is not sent, also another email (we send automatically an invoice when setting an order to “completed”) is not sent. I tried both email settings.
    The test email is also not sent.

    Btw, there is a billing first name in the order.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author pimwick

    (@pimwick)

    Can you send me the full error message regarding the “Call to undefined method” error? It should detail precisely which file is throwing the error.

    Based on the information provided, you have another email template that is attempting something like this:

    $order->get_billing_first_name()

    However, in this instance the “$order” object is not a WC_Order but is instead a PW_Gift_Card_Item_Data object. That is why the method is undefined.

    Typically this can be fixed with a quick test of the $order object. Something like:

    if ( is_a( $order, 'WC_Order' ) ) {
        $order->get_billing_first_name();
    }
    Plugin Author pimwick

    (@pimwick)

    I’m marking this thread as resolved but let us know if you have any further questions.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Exception when setting order to “completed”’ is closed to new replies.