• Resolved ChrisL

    (@chrslcy)


    For those people wanting to ensure that booking details from the Amelie Booking plugin appear in PDF invoices, just add this code to your theme’s functions.php file:

    //
    // ADD AMELIA BOOKING DETAILS TO PDF INVOICE
    // 
    
    add_action( 'wpo_wcpdf_after_item_meta', function( $document_type, $item, $order ) {
        if ($document_type == 'invoice') {
            if ( $extra_option = wc_get_order_item_meta( $item['item_id'], 'ameliabooking', true ) ) {
                $extra_option_array = maybe_unserialize( $extra_option );
        
                if ( is_array( $extra_option_array ) && isset( $extra_option_array['labels'] ) ) {
                    $labels = $extra_option_array['labels'];
                    echo '<div class="booking-details">' . $labels . '</div>';
                } else {
                    echo 'Invalid or missing booking details.';
                }
            }
        }
    }, 10, 3 );
  • The topic ‘Amelia Booking Details in PDF Invoice’ is closed to new replies.