要在邮箱通知上显示投递点(如果存在),请使用以下方法:
add_action('woocommerce_email_after_order_table', 'display_delivery_point_on_email_notifications', 10, 1);
function display_delivery_point_on_email_notifications( $order ) {
if ( $delivery_point = $order->get_meta('apaczka_delivery_point') ) {
echo '<style>
.delivery-point table{width: 100%; font-family: \'Helvetica Neue\', Helvetica, Roboto, Arial, sans-serif;
color: #737373; border: 1px solid #e4e4e4; margin-bottom:8px;}
.delivery-point table th, .delivery-point table td{text-align: left; border-top-width: 4px;
color: #737373; border: 1px solid #e4e4e4; padding: 12px;}
</style>';
echo '<div class="delivery-point"><h2>'.__('Delivery Point', 'woocommerce').'</h2>';
echo '<table cellspacing="0" cellpadding="6"><tbody>';
echo '<tr"><td>'.esc_attr($delivery_point['apm_access_point_id'])
. ' (' . esc_attr($delivery_point['apm_supplier']) . '. ' . esc_attr($delivery_point['apm_name']) . ')'.'</td></tr>';
echo '</tbody></table></div><br>';
}
}
代码位于您的子主题的unctions.php文件中(或在插件中).应该能行得通.
Note: Found the displayed Delivery point on Admin single order in:
plugins
> apaczka-pl
> src
> Plugin.php
from line number 89 to 106.