Woocommerce-如何仅显示管理员创建的订单注释

时间:2020-09-29 10:22:12

标签: wordpress woocommerce

在我的发票上,我想在订单页面上显示由管理员创建的“公开”订单注释。我使用此代码:

add_action( 'wpo_wcpdf_after_order_details', 'titre', 10, 2 );
function titre() {
    $document = wcpdf_get_document( $template_type, $order );
    $document->order_notes();
    if($document AND !empty($document)){
    echo '<strong>Note client : </strong>';}
    
}
add_action( 'wpo_wcpdf_after_order_details', 'bbloomer_add_note_to_customer_to_PDF_invoice_new', 10, 2 );
 
function bbloomer_add_note_to_customer_to_PDF_invoice_new( $template_type, $order ) {
    $document = wcpdf_get_document( $template_type, $order );
    $document->order_notes();
    return $document;
}
add_action( 'wpo_wcpdf_after_order_details', 'spacing', 10, 2 );
 
function spacing() {
    echo '<br/><br/><br/>';
}

它运作良好,但是如果客户在订单期间也创建了便笺,我就会遇到问题。然后,我的帐单将显示他的便笺+我的便笺(请参见屏幕截图)Screenshot order notes

=>如何调整代码以仅显示站点管理员创建的注释(即不显示客户注释)? 谢谢

0 个答案:

没有答案