Hello yunse,
I had the same issue and solved it like with this.
1. Go to the dhl-for-woocommerce settings:
> Dashboard > WooCommerce > Settings > Shipping > DHL Paket
> check the checkbox that prevents sending the separate notification email
2. Add a function to get the tracking number to your functions.php in your wordpress child theme:
function acme_get_dhl_tracking_number($order)
{
$meta = $order->get_meta('_pr_shipment_dhl_label_tracking');
if (! $meta) {
return false;
}
if (! array_key_exists('tracking_number', $meta)) {
return false;
}
return $meta["tracking_number"];
}
3. update your email template in your child theme:
// wp-content/themes/<themex-child>/woocommerce/emails/email-order-details.php
/* ... */
$dhl_tracking_number = acme_get_dhl_tracking_number($order);
if ($dhl_tracking_number ) : ?>
<table class="shipment-tracking">
<tr>
<h2><?php _e( 'Track Shipment ', 'woocommerce' ) ?></h2>
<p>
DHL Tracking Number:
<a href="https://nolp.dhl.de/nextt-online-public/report_popup.jsp?idc=<?php echo $dhl_tracking_number?>" target="_blank" style="color: #80b611; font-weight: strong; text-decoration: none;">
<?php echo $dhl_tracking_number?>
</a>
</p>
</tr>
</table>
<?php endif;
/* ... */
-
This reply was modified 5 years, 2 months ago by nikohadouken.