I have fixed it by myself.
But,I want to display these fields in invoice.
Plugin Author
weDevs
(@wedevs)
You need to customize inside the invoice plugin to display those fields.
I am using your dokan invoice.Can you give some help?
Plugin Author
weDevs
(@wedevs)
Add the functions inside dokan-invoice.php file. To get the seller specific data you can use the dokan_get_store_info( $seller_id ); function.
Can you help me with that function to be added in your dokan-invoice.php ?
I will be happy to inform our developer about that. Also, if you are unfamiliar with code/templates, contact a developer.
Yes.I am trying to fetch text field1 in my 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.
Kindly help!!