• Is there way to send Trackingnumber in the Order completed Email and not as a customer note E-Mail? Or can you provide me a code which I can insert in the custome-completed email tamplate?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Shadi Manna

    (@shadim)

    Currently this is not possible but in a future version we will either add a setting or a shortcode to allow this.

    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.
    camoeyes

    (@camoeyes)

    Hello I would like to ask that we please integrate with official woocommerce tracking plugin. I think this would make the most since.

    https://docs.woocommerce.com/document/shipment-tracking/

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is there way to send Trackingnumber in Order completed Email?’ is closed to new replies.