在我的发票上,我想在订单页面上显示由管理员创建的“公开”订单注释。我使用此代码:
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/>';
}
它运作良好,但是如果客户在订单期间也创建了便笺,我就会遇到问题。然后,我的帐单将显示他的便笺+我的便笺(请参见屏幕截图)
=>如何调整代码以仅显示站点管理员创建的注释(即不显示客户注释)? 谢谢