• Resolved katdidit

    (@katdidit)


    Using an example class from the SkyVerge plugin, I am trying to create a custom email that only triggers and sends if a field is present in the post_meta. But I am getting an error that the function get_post_meta is not a valid method “Call to undefined method WC_Order::get_post_meta()”
    I know that get_shipping_method() is valid in the object, am I wrong thinking that get_post_meta() is returned in the object and should be accessible to the class? Or is there another way to check the fields to see if the meta is returned with the object?

    ` $this->object = new WC_Order( $order_id );
    // bail if no recipient_email
    if ( ! in_array( $this->object->get_post_meta(), array( ‘recipient_email’ ) ) )
    return;`

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order object get_post_meta not a method in email class’ is closed to new replies.