How to Hide Shipping cost on the DHL Express Commercial Invoice? (Code Snippet)

You are here:

Shipping cost appears by default in our DHL Commercial invoice, generated using ELEX DHL Shipping Plugin. You can choose to hide this shipping cost with the help of a simple code snippet.

Code Snippet to hide Shipping cost on DHL Express Commercial Invoice

Add the following code snippet at the end of the functions.php file of your activated website theme.

/* Filter to disable Shipping cost on the Commercial Invoice */
add_filter("disable_shipping_cost_commercial_invoice_elex_dhl_express", "disable_shipping_cost_commercial_invoice_elex_dhl_express", 10, 1);

function disable_shipping_cost_commercial_invoice_elex_dhl_express($package_details){
    $package_details['total'] -= $package_details['shipping_cost']; 
    unset($package_details['shipping_cost']);
    return $package_details;
}

The above filter will disable shipping cost in DHL Express commercial invoice.

 


To explore more details about the plugins, go check out ELEX WooCommerce DHL Express / eCommerce / Paket Shipping Plugin with Print Label.

Read the product documentation of DHL Express to understand the plugin, in detail. Or check out the knowledge base section for more related articles.

You can also check out other WooCommerce and WordPress plugins in ELEX.

    Leave a Reply

    WordPress Image Lightbox Plugin