Wordpress woo commerce yith pdf发票和发货清单供应商详细信息、地址、名称

Wordpress woo commerce yith pdf发票和发货清单供应商详细信息、地址、名称,wordpress,pdf,woocommerce,invoice,dokan,Wordpress,Pdf,Woocommerce,Invoice,Dokan,我想在pdf发票和发货单中显示供应商详细信息,如地址、店铺名称、姓名、电话号码。我正在使用dokan插件 这些是我试过的代码 add_action( 'Vendor_details', 'display_author_name', 20 ); function display_author_name() { // Get the author ID (the vendor ID) $vendor_id = get_post_field( 'post_author', get_th

我想在pdf发票和发货单中显示供应商详细信息,如地址、店铺名称、姓名、电话号码。我正在使用dokan插件

这些是我试过的代码

add_action( 'Vendor_details', 'display_author_name', 20 );
function display_author_name() {
    // Get the author ID (the vendor ID)
    $vendor_id = get_post_field( 'post_author', get_the_id() );
    // Get the WP_User object (the vendor) from author ID
    $vendor = new WP_User($vendor_id);

    $store_info  = dokan_get_store_info( $vendor_id ); // Get the store data
    $store_name  = $store_info['store_name'];          // Get the store name
    $store_url   = dokan_get_store_url( $vendor_id );  // Get the store URL

    $vendor_name = $vendor->display_name;              // Get the vendor name
    $address     = $vendor->billing_address_1;           // Get the vendor address
    $postcode    = $vendor->billing_postcode;          // Get the vendor postcode
    $city        = $vendor->billing_city;              // Get the vendor city
    $state       = $vendor->billing_state;             // Get the vendor state
    $country     = $vendor->billing_country;           // Get the vendor country

    // Display the seller name linked to the store
    printf( '<b>Seller Name:</b> <a href="%s">%s</a>', $store_url, $store_name );
}
添加操作('Vendor\u details','display\u author\u name',20);
函数显示\u作者\u姓名(){
//获取作者ID(供应商ID)
$vendor_id=get_post_字段('post_author',get_the_id());
//从作者ID获取WP_用户对象(供应商)
$vendor=新的WP\u用户($vendor\u id);
$store\u info=dokan\u get\u store\u info($vendor\u id);//获取存储数据
$store\u name=$store\u info['store\u name'];//获取店铺名称
$store\u url=dokan\u get\u store\u url($vendor\u id);//获取商店url
$vendor\u name=$vendor->display\u name;//获取供应商名称
$address=$vendor->billing\u address\u 1;//获取供应商地址
$postcode=$vendor->billing\u postcode;//获取供应商的邮政编码
$city=$vendor->billing\u city;//获取供应商城市
$state=$vendor->billing_state;//获取供应商状态
$country=$vendor->billing\u country;//获取供应商国家/地区
//显示链接到商店的卖家名称
printf('Seller Name:',$store\u url,$store\u Name);
}