show extra fields in dokan invoices
-
As per your instruction in this link
https://docs.wedevs.com/how-to-create-extra-fields-in-store-settings-page/We created 4 fields in store settings for sellers.
I want to display Text field1 in invoice.
Here is my code:
/** * Filter Text field1 * * @since 1.1 * * @global type $wpo_wcpdf * * @param type $billing_city * * @return string $billing_city */ function wpo_wcpdf_add_dokan_billing_city( $billing_city ) { global $wpo_wcpdf; // If parent order keep Original Store name else set seller store name if ( $wpo_wcpdf->export->order->post->post_parent == 0 ) { if ( function_exists( 'dokan_get_seller_ids_by' ) ) { $seller_list = dokan_get_seller_ids_by( $wpo_wcpdf->export->order->id ); } else { $seller_list = array_unique( array_keys( dokan_get_sellers_by( $wpo_wcpdf->export->order->id ) ) ); } if ( count( $seller_list ) > 1 ) { return $billing_city; } else { $seller_id = $seller_list[0]; $store_info = dokan_get_store_info( $seller_id ); $billing_city = !empty( $store_info['billing_city'] ) ? $store_info['billing_city'] : __( 'store_info', 'dokan-invoice' ); return $billing_city . '<br /><br />Company Name: ' . $billing_city; } } else { $seller_id = $wpo_wcpdf->export->order->post->post_author; $store_info = dokan_get_store_info( $seller_id ); $billing_city = !empty( $store_info['billing_city'] ) ? $store_info['billing_city'] : __( 'store_info', 'dokan-invoice' ); return $billing_city . '<br /><br />Text field1: ' . $billing_city; } }
I have also added action in dokan-invoice.php
add_filter( 'wpo_wcpdf_billing_city', array( $this,'wpo_wcpdf_add_dokan_billing_city'), 10, 1 );
But,I am unable to get the Text field1 value which is saved in store settings page.I can easily view the field data from seller panel.But,it is not coming in my invoice.
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘show extra fields in dokan invoices’ is closed to new replies.